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

Allowing unknown pseudo classes and unknown pseudo element in the selector.

From: Erik Arvidsson <arv@chromium.org>
Date: Thu, 8 Mar 2012 10:52:48 -0800
Message-ID: <CAJ8+GogcMWgGLo3eyAQ7-YzvY_9hQgjf1yrAyhyuUuCNvJcL_Q@mail.gmail.com>
To: www-style@w3.org
Cc: Tony Chang <tony@chromium.org>, Boris Zbarsky <bzbarsky@mit.edu>, "Tab Atkins Jr." <jackalmage@gmail.com>
Today we have a "bug" in WebKit [1] where we ignore unknown pseudo elements.

#test { background: green }
#test, ::foobar { background: red }

in WebKit #test is red, in other browsers it is green.

This intended behavior is actually making things worse. If the page
author includes a new pseudo element/class from CSS4 and then a user
visits the page in a browser that does not support the CSS4 pseudo the
whole rule gets dropped. This is a real problem today when browsers
introduce new experimental pseudo elements and classes. For example
the following fails in all but WebKit

#test { background: red }
#test, ::-webkit-scrollbar { background: green }

Today we don't drop the whole rule for unknown tag names, attribute
names etc. We should not drop rules for unknown pseudos either.

[1] https://bugs.webkit.org/show_bug.cgi?id=77838

erik
Received on Thursday, 8 March 2012 18:53:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 03:48:51 GMT