W3C home > Mailing lists > Public > public-html@w3.org > January 2013

Re: Context of the main element

From: Gez Lemon <g.lemon@webprofession.com>
Date: Thu, 31 Jan 2013 19:55:47 +0000
Message-ID: <CAN-oN21hUbDP1g=XqfQ4jGo8SPUtM3GhCC3Au87s4AiOWCtYSQ@mail.gmail.com>
To: Jeremy Keith <jeremy@adactio.com>
Cc: "HTML WG (public-html@w3.org)" <public-html@w3.org>
Hi Jeremy,

I do understand your point about elements being scoped to their
section, but the advantage of the main element is to unambiguously
determine the most important content area for people that cannot
identify that visually.

An unambiguous main content area might be visually evident, but not so
easy to find for screen reader users. When a screen reader user
navigates through the page and hears "Main" as a landmark, it's
important that they understand this is the start of *the* main
section, rather than the main section of a sub-section, as the
sub-sections are not announced at the same time due to verbosity
reasons.

Cheers,

Gez


On 31 January 2013 15:24, Jeremy Keith <jeremy@adactio.com> wrote:
> Hi all,
>
> I have a question about the context of the newly-landed main element (so probably a question for Steve then).
>
> http://www.w3.org/html/wg/drafts/html/master/grouping-content.html#the-main-element
>
> I'm curious as to why its use is specifically restricted to the body element rather than any kind of sectioning content.
>
> ""Authors must not include more than one main element in a document."
>
> I get the rationale behind the main element: it plugs a gap in the overlap between native semantics and ARIA roles (namely role="main"). But if you look at the other elements that map to ARIA roles (header, footer, nav), those elements can be used multiple times in a single document by being scoped to their sectioning content ancestor.
>
> Let's say, for example, that I have a document like this, containing two header elements:
>
> <body>
>  <header>Page header</header>
>  Page main content starts here
>  <section>
>   <header>Section header</header>
>   Section main content
>  </section>
>  Page main content finishes here
> </body>
>
> ...only the first header element (the one that's scoped to the body element) will correspond to role="banner", right?
>
> Similarly, in this example, only the final footer element will correspond to role="contentinfo":
>
> <body>
>  <header>Page header</header>
>  Page main content starts here
>  <section>
>   <header>Section header</header>
>   Section main content
>   <footer>Section footer</footer>
>  </section>
>  Page main content finishes here
>  <footer>Page footer</footer>
> </body>
>
> So what I don't understand is why we can't have the main element work the same way i.e. scope it to its sectioning content ancestor so that only the main element that is scoped to the body element will correspond to role="main":
>
> <body>
>  <header>Page header</header>
>  <main>
>   Page main content starts here
>   <section>
>    <header>Section header</header>
>    <main>Section main content</main>
>    <footer>Section footer</footer>
>   </section>
>   Page main content finishes here
>  </main>
>  <footer>Page footer</footer>
> </body>
>
> Here are the corresponding ARIA roles:
>
> <body>
>  <header>Page header</header> <!-- role="banner" -->
>  <main>Page main content</main> <!-- role="main" -->
>  <footer>Page footer</footer> <!-- role="contentinfo" -->
> </body>
>
> Why not allow the main element to exist within sectioning content (section, article, nav, aside) the same as header and footer?
>
> <section>
>  <header>Section header</header> <!-- no corresponding role -->
>  <main>Section main content</main> <!-- no corresponding role -->
>  <footer>Section footer</footer> <!-- no corresponding role -->
> </section>
>
> Deciding how to treat the main element would then be the same as header and footer. Here's what the spec says about the scope of footers:
>
> "When the nearest ancestor sectioning content or sectioning root element is the body element, then it applies to the whole page."
>
> I could easily imagine the same principle being applied to the main element. From an implementation viewpoint, this is already what browsers have to do with header and footer. Wouldn't it be just as simple to apply the same parsing rule to the main element?
>
> It seems a shame to introduce a new element that can only be used zero or one time in a document ...I think the head and body elements are the only other elements with this restriction (and I believe the title element is the only element that is used precisely once per document).
>
> It would be handy to be able to explicitly mark up the main content of an article or an asideā€”for exactly the same reasons that it would be useful to mark up the main content of a document.
>
> So why not?
>
> --
> Jeremy Keith
>
> a d a c t i o
>
> http://adactio.com/
>
>
>



-- 
_____________________________
Supplement your vitamins
http://juicystudio.com
http://twitter.com/gezlemon
Received on Thursday, 31 January 2013 19:56:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 31 January 2013 19:56:16 GMT