Title: [222559] trunk
Revision
222559
Author
[email protected]
Date
2017-09-27 10:55:56 -0700 (Wed, 27 Sep 2017)

Log Message

cssFloat missing in CSSPropertyDeclaration.prototype
https://bugs.webkit.org/show_bug.cgi?id=177487

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Rebaseline WPT now that more checks are passing.

* web-platform-tests/cssom/interfaces-expected.txt:

Source/WebCore:

Add support for cssFloat attribute on CSSPropertyDeclaration, as per:
- https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-cssfloat

Test: fast/css/CSSStyleDeclaration-cssFloat.html

* css/CSSStyleDeclaration.cpp:
(WebCore::CSSStyleDeclaration::cssFloat):
(WebCore::CSSStyleDeclaration::setCssFloat):
* css/CSSStyleDeclaration.h:
* css/CSSStyleDeclaration.idl:

LayoutTests:

Add layout test coverage.

* fast/css/CSSStyleDeclaration-cssFloat-expected.txt: Added.
* fast/css/CSSStyleDeclaration-cssFloat.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (222558 => 222559)


--- trunk/LayoutTests/ChangeLog	2017-09-27 17:12:03 UTC (rev 222558)
+++ trunk/LayoutTests/ChangeLog	2017-09-27 17:55:56 UTC (rev 222559)
@@ -1,3 +1,15 @@
+2017-09-27  Chris Dumez  <[email protected]>
+
+        cssFloat missing in CSSPropertyDeclaration.prototype
+        https://bugs.webkit.org/show_bug.cgi?id=177487
+
+        Reviewed by Sam Weinig.
+
+        Add layout test coverage.
+
+        * fast/css/CSSStyleDeclaration-cssFloat-expected.txt: Added.
+        * fast/css/CSSStyleDeclaration-cssFloat.html: Added.
+
 2017-09-27  Antti Koivisto  <[email protected]>
 
         REGRESSION (r222040): Crash navigating out of gfycat.com url

Added: trunk/LayoutTests/fast/css/CSSStyleDeclaration-cssFloat-expected.txt (0 => 222559)


--- trunk/LayoutTests/fast/css/CSSStyleDeclaration-cssFloat-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/CSSStyleDeclaration-cssFloat-expected.txt	2017-09-27 17:55:56 UTC (rev 222559)
@@ -0,0 +1,21 @@
+Test support for CSSStyleDeclaration.cssFloat
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS 'cssFloat' in testDiv.style is true
+PASS Object.getOwnPropertyNames(testDiv.style).indexOf('cssFloat') is -1
+PASS Object.getOwnPropertyNames(Object.getPrototypeOf(testDiv.style)).indexOf('cssFloat') != -1 is true
+PASS testDiv.style.cssFloat is ""
+testDiv.style.cssFloat = 'right'
+PASS testDiv.style.cssFloat is "right"
+testDiv.style.cssFloat = 'invalid'
+PASS testDiv.style.cssFloat is "right"
+testDiv.style.cssFloat = 'left'
+PASS testDiv.style.cssFloat is "left"
+testDiv.style.cssFloat = null
+PASS testDiv.style.cssFloat is ""
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/css/CSSStyleDeclaration-cssFloat.html (0 => 222559)


--- trunk/LayoutTests/fast/css/CSSStyleDeclaration-cssFloat.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/CSSStyleDeclaration-cssFloat.html	2017-09-27 17:55:56 UTC (rev 222559)
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<div id="testDiv"></div>
+<script>
+description("Test support for CSSStyleDeclaration.cssFloat");
+
+const testDiv = document.getElementById("testDiv");
+shouldBeTrue("'cssFloat' in testDiv.style");
+shouldBe("Object.getOwnPropertyNames(testDiv.style).indexOf('cssFloat')", "-1");
+shouldBeTrue("Object.getOwnPropertyNames(Object.getPrototypeOf(testDiv.style)).indexOf('cssFloat') != -1");
+
+shouldBeEqualToString("testDiv.style.cssFloat", "");
+evalAndLog("testDiv.style.cssFloat = 'right'");
+shouldBeEqualToString("testDiv.style.cssFloat", "right");
+
+evalAndLog("testDiv.style.cssFloat = 'invalid'");
+shouldBeEqualToString("testDiv.style.cssFloat", "right");
+
+evalAndLog("testDiv.style.cssFloat = 'left'");
+shouldBeEqualToString("testDiv.style.cssFloat", "left");
+
+evalAndLog("testDiv.style.cssFloat = null");
+shouldBeEqualToString("testDiv.style.cssFloat", "");
+</script>
+</body>
+</html>

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (222558 => 222559)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2017-09-27 17:12:03 UTC (rev 222558)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2017-09-27 17:55:56 UTC (rev 222559)
@@ -1,3 +1,14 @@
+2017-09-27  Chris Dumez  <[email protected]>
+
+        cssFloat missing in CSSPropertyDeclaration.prototype
+        https://bugs.webkit.org/show_bug.cgi?id=177487
+
+        Reviewed by Sam Weinig.
+
+        Rebaseline WPT now that more checks are passing.
+
+        * web-platform-tests/cssom/interfaces-expected.txt:
+
 2017-09-26  Chris Dumez  <[email protected]>
 
         Update web-platform-tests IDL files

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/interfaces-expected.txt (222558 => 222559)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/interfaces-expected.txt	2017-09-27 17:12:03 UTC (rev 222558)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/interfaces-expected.txt	2017-09-27 17:55:56 UTC (rev 222559)
@@ -278,7 +278,7 @@
 FAIL CSSStyleDeclaration interface: operation setPropertyPriority(CSSOMString, CSSOMString) assert_own_property: interface prototype object missing non-static operation expected property "setPropertyPriority" missing
 PASS CSSStyleDeclaration interface: operation removeProperty(CSSOMString) 
 PASS CSSStyleDeclaration interface: attribute parentRule 
-FAIL CSSStyleDeclaration interface: attribute cssFloat assert_true: The prototype object must have a property "cssFloat" expected true got false
+PASS CSSStyleDeclaration interface: attribute cssFloat 
 PASS CSSStyleDeclaration must be primary interface of style_element.sheet.cssRules[4].style 
 PASS Stringification of style_element.sheet.cssRules[4].style 
 PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[4].style must inherit property "cssText" with the proper type 
@@ -298,7 +298,7 @@
 PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[4].style must inherit property "removeProperty(CSSOMString)" with the proper type 
 PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on style_element.sheet.cssRules[4].style with too few arguments must throw TypeError 
 PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[4].style must inherit property "parentRule" with the proper type 
-FAIL CSSStyleDeclaration interface: style_element.sheet.cssRules[4].style must inherit property "cssFloat" with the proper type assert_inherits: property "cssFloat" found on object expected in prototype chain
+PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[4].style must inherit property "cssFloat" with the proper type 
 PASS CSSStyleDeclaration must be primary interface of style_element.sheet.cssRules[2].style 
 PASS Stringification of style_element.sheet.cssRules[2].style 
 PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[2].style must inherit property "cssText" with the proper type 
@@ -318,7 +318,7 @@
 PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[2].style must inherit property "removeProperty(CSSOMString)" with the proper type 
 PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on style_element.sheet.cssRules[2].style with too few arguments must throw TypeError 
 PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[2].style must inherit property "parentRule" with the proper type 
-FAIL CSSStyleDeclaration interface: style_element.sheet.cssRules[2].style must inherit property "cssFloat" with the proper type assert_inherits: property "cssFloat" found on object expected in prototype chain
+PASS CSSStyleDeclaration interface: style_element.sheet.cssRules[2].style must inherit property "cssFloat" with the proper type 
 FAIL CSSStyleDeclaration must be primary interface of style_element.sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: undefined is not an object (evaluating 'style_element.sheet.cssRules[2].cssRules[0]')"
 FAIL Stringification of style_element.sheet.cssRules[2].cssRules[0].style assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: undefined is not an object (evaluating 'style_element.sheet.cssRules[2].cssRules[0]')"
 FAIL CSSStyleDeclaration interface: style_element.sheet.cssRules[2].cssRules[0].style must inherit property "cssText" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "TypeError: undefined is not an object (evaluating 'style_element.sheet.cssRules[2].cssRules[0]')"
@@ -358,7 +358,7 @@
 PASS CSSStyleDeclaration interface: style_element.style must inherit property "removeProperty(CSSOMString)" with the proper type 
 PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on style_element.style with too few arguments must throw TypeError 
 PASS CSSStyleDeclaration interface: style_element.style must inherit property "parentRule" with the proper type 
-FAIL CSSStyleDeclaration interface: style_element.style must inherit property "cssFloat" with the proper type assert_inherits: property "cssFloat" found on object expected in prototype chain
+PASS CSSStyleDeclaration interface: style_element.style must inherit property "cssFloat" with the proper type 
 PASS CSSStyleDeclaration must be primary interface of svg_element.style 
 PASS Stringification of svg_element.style 
 PASS CSSStyleDeclaration interface: svg_element.style must inherit property "cssText" with the proper type 
@@ -378,7 +378,7 @@
 PASS CSSStyleDeclaration interface: svg_element.style must inherit property "removeProperty(CSSOMString)" with the proper type 
 PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on svg_element.style with too few arguments must throw TypeError 
 PASS CSSStyleDeclaration interface: svg_element.style must inherit property "parentRule" with the proper type 
-FAIL CSSStyleDeclaration interface: svg_element.style must inherit property "cssFloat" with the proper type assert_inherits: property "cssFloat" found on object expected in prototype chain
+PASS CSSStyleDeclaration interface: svg_element.style must inherit property "cssFloat" with the proper type 
 PASS CSSStyleDeclaration must be primary interface of getComputedStyle(svg_element) 
 PASS Stringification of getComputedStyle(svg_element) 
 PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "cssText" with the proper type 
@@ -398,7 +398,7 @@
 PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "removeProperty(CSSOMString)" with the proper type 
 PASS CSSStyleDeclaration interface: calling removeProperty(CSSOMString) on getComputedStyle(svg_element) with too few arguments must throw TypeError 
 PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "parentRule" with the proper type 
-FAIL CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "cssFloat" with the proper type assert_inherits: property "cssFloat" found on object expected in prototype chain
+PASS CSSStyleDeclaration interface: getComputedStyle(svg_element) must inherit property "cssFloat" with the proper type 
 PASS CSS interface: existence and properties of interface object 
 PASS CSS interface object length 
 PASS CSS interface object name 

Modified: trunk/Source/WebCore/ChangeLog (222558 => 222559)


--- trunk/Source/WebCore/ChangeLog	2017-09-27 17:12:03 UTC (rev 222558)
+++ trunk/Source/WebCore/ChangeLog	2017-09-27 17:55:56 UTC (rev 222559)
@@ -1,3 +1,21 @@
+2017-09-27  Chris Dumez  <[email protected]>
+
+        cssFloat missing in CSSPropertyDeclaration.prototype
+        https://bugs.webkit.org/show_bug.cgi?id=177487
+
+        Reviewed by Sam Weinig.
+
+        Add support for cssFloat attribute on CSSPropertyDeclaration, as per:
+        - https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-cssfloat
+
+        Test: fast/css/CSSStyleDeclaration-cssFloat.html
+
+        * css/CSSStyleDeclaration.cpp:
+        (WebCore::CSSStyleDeclaration::cssFloat):
+        (WebCore::CSSStyleDeclaration::setCssFloat):
+        * css/CSSStyleDeclaration.h:
+        * css/CSSStyleDeclaration.idl:
+
 2017-09-27  Antti Koivisto  <[email protected]>
 
         Ref element keys in CSSAnimationControllerPrivate

Modified: trunk/Source/WebCore/css/CSSStyleDeclaration.cpp (222558 => 222559)


--- trunk/Source/WebCore/css/CSSStyleDeclaration.cpp	2017-09-27 17:12:03 UTC (rev 222558)
+++ trunk/Source/WebCore/css/CSSStyleDeclaration.cpp	2017-09-27 17:55:56 UTC (rev 222559)
@@ -323,4 +323,17 @@
     return result;
 }
 
+String CSSStyleDeclaration::cssFloat()
+{
+    return getPropertyValueInternal(CSSPropertyFloat);
 }
+
+ExceptionOr<void> CSSStyleDeclaration::setCssFloat(const String& value)
+{
+    auto result = setPropertyInternal(CSSPropertyFloat, value, false /* important */);
+    if (result.hasException())
+        return result.releaseException();
+    return { };
+}
+
+}

Modified: trunk/Source/WebCore/css/CSSStyleDeclaration.h (222558 => 222559)


--- trunk/Source/WebCore/css/CSSStyleDeclaration.h	2017-09-27 17:12:03 UTC (rev 222558)
+++ trunk/Source/WebCore/css/CSSStyleDeclaration.h	2017-09-27 17:55:56 UTC (rev 222559)
@@ -60,6 +60,9 @@
     virtual ExceptionOr<void> setProperty(const String& propertyName, const String& value, const String& priority) = 0;
     virtual ExceptionOr<String> removeProperty(const String& propertyName) = 0;
 
+    String cssFloat();
+    ExceptionOr<void> setCssFloat(const String&);
+
     // CSSPropertyID versions of the CSSOM functions to support bindings and editing.
     // Use the non-virtual methods in the concrete subclasses when possible.
     // The CSSValue returned by this function should not be exposed to the web as it may be used by multiple documents at the same time.

Modified: trunk/Source/WebCore/css/CSSStyleDeclaration.idl (222558 => 222559)


--- trunk/Source/WebCore/css/CSSStyleDeclaration.idl	2017-09-27 17:12:03 UTC (rev 222558)
+++ trunk/Source/WebCore/css/CSSStyleDeclaration.idl	2017-09-27 17:55:56 UTC (rev 222559)
@@ -39,6 +39,8 @@
     getter DOMString item(unsigned long index);
     readonly attribute CSSRule? parentRule;
 
+    [CEReactions] attribute [TreatNullAs=EmptyString] DOMString cssFloat;
+
     // FIXME: Using "undefined" as default parameter value is wrong.
     DOMString? getPropertyShorthand(optional DOMString propertyName = "undefined");
     boolean isPropertyImplicit(optional DOMString propertyName = "undefined");
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to