Bug 54838 - \* (backslash escaping of asterisk) fails to cancel its special CSS meanings
Summary: \* (backslash escaping of asterisk) fails to cancel its special CSS meanings
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Major
Assignee: Nobody
URL: http://lists.w3.org/Archives/Public/p...
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-20 16:19 PST by Leif Halvard Silli
Modified: 2011-02-21 15:51 PST (History)
1 user (show)

See Also:


Attachments
Test case document for backslash escaped asterisk in type selectors and namespace component (2.85 KB, application/xhtml+xml)
2011-02-20 16:19 PST, Leif Halvard Silli
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leif Halvard Silli 2011-02-20 16:19:07 PST
Created attachment 83107 [details]
Test case document for backslash escaped asterisk in type selectors and namespace component

In Webkit, \* (backslash escaping of the asterisk) in selectors fails to work in type selectors and in the namespace component (but works in other simple selectors such as attribute selectors). These errors occur both for hexadecimal as well as for plain backslash escaping. Since it is both a namespace component releated issue and a type selector/universal selector related issues, this bug can thus be split in two sub issues:

(1) Webkit incorrectly treats     *{} and     \*{} the same.
(2) Webkit incorrectly treats *|foo{} and \*|foo{} the same. 

First, the Universal/Type selector related error: (1)

  *{/* Universal-selector 
         http://www.w3.org/TR/css3-selectors/#universal-selector */}
\*{/* Type selector
         http://www.w3.org/TR/css3-selectors/#type-selectors */}

Explanation: When the * in *{} is escaped to \*{} or to  \00002a {}, then it isn't the universal selector anymore. (About cancelling of specal CSS meaning, see http://www.w3.org/TR/CSS21/syndata.html#characters ) When *{} is escaped, it becoms what the CSS3 selectors draft refers to as a 'type selector'. The \*{} cannot select anything, however - the same way that \-{} cannot select anything because no elements can begin with the '-' or with the '*'.)  Webkit's error is that the \*{} selects the same thing that *{} slects. Webkit is alone about this error.

Second, the namespace compoonent related bug: (2)

 *|foo{/* Foo selector in the asterisk prefixed namespace.*/}
\*|foo{/* Foo selector in any namespace, including no namespace*/}

Because Webkit treats \*|foo{} identical to *|foo{}, it becomes impossible to create an asterisk prefiksed namespace in contrast to the 'any namespace' that *| otherwise represents. (An asterisk prefixed namespace \*| would be a single namespace, whereas *| represents any namespace including no namespace.)
Comment 1 Leif Halvard Silli 2011-02-20 16:24:22 PST
(In reply to comment #0)

Sorry, a typo! Please read this:

>  *|foo{/* Foo selector in the asterisk prefixed namespace.*/}
>\*|foo{/* Foo selector in any namespace, including no namespace*/}

like this:

  *|foo{/* Foo selector in any namespace, including no namespace*/}
\*|foo{/* Foo selector in the asterisk prefixed namespace. */}
Comment 2 Alexey Proskuryakov 2011-02-21 15:51:11 PST
See also: bug 21472.