Bug 37570

Summary: CSSStyleDeclaration CSS properties should be enumerable
Product: WebKit Reporter: Nikita Vasilyev <me>
Component: DOMAssignee: Nobody <webkit-unassigned>
Severity: Normal CC: ap
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: http://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface

Description Nikita Vasilyev 2010-04-14 06:49:35 PDT
How to reproduce
for (k in document.body.style) if (k=="background") console.log("Hooray!")

Expected result

Actual result
Nothing happens

In Firefox, Opera, and IE CSS properties are enumerable.

Unlike DOM 2 CSS[1], IDL from CSSOM[2] defines CSS properties as attributes.

Enumerable CSS properties could help me a little with http://webkit.org/b/17374 ,
since it will give me all properties, including shorthands.

[1]: http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration
[2]: http://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface
Comment 1 Alexey Proskuryakov 2010-04-16 11:20:32 PDT

*** This bug has been marked as a duplicate of bug 23946 ***