https://bugs.webkit.org/show_bug.cgi?id=89697
Reviewed by Benjamin Poulain.
Source/WebCore:
Change descriptor of CSSStyleDeclaration properties in order to have
writable and enumerable attributes set to true. Configurable is kept to
false since the property is not deleteable.
Test: fast/dom/CSSStyleDeclaration/cssstyledeclaration-properties-descriptor.html
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::getOwnPropertySlotDelegate): Only set
DontDelete attribute when creating the descriptor for
CSSStyleDeclaration properties.
LayoutTests:
Add new test to check the descriptor of CSSStyleDeclaration properties.
* fast/dom/CSSStyleDeclaration/cssstyledeclaration-properties-descriptor-expected.txt: Added.
* fast/dom/CSSStyleDeclaration/cssstyledeclaration-properties-descriptor.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167240
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-04-14 Manuel Rego Casasnovas <rego@igalia.com>
+
+ [JSC] CSSStyleDeclaration report incorrect descriptor
+ https://bugs.webkit.org/show_bug.cgi?id=89697
+
+ Reviewed by Benjamin Poulain.
+
+ Add new test to check the descriptor of CSSStyleDeclaration properties.
+
+ * fast/dom/CSSStyleDeclaration/cssstyledeclaration-properties-descriptor-expected.txt: Added.
+ * fast/dom/CSSStyleDeclaration/cssstyledeclaration-properties-descriptor.html: Added.
+
2014-04-14 Benjamin Poulain <benjamin@webkit.org>
CSS JIT: compile the :nth-child() pseudo class
--- /dev/null
+This tests the descriptor of CSSStyleDeclaration properties.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS descriptor['writable'] is true
+PASS descriptor['enumerable'] is true
+PASS descriptor['configurable'] is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
--- /dev/null
+<!DOCTYPE html>
+<html>
+<body>
+ <script src="../../../resources/js-test-pre.js"></script>
+ <script>
+ description("This tests the descriptor of CSSStyleDeclaration properties.");
+
+ var descriptor = Object.getOwnPropertyDescriptor(document.body.style, 'color');
+ shouldBeTrue("descriptor['writable']");
+ shouldBeTrue("descriptor['enumerable']");
+ shouldBeFalse("descriptor['configurable']");
+ </script>
+ <script src="../../../resources/js-test-post.js"></script>
+</body>
+</html>
+2014-04-14 Manuel Rego Casasnovas <rego@igalia.com>
+
+ [JSC] CSSStyleDeclaration report incorrect descriptor
+ https://bugs.webkit.org/show_bug.cgi?id=89697
+
+ Reviewed by Benjamin Poulain.
+
+ Change descriptor of CSSStyleDeclaration properties in order to have
+ writable and enumerable attributes set to true. Configurable is kept to
+ false since the property is not deleteable.
+
+ Test: fast/dom/CSSStyleDeclaration/cssstyledeclaration-properties-descriptor.html
+
+ * bindings/js/JSCSSStyleDeclarationCustom.cpp:
+ (WebCore::JSCSSStyleDeclaration::getOwnPropertySlotDelegate): Only set
+ DontDelete attribute when creating the descriptor for
+ CSSStyleDeclaration properties.
+
2014-04-14 Benjamin Poulain <benjamin@webkit.org>
[JSC] Improve the call site of string comparison in some hot path
return false;
if (propertyInfo.hadPixelOrPosPrefix)
- slot.setCustomIndex(this, ReadOnly | DontDelete | DontEnum, static_cast<unsigned>(propertyInfo.propertyID), cssPropertyGetterPixelOrPosPrefixCallback);
+ slot.setCustomIndex(this, DontDelete, static_cast<unsigned>(propertyInfo.propertyID), cssPropertyGetterPixelOrPosPrefixCallback);
else
- slot.setCustomIndex(this, ReadOnly | DontDelete | DontEnum, static_cast<unsigned>(propertyInfo.propertyID), cssPropertyGetterCallback);
+ slot.setCustomIndex(this, DontDelete, static_cast<unsigned>(propertyInfo.propertyID), cssPropertyGetterCallback);
return true;
}