Skip to main content
The 2024 Developer Survey results are live! See the results

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • While I do agree with you, the interesting thing is that in the spec there is no mention of this "rule". I checked before even posting this question. And yes the dialog I was looking at (The Incredible Accesible Dialog) is in fact tested with a number of screen readers (listed at the bottom), so they would not use ARIA roles lightly.
    – Dogoku
    Commented Jul 20, 2016 at 2:11
  • 3
    1. The spec does mention the <h1> "rule" and has had a warning since HTML5.0 along with open bugs to fix it. 2. See the blog post about the dialog: "removed the role=”document” from the contents of the window. This was originally inserted to deal with the way NVDA interacted with role=”dialog”, but that issue has since been resolved in NVDA."
    – aardrian
    Commented Jul 20, 2016 at 2:52
  • 1
    As of October 2020, the first example in "§ 4.3.3 The section element" states: "Notice how the use of section means that the author can use h1 elements throughout, without having to worry about whether a particular section is at the top level, the second level, the third level, and so on." See: html.spec.whatwg.org/multipage/…
    – gfullam
    Commented Oct 22, 2020 at 21:26
  • 2
    Which is incredibly frustrating considering it also lists <hgroup> (which has no support) and leans on the Document Outline Algorithm which has never been implemented. So if you are supporting users, ignore that part of the spec. If you are targeting code compliance, go nuts. Ref: adrianroselli.com/2016/08/…, codepen.io/stevef/post/a-decade-of-heading-backwards
    – aardrian
    Commented Oct 29, 2020 at 20:40
  • 1
    This again depends on the context of the dialog – dialog does however not appear to be a sectioning content or section root element, which is inconsistent and a bit odd given it can be useful to give dialogs a heading. I can not find any WHATWG mention of it being "sectioning root" anymore, but it used to say this in w3 specifications: w3.org/TR/2018/WD-html53-20180809/… Not sure if this means we should avoid using headings entirely in dialogs, and perhaps use something else, like a more neutral p or div however.
    – Jacob
    Commented Aug 9, 2023 at 9:07