getAttribute("style") on an element returns extended form of parsed CSS rules in Internet Explorer 8, not the string of content attribute or string of current textual value

Fruits of the forest:

Actual results in your browser of getAttribute("style") for the above select (combobox): not available or not supported

Expected results: border: lime solid 3px;


Note that this bug is about compatibility with regards to internalized string format or rules of stringnification of parsed CSS rules among different browsers. How (format) the DOMString is returned has not been specified by DOM 2 Core spec and DOM 2 CSS. This issue will affect cases where shorthand form of CSS declaration is used.


W3C DOM 1 Core on getAttribute and W3C DOM 2 Core on getAttribute both give:
Return Value
DOMString: The Attr value as a string, or the empty string if that attribute does not have a specified or default value."

DOM 2 CSS, section 2.3 Interface CSS2Properties states:
"When dealing with CSS 'shorthand' properties, the shorthand properties should be decomposed into their component longhand properties as appropriate, and when querying for their value, the form returned should be the shortest form exactly equivalent to the declarations made in the ruleset."

This bug has been reported at connect's IE beta feedback as bug 427773.

Firefox 1.5, Firefox 2.x, Firefox 3, Opera 9.50, Safari 3.1, Konqueror 3.5.8, NS 7.0, NS 7.2, Seamonkey 1.x, Seamonkey 2.x, K-meleon 1.x, Galeon 2.0.4, Epiphany 2.22 all pass this test.

Valid HTML 4.01! CSS compliant