W3C home > Mailing lists > Public > www-style@w3.org > March 2010

[css3-selectors] Omitting of universal selector

From: Paul Duffin <pduffin@volantis.com>
Date: Tue, 9 Mar 2010 07:00:03 -0700 (MST)
To: www-style@w3.org
Message-ID: <1763004725.649471268143202862.JavaMail.root@zimbra.volantis.com>
I have a couple of questions about the handling of universal selector.

In section 6.2, http://www.w3.org/TR/css3-selectors/#universal-selector, it states that "*.warning and .warning are equivalent".

In section 6.2.1 it states that when a default namespace has been specified the * is equivalent to ns|* where ns is mapped to the default namespace.

I can understand why the behavior of * depends on the setting of the default namespace as this is basically how XML handles namespaces. However, I don't understand why .warning is equivalent to *.warning and not *|*.warning. That seems to me to be very confusing and counter intuitive. As a page author if I create a rule like .warning {color: red} then I would expect that to match any element with the appropriate class. I certainly wouldn't be thinking about an implicit universal selector that only matches the default namespace. Also, surely the only purpose of allowing a default namespace is to reduce the size of the CSS but in order to make the above selector behave 'correctly' I would need to change it to *|*.warning {color: red} which considering that I would have to do that for all my non type based selectors which would be most of them would greatly increase the size of the CSS.

Could someone please provide an explanation as to why this is defined that way?

This is an issue for me as I use CSS to style documents containing many different namespaces. Does anyone else have experience of that?
Received on Tuesday, 9 March 2010 14:00:43 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:43 UTC