Re: [css21-selectors] Interpretation of attribute selector

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 UTC