W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2008

[whatwg] WA1 - The Section Header Problem

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 20 Feb 2008 19:43:00 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0802201940200.20115@hixie.dreamhostps.com>
On Tue, 16 Nov 2004, Christoph P?per wrote:
>
> *Matthew Raymond* <mattraymond at earthlink.net>:
> > 
> > 1) The <h#> elements should be depreciated.
> > 2) The <h#> elements will have no SEMANTIC meaning when inside a <section>
> > header. Their presentation, however, will remain the same.
> > 3) Within an <h> element, <h#> elements (...) will be ignored entirely.
> > 4) The <h> element will be the only way to create a semantically valid
> > header for a section.
> > 5) There should only be one <h> element for each section.
> > 6) The only way to create semantically valid subsections within a <section>
> > element is to create child <section> elements (...)
> 
> My SGML-DTD (writing) skills are poor, but I wonder if this could be
> achieved with something like
> 
>    <!ELEMENT section      O O (h, %flow;*)>
>    <!ELEMENT h            O O (%heading; | %inline;*)>
>    <!ELEMENT (%heading;)  - - (%inline;)*>
> 
> (See HTML4 DTD for entities, add 'section' to '%flow;' and remove
> '%heading;' from it. The content models of 'section' and 'h' are probably
> malformatted, but I hope you get the idea.)
> This /should/---i.e. is intended to---magically start a new 'section'
> before any 'h' and embed any 'h1'-'h6' in an 'h'. Still it allows the pure
> XHTML2 style without numbered headings at all. Furthermore it makes the
> inline content that appears immediately after "<section>" a heading, if no
> explicit one is found---I don't know whether that's more good or more bad.
> 
> Note, however, that the CSS selectors "body>h", "body>h1" and "section>h1"
> would never match with such markup. OTOH "section>h" will always be
> successful in a valid document, except when there are no 'section', 'h'
> and 'h#' element instances at all.
> 
> I remember ISO-HTML doing another but similar kind of DTD trickery to
> enforce the correct order of heading levels, but I last read that spec
> years ago.

Since we're not using DTDs, the above as described is pretty much moot.

It's a neat idea, though, which we could use in the parser... but I think 
it's probably too confusing for authors. It also increases the differences 
between HTML and XHTML, and <tbody> should have taught us the danger there 
if nothing else.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 20 February 2008 11:43:00 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:00 UTC