[whatwg] Interaction of explicit and implicit sections (was: Re: Question on (new) header and hgroup)

Tab Atkins Jr. jackalmage at gmail.com
Thu May 7 18:06:19 PDT 2009


On Thu, May 7, 2009 at 6:12 PM, Simon Pieters <simonp at opera.com> wrote:
> <zcorpan_> hmm i wonder how <hgroup> messes up implicit sections
> <zcorpan_> maybe <hgroup> should have the same rank as its highest child h*
> element instead of always having rank 1
> <zcorpan_> so you can do
> <h1>foo</h1><h2>bar</h2><hgroup><h3>baz</h3><h4>quux</h4></hgroup>
> <zcorpan_> where baz is a subsection of bar
> <Hixie> non-issue in practice, imho, <hgroup> is almost always going to be
> the first heading
> <Hixie> and the rest of the time, people can use <section>
> <Hixie> no?
> <zcorpan_> would be nice if it worked as people expect when using implied
> sections
> <Hixie> i guess
> <Hixie> ...send mail :-)

The rank-change feels like magic and is absolutely certain to be
overlooked in practice.  What's worse, *because* this situation is
rare in practice (I agree here with Hixie), it'll be unlikely that
most authors even realize they're committing a mistake.  When I write
an <h3> I want it to act like an <h3>, no matter whether it's being
grouped with an <h4> or not.  If I wanted a rank-1 header, I can put
an <h1> in the <hgroup> instead.

In short, the current rank-change is likely to produce bad behavior in
the common case (well, the common rare case, as opposed to the rare
rare case), while inheriting rank from children produces good behavior
in this case.  Both behaviors have workarounds, but the inheriting
case's workaround is more 'local' and obvious - you just set the rank
of the enclosed heading to what you want; the workaround for the
magic-rank-1 case makes you to partially abandon the implicit
sectioning algorithm, and requires an end tag far removed from the
place where the trouble happened.

So, I support zcorpan's suggestion.

~TJ

~TJ


More information about the whatwg mailing list