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

RE: [css-style-attr][CSS2.1] What should happen to values that are not valid

From: Greg Whitworth <gwhit@microsoft.com>
Date: Fri, 20 Feb 2015 03:35:32 +0000
To: "L. David Baron" <dbaron@dbaron.org>
CC: www-style list <www-style@w3.org>
Message-ID: <BN3PR0301MB0868CFBC8C101AB23B9F75F1A42A0@BN3PR0301MB0868.namprd03.prod.outlook.com>
> On Friday 2015-02-20 02:41 +0000, Greg Whitworth wrote:
> > We found an interesting interop issue where Chrome/FF allow the style
> attribute to keep (instead of ignore) props and values that are not valid.
> Looking into the specs for this, CSS2.1 states that[1]:
> >
> > 	# This specification defines ignore to mean that the user agent
> > parses the illegal part (in order to find its beginning and end), but
> > otherwise acts as if it had not been there
> 
> But the behavior of getAttribute() is covered by the DOM specs, not the CSS
> ones.  The style attribute contains text that is interpreted as CSS, and you can
> see that interpretation through element.style.
> But getAtribute() is specified in the DOM specs to just return the attribute as
> specified (unless other specifications say to change the attribute at a
> particular time).  The behavior has nothing to do with CSS.
> 
> (Gecko used to match the IE behavior where we discarded the original text
> and then reconstructed it from the CSS information after a
> getAttribute.)
> 
> I don't see anything specifying the attribute is changed in:
> http://www.w3.org/html/wg/drafts/html/master/dom.html#the-style-

> attribute
> and
> http://dev.w3.org/csswg/cssom/#the-elementcssinlinestyle-interface

> says:
>   Mutating the declarations must set the style content attribute on
>   the context object to the serialization of the declarations.
> that is, that the DOM attribute (and the result of getAttribute()) changes only
> when the declarations accessed via element.style are mutated.

Awesome!! Thank you so much!

Greg

Received on Friday, 20 February 2015 03:36:00 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:52:01 UTC