- From: Lachlan Hunt <lachlan.hunt@iinet.net.au>
- Date: Sun, 30 May 2004 22:28:54 +1000
- To: "Anne van Kesteren (fora)" <fora@annevankesteren.nl>
- Cc: W3C CSS List <www-style@w3.org>, public-css-testsuite@w3.org
Anne van Kesteren (fora) wrote:
> I was wondering a bit about ':contains' [1]. What should be the
> background-color in the following cases:
>
>
> <test/>
>
> test{ background:red }
> test::before{ content:"PASS" }
> test:contains('PASS'){ background:lime }
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.
> Just to be sure, the following won't match, right?
>
> <test>&</test>
>
> test:contains('&'){ background:red }
& is an HTML/XML entity, not a CSS entity, so it would not be
converted to an ampersand while parsing the CSS. Therefore the selector
would not match your test element. I expect that it would, however,
match this:
<test>&amp;</test>
--
Lachlan Hunt
http://www.lachy.id.au/
lachlan.hunt@lachy.id.au
Received on Sunday, 30 May 2004 08:29:33 UTC