This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 12631 - Note the disadvantage of using only h1 + section
Summary: Note the disadvantage of using only h1 + section
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: LC1 HTML5 spec (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-08 07:58 UTC by Peter Winnberg
Modified: 2011-08-04 05:14 UTC (History)
6 users (show)

See Also:


Attachments

Description Peter Winnberg 2011-05-08 07:58:54 UTC
The third example in Section 4.4.11 ( http://dev.w3.org/html5/spec/Overview.html#headings-and-sections ) only uses section and h1 elements to markup sections and headings. It is noted that following this pattern could make the document easier to maintain which is true.

What isnt noted is that this is problematic because in older browsers, that doesnt support the outline algorithm or the section element, this example would just be a list of level 1 headings without any "subsections".

I think this disadvantage should be noted or that all examples that use this pattern should be changed to use h2, h3, h4, h5, and h6 where appropriate in addition to h1 to make it compatible with older browsers.

Section 4.4.6 ( http://dev.w3.org/html5/spec/Overview.html#the-h1-h2-h3-h4-h5-and-h6-elements ) have the same problem.
Comment 1 Ms2ger 2011-05-08 14:30:36 UTC
You mean a warning that new features may not work in old browsers? Isn't that obvious?
Comment 2 Peter Winnberg 2011-05-08 15:24:51 UTC
(In reply to comment #1)
> You mean a warning that new features may not work in old browsers? Isn't that
> obvious?

I thought that I explained the issue clearly but I guess not. The problem here is not the section element that is a new feature in HTML5, older browser will just ignore if they cannot handle it and thats fine. The problem is how the h1, h2, h3, h4, h5, and h6 elements are used and none of these are new in HTML5. Lets take an example:

<section>
<h1>Heading A</h1>
<section>
<h1>Heading B</h1>
</section>
</section>

In a browser that understands HTML5 this is the same thing as:

<section>
<h1>Heading A</h1>
<section>
<h2>Heading B</h2>
</section>
</section>

And the first example, that just uses h1 and section, could be easier to maintain because sections could be moved around without changing which level the heading has just like the spec says. 

The problem is that if an older browser is used the fact that Heading B is a subheading of Heading A is lost because they are both h1 elements. The second example, on the other hand, does not have this problem.

So the first example is just a "lazy" way of writing whats in the second example that provides advantages (maintainability) for the author of the document. But only has disadvantages for a user of the document (less compatibility with older browsers) so thats why I think that the specification needs to be changed.
Comment 3 Tab Atkins Jr. 2011-05-09 17:29:09 UTC
What meaning do you think that older browsers extract from the page?  In nearly all older browsers, the only difference between <h1> and <h2> is the CSS that applies to them - the browsers don't have any higher notion of what the tags mean.  Authors will be styling the headings manually for some time anyway, so that's taken care of in legacy browsers.
Comment 4 Peter Winnberg 2011-05-09 17:54:24 UTC
(In reply to comment #3)
> What meaning do you think that older browsers extract from the page?  In nearly
> all older browsers, the only difference between <h1> and <h2> is the CSS that
> applies to them - the browsers don't have any higher notion of what the tags
> mean.  Authors will be styling the headings manually for some time anyway, so
> that's taken care of in legacy browsers.

If you are suggesting that the hX elements are only used for visual presentation then you're wrong.

Just some links:
http://www.w3.org/TR/WCAG20-TECHS/G141
http://www.456bereastreet.com/archive/201003/heading_navigation_in_web_browsers/
http://addons.mozilla.org/en-us/firefox/addon/headingsmap/
Comment 5 Tab Atkins Jr. 2011-05-09 18:00:24 UTC
No, I said that "In nearly all older browsers, the only difference between <h1> and <h2> is the CSS that applies to them".  Opera does pay attention to them in a limited fashion if you turn on a setting.  Other browsers don't at all, though some extensions that third parties have written do.  

The WCAG guidelines were written before explicit sectioning was added to HTML, and thus cannot be looked to for advice on how to deal with explicit sectioning.  In any case, the WCAG Techniques document is not a browser implementation, it's a set of advice.
Comment 6 Peter Winnberg 2011-05-09 18:13:46 UTC
(In reply to comment #5)
> No, I said that "In nearly all older browsers, the only difference between <h1>
> and <h2> is the CSS that applies to them".  Opera does pay attention to them in
> a limited fashion if you turn on a setting.  Other browsers don't at all,
> though some extensions that third parties have written do.  
> 
> The WCAG guidelines were written before explicit sectioning was added to HTML,
> and thus cannot be looked to for advice on how to deal with explicit
> sectioning.  In any case, the WCAG Techniques document is not a browser
> implementation, it's a set of advice.

And of course, you're absolutely correct, the WCAG is not a browser implementation. But I thought that would be enough for you to understand that this is important in the context of assistive technology ( which is *implemented* ). In addition to the support in mainstream user agents.

If needed I could try to track down specific implementations, but that should not really be needed because all I wanted added was a small note that using only h1 + section does have disadvantages. I am not asking for any major changes.
Comment 7 Ian 'Hixie' Hickson 2011-08-03 07:18:13 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: see diff given below
Rationale: Concurred with reporter's comments.
Comment 8 contributor 2011-08-03 07:19:12 UTC
Checked in as WHATWG revision r6359.
Check-in comment: mention legacy UAs
http://html5.org/tools/web-apps-tracker?from=6358&to=6359
Comment 9 Michael[tm] Smith 2011-08-04 05:14:47 UTC
mass-move component to LC1