Test case for the \* type selector (CSS3 selectors)

I propose that the CSS3 selectors test suite is updated with a test 
case for the a type selector:

	   \*{color:red} /* valid selector which shouldn't work*/

Background: The \* selector might be easy to confuse with *{}. And 
Webkit falls into that trap. And thus it sees the selectors

	\*{} 
	\00002a{} 

as synonymous for 

	*{}

and thereby \*{} becomes a selector that only works in Webkit. Because, 
although \*{} is valid, it cannot select anythig - as there are no <*> 
elements in XML or HTML. (CSS2 says that \ "cancels the meaning of 
special CSS characters'. And the special meaning of * is that it is the 
universal selector.) This is identical to how  

	-div{} 

is a valid selector. But it could never select anything as there are no 
elemetns that begins with the character '-'.

Note, btw, that Webkit has no problems with foo.\*{} - it is just \*{} 
that is problematic.

Note also that * is a special kind of 'special CSS character'. The 
other special characters are combinators, and thus have only one 
meaning - thereby it is easy to see what they default to when the 
special meaning is cancelled. Whereas '*' has two meanings: 'universal 
selector' and 'any namespace selector'.  Also, if one tries to compare 
the universal selector with type selectors, then - by analogy - it is 
easy to think that Webkit is correct. This is how the analogical 
deduction goes:

	\d\i\v{}  /* This it equal to this: */
	div{}     /* Hence - by analogy - it is logical to think that */
	\*{}      /* would work the same as */
	*{}

The point I am trying to make only being that the Webkit behaviour make 
some sense, even though it is incorrect. Which is why there should be 
test case.

Suggested test case for the univeral selector issue:

<!DOCTYPE html><!-- contributed by Leif H Silli -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>Escaped, Universal selector</title>
<style type="text/css">* {color:lime} p \* {color:red}</style>
</head><body><p><span>This paragraph should be green.</span></p>
</body></html>
-- 
Leif Halvard Silli

Received on Sunday, 20 February 2011 05:51:48 UTC