Re: [selectors4] Multiple subject indicators

Brilliant! IMO this is better than both the options I outlined.


Lea Verou
W3C developer relations
http://w3.org/people/all#leahttp://lea.verou.me ✿ @leaverou






On Jun 13, 2013, at 14:17, François REMY <francois.remy.dev@outlook.com> wrote:

>> [...] the behaviour of CSS Selectors is undefined when
>> multiple subject indicators [1] are specified. [...]
>> 
>> I guess there are two reasonable things to do here:
>> 
>> a) The selector is invalid and the entire rule is discarded per regular CSS rules
>> b) The last subject wins
> 
> I've no strong opinion on this, but I wonder why you didn't include a third option:
> 
>  (c) both subjects are valid ('!ul + !p img' selects both the 'ul' and the 'p')
> 
> This is actually the same as '!ul + p img, ul + !p img' but is shorter.
> 
> 
> 
> I've been thinking aloud just now, and found one case where I could have used this:
> 
>   article > !h2 ~ !* { display: none; }
> 
> which would only display the introductory paragraphs of a blog post (provided that like me you use an H2 when you enter more details)
> 
>   article
>       p
>       p
>       h2
>       p
>       p
>       ...
> 
> 
> 

Received on Thursday, 13 June 2013 12:18:59 UTC