Re: [css3-selectors] :contains

Anne van Kesteren (fora) wrote:

>>   Content generated with the ::before and ::after pseudo-elements does 
>> not actually modify the content of the element; only the way it is 
>> presented, and thus does not affect whether or not another selector 
>> matches.  The background colour should be red.
> I see. How about:
>   <test/>
>   test{                  background:red;
>                          content:"PASS"  }
>   test:contains('PASS'){ background:lime }
> Personally, I don't see a difference here and I think that they all 
> should have a green background (which stands for PASS, obviously). 

   That's right, there is no difference.  The generated content doesn't 
actually affect the contents of the element in the document, only the 
way it is presented.  Thus, they all should be red.

What about this:

test:contains('foo') { content: 'bar' }

   According to your logic, first the selector would match, the contents 
would be changed, then it would no longer match, so it would be changed 
back, then it would match again...

Lachlan Hunt

Received on Sunday, 30 May 2004 08:46:14 UTC