W3C home > Mailing lists > Public > www-style@w3.org > March 2005

Re: [selectors] Tree selectors

From: Ian Hickson <ian@hixie.ch>
Date: Mon, 21 Mar 2005 12:42:54 +0000 (UTC)
To: BachusII <BachusII@planet.nl>
Cc: Anne van Kesteren <fora@annevankesteren.nl>, W3C CSS List <www-style@w3.org>
Message-ID: <Pine.LNX.4.61.0503211238520.1818@dhalsim.dreamhost.com>

On Mon, 21 Mar 2005, BachusII wrote:
> > 
> > This wouldn't handle, e.g.:
> > 
> >   <body>
> >    <h>
> >    <section>
> >     <h>
> >     <navigation>
> >      <h>
> > 
> > ...where we want the <h>s to render in progressively smaller sizes.
> 
> Could you elaborate on that? I fail to see where/how it fails.

Oops, I made a mistake with my markup. I meant to have:

   <body>
    <h/>
    <section>
     <h/>
     <navigation>
      <h/>

The <h> elements do not contain each other; they are contained inside 
<body>, <section>, and <navigation> elements. These tree elements can be 
arbitrarily nested inside each other and represent different kinds of 
sections. What we want is to find the depth, in sections, of the <h> 
element, and use that depth to give the elements its size.

However, elements other than section elements (i.e., in this case, other 
than <body>, <section>, and <navigation>) should be ignored when 
determining the levels. So the headers in the example above should render 
identically to those in this example:


   <body>
    <h/>
    <form>
     <section>
      <div>
       <h/>
      </div>
      <div>
       <navigation>
        <h/>

...because the <div> and <form> elements don't introduce a new "section" 
nesting level.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Monday, 21 March 2005 12:45:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:36 GMT