Re: revisiting heading advice

2014-01-09 17:58, Leif Halvard Silli wrote:
> Jukka K. Korpela, Thu, 09 Jan 2014 17:04:29 +0200:
[...]

>> So if you have a <section> element with <h1> and <h2>
>> inside it, then - on browsers that support this idea - the <h1>
>> element is rendered as a level 2 element, but so is the <h2> element;
>> it is not demoted to level 3, where it is logically supposed to be.
> Supposedly, in the outline and in AT, it would still be “demoted“.

Yes, that’s what expected to happen. The outline idea in interesting in 
theory, but there is little interest in it among browser vendors or 
authors, and it’s difficult to see what problems it would solve. For 
example, to manage a large document structurally, it does not offer much.

Regarding AT, this is part of imposing a burden on implementations, with 
very small potential gain. AT can handle h1, h2, h3 when used the simple 
way – and such handling is among the main practical reasons why authors 
should use those elements rather than just suitable CSS formatting. And 
this means that existing AT can be expected to present headings wrong 
way if authors rely on the current HTML5 principles.


>
>> Contrasting this with gain of the freedom, which is close to none, I
>> think the logical conclusion should be that the classic HTML
>> principles be restored in this respect: the rank of a heading
>> dictates its level.
> You mean, to look away from the effect of <section>?

Right. The use of <section> should mean just explicit markup for 
sections, with no impact on the meanings of other elements. Just as <div 
class=section>, which is what is currently used for explicit markup of 
sections, does not affect the meaning or default rendering of anything.
>
>> It is a rather simplistic principle, but it has
>> worked for a long time and has no real problem.
> Think it would be problematic, when used with <section>.

I don’t think so. The current wording already says that you can use 
heading elements the old way, even when you use <section>.

There would be the conceptual issue that if you use, say,

<body>
<h1>...</h1>
<section>
<h2>...</h2>
<h4>...</h4>
</section>

then the current HTML5 rules seem to say that the rank 4 heading 
implicitly opens a subsubsection (not subsubsubsection) and therefore 
becomes a level 3 heading. But the current definition of headings has 
the same problem even when <section> is not used.

It might make sense practically to treat

<h1>...</h1>
<h2>...</h2>
<h4>...</h4>

so that the rank 4 heading is really at level 3, on the assumption that 
such markup has been used for rendering reasons – so that the rank 
reflects the author’s idea about font size rather than nesting level. 
But such rules tend to confuse things, and they (currently) mean that 
browsers should render h4 by default as if it were h3 – but the author 
most probably did not want that, he chose (under the given assumption) 
h4 because of the default rendering of h4.

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/

Received on Thursday, 9 January 2014 21:21:30 UTC