WebKit does not enumerate over CSS properties in HTMLElement.style
https://bugs.webkit.org/show_bug.cgi?id=23946
Reviewed by Darin Adler.
Source/JavaScriptCore:
Add a few exports to follow the JSCSSStyleDeclaration.cpp changes,
introduce an std::sort() comparator function.
* JavaScriptCore.exp:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
* wtf/text/WTFString.h:
(WTF::codePointCompareLessThan): Used by std::sort() to sort properties.
Source/WebCore:
This change generates a list of JavaScript mirrors of the CSS properties and allows to enumerate them
using the "in" operator on the CSSStyleDeclaration object.
Test: fast/css/style-enumerate-properties.html
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::getOwnPropertyNames): Added.
* bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp:
(WebCore::V8CSSStyleDeclaration::namedPropertyEnumerator): Added.
(WebCore::V8CSSStyleDeclaration::namedPropertyQuery): Added.
(WebCore::V8CSSStyleDeclaration::namedPropertyGetter): A small drive-by optimization (local initialization moved down).
* css/CSSStyleDeclaration.idl: Use a custom property enumerator.
* css/makeprop.pl: Add a function to convert CSS property names into JS ones.
LayoutTests:
* fast/css/style-enumerate-properties-expected.txt: Added.
* fast/css/style-enumerate-properties.html: Added.
* fast/dom/domListEnumeration-expected.txt:
* fast/dom/script-tests/domListEnumeration.js:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102578 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed