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

[CSSOM] issues with cssText and selectorText

From: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Date: Wed, 03 Feb 2010 16:58:15 +0100
Message-ID: <4B699D17.5060009@disruptive-innovations.com>
To: "www-style@w3.org" <www-style@w3.org>
Hi there,

I just discovered that Opera is the only "major" browser
that does not return a useless result for selectorText and
cssText in some cases that are not edge cases any more...

If the selector of a rule contains a ident itself containing
a colon, the colon must be escaped in the selector. But its
serialization in selectorText and cssText is NOT escaped. The
same issue happens with many escaped characters.

So the result of cssText and selectorText is useless because
unparseable and invalid...

FWIW, I have written a small test here


I said it's not an edge case any more because a small site called
Facebook gives its partners embeddable stylesheets with such selectors.
I discovered them validating a stylesheet in a famous newspaper's
It's also super important to have a bijection here for editing
environments. If cssText and selectorText are unreliable, then building
a conforming style editor is almost impossible.

I think we should clarify the situation here, saying that the result
of selectorText and cssText must be parseable and represent really
what they are the serialization of...

FWIW, both Safari and Mozilla fail on the test above. MSIE of course
is not even able of running the three lines of script...

Received on Wednesday, 3 February 2010 15:58:52 UTC

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