Re: First-descendant-of-type selector?

Lachlan Hunt wrote:
> 
> Andrew Fedoniouk wrote:
>> If :not will be relaxed to contain not only simple selectors
>> then selector
>> [...]
>> Say selector like
>> X Y:not(X > Y)
>> naturally complements "X Y" and "X>Y" selectors.
> 
> I think that would be equivalent to this:
> 
> X :not(X)>Y
> 
> Both would select a Y that is a descendant (but not a child) of an X.

That's very close, but unfortunately it doesn't work.

Take this case:

<ul id="a">
   <foo>
     <li>text</li>
     <li>
       <ul id="b">
         <bar>
           <li>text<li>
         </bar>
         <li>text</li>
       </ul>
     </li>
   </foo>
</ul>

In this case,
ul#a :not(ul#a)>li
selects the <li> inside <bar>, even though it's not an item of list a. (This is 
the same problem with Bjoern's nearly-identical solution above.)

-- 
dolphinling
<http://dolphinling.net/>

Received on Saturday, 2 September 2006 16:19:59 UTC