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

[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 02:41:10 +0000
To: www-style list <www-style@w3.org>
Message-ID: <BN3PR0301MB08685E69E725FB1855D0FF2FA42A0@BN3PR0301MB0868.namprd03.prod.outlook.com>
Hello everyone,

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

Chrome/FF follows this for styles that are inserted into the CSSOM via stylesheets but keeps the attribute complete with incorrect values in the attribute even though the parsing of the style attribute states[2]:

	#Aside from the differences in cascading, the declarations in a style attribute must be interpreted exactly as if they were given in a CSS style rule that applies to the element.

So essentially (if I'm reading this correctly) you should get the same result when requesting what is on the style attribute and what is in the CSSOM.

I wrote up a test page that outputs the CSSOM info and what is in the style attribute, I've attached it to this email since JSFiddle or JSBin I would need to dig through a lot more stylesheets to find the right declarations (I also posted it on pastebin[3]).

Thanks for your input!

Greg

[1] http://www.w3.org/TR/CSS21/syndata.html#illegalvalues
[2] http://www.w3.org/TR/css-style-attr/
[3] http://pastebin.com/X2adfQ3M

Received on Friday, 20 February 2015 02:41:39 UTC

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