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

2012-11-07 16:23, Simon Pieters wrote:

> Hixie's argument is, I think, that the use case that <main> is intended
> to address is already possible by applying the Scooby-Doo algorithm, as
> James put it -- remove all elements that are not main content, <header>,
> <aside>, etc., and you're left with the main content.

Hixie's idea is sufficient for determining the main content (in some 
sense) on a page that systematically uses the new structuring elements. 
This in turn is sufficient for some styling purposes, but not all purposes.

> I think the Scooby-Doo algorithm is a heuristic that is not reliable
> enough in practice, since authors are likely to put stuff outside the
> main content that do not get filtered out by the algorithm, and vice versa.

That's one point. Another point is that authors don't really need to use 
all the <header>, <nav>, etc. elements, and validation does not check 
for this. E.g., if you just want to have some styles that only apply to 
the main content, you might want to use just <main> and not all the 
other stuff.

But perhaps the strongest argument in favor of <main> is that the 
Scooby-Doo algorithm may determine the content, but it does not make it 
an element, on any DOM node. And elementhood is essential for many 
styling and scripting purposes.

> Implementations that want to support a "go to main content" or
> "highlight the main content", like Safari's Reader Mode, or whatever
> it's called, need to have various heuristics for detecting the main
> content, and is expected to work even for pages that don't use any of
> the new elements. However, I think using <main> as a way to opt out of
> the heuristic works better than using <aside> to opt out of the
> heuristic.

Sounds logical. And the Reader Mode functionality that you mention is 
one of the few signs of any meaningful support to the new structuring 
elements. There is much talk about the assumed "semantic" benefits of 
those elements, much less evidence of real benefits.

I suppose that the heuristics would include recognizing a <div> element 
to which class "main" has been assigned. Then one could argue that 
<main> is not needed, as authors can keep using <div class="main">, as 
millions of pages use. Then again, a similar argument would apply to 
<header> and friends.

> If there is anyone besides from Hixie who objects to adding <main>, it
> would be useful to hear it.

Well, I haven't seen much point in any of the new structuring elements 
in general, but the browser behavior you write about would make <main> 
much more relevant than the others.

Yucca

Received on Wednesday, 7 November 2012 14:49:20 UTC