Re: Naming of <header>

Quoting Ian Hickson <ian@hixie.ch>:

> On Fri, 27 Mar 2009, James Graham wrote:
>>
>> At risk of creating a bikeshed discussion�
>>
>> The <header> element's name seems to be creating some considerable
>> confusion, with authors either assuming it designed to be used for all
>> page header content or that it is designed to replace <h1>-<h6> and be a
>> generic heading element (e.g. [1], [2] and note that these are the tiny
>> fraction of people who are motivated to ask about these things upfront).
>> Almost no one seems to guess that it is supposed to be used for grouping
>> multiple heading/subheadings into an overall heading. This implies that
>> it will be poorly used in practice and so UAs will not be able to
>> reliably implement e.g. the outline algorithm since it will give
>> unexpected results on real sites.
>
> The name used is the most commonly used name for the class that means the
> same thing. If people naturally use this name for this purpose, why would
> they get confused when other people use the name for that purpose?

Are we sure that the class name is being used in the way intended for  
the element by the HTML5 spec? I don't recall what manual followup was  
done with the Google data to verify this hypothesis.

> On Fri, 27 Mar 2009, James Graham wrote:
>>
>> Several of those sites use it unnecessarily to wrap <hn> elements,   
>> suggesting
>> that they have not fully grasped the point of the element.
>
> That appears harmless.

Sure but it implies that they are attaching some extra significance to  
<header> beyond that which it actually has i.e. they have not really  
understood the point of the element.

>> Moreover that is a hugely biased sample because they are early adopters,
>> all of whom are likely to be aware of tools like validators.
>
> The people who have expressed confusion are also early adopters. :-)

Indeed. But when gathering information from the behavior of early  
adopters, there is an asymmetry in the importance we should attach to  
people getting things right vs people getting things wrong or being  
confused. Early adopters represent a sample of authors that is heavily  
biased toward the highly competent end of the spectrum. Out of  
necessity their pages are authored either based on reading the spec  
directly or on information that is only a few steps removed from the  
spec (by definition there are not many extant examples that they can  
copy through view source and the network of subtly misleading  
tutorials has not yet had time to get established). As such, early  
adopters using things as intended tells us very little; just that the  
features they are using can be used correctly by sufficiently  
competent authors. On the other hand, early adopters having  
difficulties is indicative of a feature that will be significantly  
more problematic when used by the (less well informed/ competent)  
population of authors as a whole.


> On Fri, 27 Mar 2009, James Graham wrote:
>>
>> Oh and another related point is that doing something like
>>
>>  <article>
>>    <header>
>>      <h1>My blog post</h1>
>>      <p>2022-01-01T01:01</p>
>>    </header>
>>    <section>
>>      <p>This is the content</p>
>>    </section>
>>  </article>
>>
>> seems to be rather common. This is technically wrong because it makes
>> the content a subsection of the article and so, technically, not titled
>> by it. It would be better in this case if untitled sectioning elements
>> collapsed from the point of view of the outline algorithm.
>
> This is just an example of people using <section> as a "semantic <div>"
> (incorrectly); I don't think we necessarily want to encourage that by
> making it less of a problem.

It is unlikely to be a problem for the original author except in the  
rare case where they are using the heading information for something  
like automatic table of contents generation. It won't even show up in  
a typical conformance checker report, so even well-intentioned authors  
may be unaware they are doing something wrong. The people for whom it  
will be a problem - those using client side tools that reconstruct the  
outline structure of the page - aren't in much of a position to fix  
the underlying markup.

One possibility is to require headings in some places. For example one  
could consider requiring a heading in each <section> or <article>  
element. This doesn't really improve things if  heading is missing  
though or if the element is something like <body> or <nav> or <aside>  
where headings don't always make sense. Indeed even in <section> you  
can imagine cases where there would be no heading, for example a HTML  
slideshow with each slide in a <section> and no titles for the slides.  
Arguably the slides should have titles, but it seems unreasonable to  
demand them. On the other hand it is hard to think of cases where a  
titled section nested inside an untitled section really represents a  
subsection of the outer section, so collapsing the outline here seems  
reasonable.

Received on Saturday, 28 March 2009 09:18:02 UTC