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

Re: [css21-selectors] Interpretation of attribute selector

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 27 May 2010 23:42:34 -0400
Message-ID: <4BFF3BAA.3050209@mit.edu>
To: "Belov, Charles" <Charles.Belov@sfmta.com>
CC: www-style list <www-style@w3.org>
On 5/27/10 6:06 PM, Belov, Charles wrote:
> I am wondering whether a problem I am observing in current browsers is
> attributable to browser bugs or to my misunderstanding of the attribute
> selector.

Mostly the former.

> Given the CSS 2.1 selector specification, I would expect:

The CSS 2.1 specification isn't sufficient here, in that at least Gecko 
implements exactly what that specification says.  In particular, 
selector matching is performed on exactly the value returned by 
getAttribute.

Now the issue you're running into is that the value of the style 
attribute is normalized in Gecko, so that the value you put in your 
source (or pass to setAttribute) and the value returned by getAttribute 
aren't necessarily equal.  This is generally considered a bug (albeit a 
low-priority one, since it's pretty rare for anyone to actually work 
with the string form of the style attribute and since the string form 
becomes completely meaningless if you touch .style.something).

-Boris
Received on Friday, 28 May 2010 03:43:09 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:27 GMT