W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2012

Re: [whatwg] A plea to Hixie to adopt <main>

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 27 Nov 2012 23:35:08 +0000 (UTC)
To: Silvia Pfeiffer <silviapfeiffer1@gmail.com>
Message-ID: <Pine.LNX.4.64.1211272321210.12469@ps20323.dreamhostps.com>
Cc: whatwg <whatwg@whatwg.org>
On Wed, 28 Nov 2012, Silvia Pfeiffer wrote:
> >
> > But we already have this. The main content is whatever content isn't 
> > marked up as not being main content (anything not marked up with 
> > <header>, <aside>, <nav>, etc).
> 
> I tried to validate that claim. It's not really possible with today's 
> Web pages, since they haven't moved to making use of these elements, but 
> I made some educated guesses as to where they would be used sensibly on 
> a normal Web page. I have applied this to Google search results, 
> Facebook user pages, YouTube video pages, and Wikipedia articles as 
> examples of some of the most used content on the Web. You can see my 
> results at 
> http://blog.gingertech.net/2012/11/28/the-use-cases-for-a-main-element-in-html/.

I think you're massively over-complicating what needs to be authored here.

For example, with a Google search, just mark up everything up to the 
id="main" in a <header>, mark up the id="top_nav" as a <nav>, and mark up 
the id="foot" in a <footer>, and what's left is the main content. (Note 
that this does _not_ map to what the authors would have marked up using 
<main>, as determined by looking at what they marked up with id="main" -- 
that contains the navigation.)

I don't have a Facebook account so haven't checked that one.

I don't know what you'd mark up on youtube.com because I don't know what 
is the main content there. But marking up all the children of 
id="body-container" as <header> except the id="page-container" child, and 
marking the id="guide-container" and first class="branded-page-v2- 
secondary-col" as <aside>, would make the stream in the middle be the 
first "main" content, which is probably what the page author intended. 
This again doesn't match what the author would likely use for <main> -- 
id="content" -- which contains the second of those <aside>s currently.

Wikipedia already has role=main on the appropriate element, and all the 
stuff that isn't main (except the appeal) comes after that, so they're 
fine either way, even without ARIA. Their <div>s map pretty directly to 
the elements in HTML so that the algorithm I describe above would surface 
the main content fine.


> I believe that none of the heuristic approaches work 100% of the time.

Sure. Nor would <main>. However, on pages written correctly, <main> would 
work no better than what HTML already has. Moreover, the difference is 
that this is <main>'s only purpose, and so the fact that it doesn't solve 
it all the time means it can't be relied upon, whereas the other elements 
have other purposes, so that they don't satisfy this 100% of the time 
doesn't make them pointless.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 27 November 2012 23:40:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:11 GMT