Re: role="subheading" or role="subtitle" to replace hgroup

On Fri, 8 Apr 2011, Maciej Stachowiak wrote:
> On Apr 8, 2011, at 1:23 AM, Bruce Lawson wrote:
> > On Fri, 08 Apr 2011 09:14:01 +0100, Henri Sivonen <hsivonen@iki.fi> wrote:
> > 
> >> On Thu, 2011-04-07 at 12:34 +0100, Steve Faulkner wrote:
> >>> >2) It would be desirable to have a selector that matches on the
> >>> > outline depth.
> > 
> > [...]
> > 
> >> 
> >> I mean a selector like h1::outline-depth(3) at least for headings
> >> themselves and maybe for all element nodes (like p::outline-depth(2)).
> > 
> > It would be deeply splendid to have such a selector. But how?
> 
> If outline depth is defined solely by number of sectioning element 
> ancestors, then it's pretty simple. But I think HTML5 has a few things 
> that make it more complicates than that (not entirely sure though).

The outline depth for section elements is defined such that only the 
ancestor elements matters, and the outline depth for <h1> specifically 
(since it's the highest rank) is the same. This was an intentional design 
for exactly the reason suggested above (making a pseudo-class reasonable 
to implement for this kind of thing).

The complexity only comes along when you use <h2>-<h6>, but those are 
only really needed for back-compat.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Friday, 8 April 2011 19:58:08 UTC