[Bug 11731] New: Replace <hgroup> element with a <subhead> element used as the child of the <hx> element

http://www.w3.org/Bugs/Public/show_bug.cgi?id=11731

           Summary: Replace <hgroup> element with a <subhead> element used
                    as the child of the <hx> element
           Product: HTML WG
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HTML5 spec (editor: Ian Hickson)
        AssignedTo: ian@hixie.ch
        ReportedBy: jgraham@opera.com
         QAContact: public-html-bugzilla@w3.org
                CC: mike@w3.org, public-html-wg-issue-tracking@w3.org,
                    public-html@w3.org


Instead of 
<hgroup>
<h1>Main Heading</h1>
<h2>Subheading</h2>
</hgroup>

we should adopt

<h1>Main Heading 
<subhead>Subheading</subhead>
</h1>

This has several advantages:

* It is slightly less verbose

* It is easier to style with CSS. <hgroup> requires detailed knowledge of the
markup structure whereas with <subhead> and a :heading(n) selector, one can do:

:heading(n) {/*rules for the heading*/}
:heading(n) > subhead {/*special rules for the subheading*/} 

* It is semantically less confusing. There is no ambiguity about whether the
<hgroup> is the heading element or the child <hx>. That means it is more
obvious what a :heading selector will select, and more obvious how
accessibility APIs will map the various elements.

* It arguably has better fallback semantically (if not visually, although that
is easier to fix using CSS; see above). A legacy UA will consider the whole
thing to be one heading rather than several headings with a
possibly-nonsensical parent-child relationship as in the <hgroup> case.

* It preserves the invariant that all <hx> elements represent headings, which
may make certain tools easier to write. I also think it makes the outline
algorithm slightly easier to implement.

* It seems harder to use incorrectly. The only obvious mistake that one could
make would be to use <subhead> outside a <hx> element which would be relatively
harmless (semantics of <div>).

The main disadvantages I can think of are:

* It makes it slightly harder to determine the text of a heading (need to walk
the tree skipping <subhead> elements). On the other hand simple properties like
.textContent should be considered inadequate anyway since alt text should be
considered part of the heading text.

* Doesn't support the use case of multiple subheadings of different weights.
This seems like a very minor use case that could be addressed in the future if
it is significant.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 11 January 2011 10:31:03 UTC