Title: [217917] trunk
Revision
217917
Author
[email protected]
Date
2017-06-07 20:32:21 -0700 (Wed, 07 Jun 2017)

Log Message

CSSStyleRule.style / CSSPageRule.style / CSSKeyframeRule.style should be settable
https://bugs.webkit.org/show_bug.cgi?id=164537
<rdar://problem/29181773>

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

* web-platform-tests/cssom/CSSKeyframeRule-expected.txt:
* web-platform-tests/cssom/CSSKeyframeRule.html:
* web-platform-tests/cssom/CSSStyleRule-expected.txt:
* web-platform-tests/cssom/CSSStyleRule.html:
Re-sync web-platform tests after:
- https://github.com/w3c/web-platform-tests/pull/6181
- https://github.com/w3c/web-platform-tests/pull/6184
This extends test coverage.

* web-platform-tests/cssom/interfaces-expected.txt:
Rebaseline now that more checks are passing.

Source/WebCore:

CSSStyleRule.style / CSSPageRule.style / CSSKeyframeRule.style should be settable
as per:
- https://drafts.csswg.org/cssom/#the-cssstylerule-interface
- https://drafts.csswg.org/cssom/#the-csspagerule-interface
- https://drafts.csswg.org/css-animations/#interface-csskeyframerule

Tests:
http/wpt/cssom/CSSPageRule.html
imported/w3c/web-platform-tests/cssom/CSSKeyframeRule.html
imported/w3c/web-platform-tests/cssom/CSSStyleRule.html
imported/w3c/web-platform-tests/cssom/interfaces.html

* css/CSSKeyframeRule.idl:
* css/CSSPageRule.idl:
* css/CSSStyleRule.idl:

LayoutTests:

Add better test coverage for CSSPageRule. This test is being upstreamed via:
- https://github.com/w3c/web-platform-tests/pull/6183

* http/wpt/cssom/CSSPageRule-expected.txt: Added.
* http/wpt/cssom/CSSPageRule.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (217916 => 217917)


--- trunk/LayoutTests/ChangeLog	2017-06-08 03:25:06 UTC (rev 217916)
+++ trunk/LayoutTests/ChangeLog	2017-06-08 03:32:21 UTC (rev 217917)
@@ -1,3 +1,17 @@
+2017-06-07  Chris Dumez  <[email protected]>
+
+        CSSStyleRule.style / CSSPageRule.style / CSSKeyframeRule.style should be settable
+        https://bugs.webkit.org/show_bug.cgi?id=164537
+        <rdar://problem/29181773>
+
+        Reviewed by Sam Weinig.
+
+        Add better test coverage for CSSPageRule. This test is being upstreamed via:
+        - https://github.com/w3c/web-platform-tests/pull/6183
+
+        * http/wpt/cssom/CSSPageRule-expected.txt: Added.
+        * http/wpt/cssom/CSSPageRule.html: Added.
+
 2017-06-07  Youenn Fablet  <[email protected]>
 
         RTCTrackEvent.track should be found in RTCTrackEvent.streams[0]

Added: trunk/LayoutTests/http/wpt/cssom/CSSPageRule-expected.txt (0 => 217917)


--- trunk/LayoutTests/http/wpt/cssom/CSSPageRule-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/http/wpt/cssom/CSSPageRule-expected.txt	2017-06-08 03:32:21 UTC (rev 217917)
@@ -0,0 +1,10 @@
+
+PASS CSSRule and CSSPageRule types 
+PASS Existence of CSSRule attributes 
+PASS Writability of CSSRule attributes 
+PASS Values of CSSRule attributes 
+PASS Existence and type of CSSPageRule attributes 
+PASS Values of CSSPageRule attributes 
+PASS Mutability of CSSPageRule's style attribute 
+PASS CSSPageRule's style has [PutForwards] 
+

Added: trunk/LayoutTests/http/wpt/cssom/CSSPageRule.html (0 => 217917)


--- trunk/LayoutTests/http/wpt/cssom/CSSPageRule.html	                        (rev 0)
+++ trunk/LayoutTests/http/wpt/cssom/CSSPageRule.html	2017-06-08 03:32:21 UTC (rev 217917)
@@ -0,0 +1,81 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>CSSPageRule interface</title>
+<link href="" rel="author" title="Chris Dumez">
+<link href="" rel="help">
+<script src=""
+<script src=""
+<style id="styleElement">
+    @page :left {
+        margin-left: 3cm;
+        margin-right: 4cm;
+    }
+</style>
+</head>
+<body>
+<script>
+    var rule;
+    setup(function() {
+        var styleSheet = document.getElementById("styleElement").sheet;
+        var ruleList = styleSheet.cssRules;
+        rule = ruleList[0];
+    });
+
+    test(function() {
+        assert_true(rule instanceof CSSRule);
+        assert_true(rule instanceof CSSPageRule);
+    }, "CSSRule and CSSPageRule types");
+
+    test(function() {
+        assert_true(rule instanceof CSSRule);
+        assert_idl_attribute(rule, "cssText");
+        assert_idl_attribute(rule, "parentRule");
+        assert_idl_attribute(rule, "parentStyleSheet");
+    }, "Existence of CSSRule attributes");
+
+    test(function() {
+        assert_readonly(rule, "type");
+        assert_readonly(rule, "parentRule");
+        assert_readonly(rule, "parentStyleSheet");
+    }, "Writability of CSSRule attributes");
+
+    test(function() {
+        assert_equals(rule.type, rule.PAGE_RULE);
+        assert_equals(typeof rule.cssText, "string");
+        assert_equals(rule.cssText, "@page :left { margin-left: 3cm; margin-right: 4cm; }");
+        assert_equals(rule.parentRule, null);
+        assert_true(rule.parentStyleSheet instanceof CSSStyleSheet);
+    }, "Values of CSSRule attributes");
+
+    test(function() {
+        assert_idl_attribute(rule, "selectorText");
+        assert_equals(typeof rule.selectorText, "string");
+        assert_idl_attribute(rule, "style");
+    }, "Existence and type of CSSPageRule attributes");
+
+    test(function() {
+        assert_equals(rule.selectorText, "@page :left");
+        assert_true(rule.style instanceof CSSStyleDeclaration);
+    }, "Values of CSSPageRule attributes");
+
+    test(function() {
+        assert_equals(rule.style.marginLeft, "3cm", "marginLeft");
+        assert_equals(rule.style.marginRight, "4cm", "marginRight");
+
+        rule.style.marginLeft = "5px";
+        rule.style.marginRight = "6px";
+
+        assert_equals(rule.style.marginLeft, "5px");
+        assert_equals(rule.style.marginRight, "6px");
+    }, "Mutability of CSSPageRule's style attribute");
+
+    test(function() {
+        rule.style = "margin-left: 6cm; margin-right: 8cm;";
+
+        assert_equals(rule.style.marginLeft, "6cm", "marginLeft");
+        assert_equals(rule.style.marginRight, "8cm", "marginRight");
+    }, "CSSPageRule's style has [PutForwards]");
+</script>
+</body>
+</html>

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (217916 => 217917)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2017-06-08 03:25:06 UTC (rev 217916)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2017-06-08 03:32:21 UTC (rev 217917)
@@ -1,5 +1,25 @@
 2017-06-07  Chris Dumez  <[email protected]>
 
+        CSSStyleRule.style / CSSPageRule.style / CSSKeyframeRule.style should be settable
+        https://bugs.webkit.org/show_bug.cgi?id=164537
+        <rdar://problem/29181773>
+
+        Reviewed by Sam Weinig.
+
+        * web-platform-tests/cssom/CSSKeyframeRule-expected.txt:
+        * web-platform-tests/cssom/CSSKeyframeRule.html:
+        * web-platform-tests/cssom/CSSStyleRule-expected.txt:
+        * web-platform-tests/cssom/CSSStyleRule.html:
+        Re-sync web-platform tests after:
+        - https://github.com/w3c/web-platform-tests/pull/6181
+        - https://github.com/w3c/web-platform-tests/pull/6184
+        This extends test coverage.
+
+        * web-platform-tests/cssom/interfaces-expected.txt:
+        Rebaseline now that more checks are passing.
+
+2017-06-07  Chris Dumez  <[email protected]>
+
         Align <col span>/<colgroup span> limits with the latest HTML specification
         https://bugs.webkit.org/show_bug.cgi?id=173049
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/CSSKeyframeRule-expected.txt (217916 => 217917)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/CSSKeyframeRule-expected.txt	2017-06-08 03:25:06 UTC (rev 217916)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/CSSKeyframeRule-expected.txt	2017-06-08 03:32:21 UTC (rev 217917)
@@ -1,3 +1,4 @@
 
 PASS CSSKeyframeRule: style property 
+PASS CSSKeyframeRule: style property has [PutForwards] 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/CSSKeyframeRule.html (217916 => 217917)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/CSSKeyframeRule.html	2017-06-08 03:25:06 UTC (rev 217916)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/CSSKeyframeRule.html	2017-06-08 03:32:21 UTC (rev 217917)
@@ -41,4 +41,11 @@
     assert_equals(toRule.style.marginLeft, "-5%");
     assert_equals(toRule.style.width, "50%");
   }, "CSSKeyframeRule: style property");
+
+  test(function() {
+    fromRule.style = "margin-left: 50%; width: 100%;";
+
+    assert_equals(fromRule.style.marginLeft, "50%", "margin-left");
+    assert_equals(fromRule.style.width, "100%", "width");
+  }, "CSSKeyframeRule: style property has [PutForwards]");
 </script>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/CSSStyleRule-expected.txt (217916 => 217917)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/CSSStyleRule-expected.txt	2017-06-08 03:25:06 UTC (rev 217916)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/CSSStyleRule-expected.txt	2017-06-08 03:32:21 UTC (rev 217917)
@@ -7,4 +7,5 @@
 PASS Existence, writability and type of CSSStyleRule attributes 
 PASS Values of CSSStyleRule attributes 
 PASS Mutability of CSSStyleRule's style attribute 
+PASS CSSStyleRule's style has [PutForwards] 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/CSSStyleRule.html (217916 => 217917)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/CSSStyleRule.html	2017-06-08 03:25:06 UTC (rev 217916)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/CSSStyleRule.html	2017-06-08 03:32:21 UTC (rev 217917)
@@ -67,7 +67,6 @@
             assert_idl_attribute(rule, "selectorText");
             assert_equals(typeof rule.selectorText, "string");
             assert_idl_attribute(rule, "style");
-            assert_readonly(rule, "style");
         }, "Existence, writability and type of CSSStyleRule attributes");
 
         test(function() {
@@ -85,6 +84,13 @@
             assert_equals(rule.style.padding, "5px");
             assert_equals(rule.style.border, "1px solid");
         }, "Mutability of CSSStyleRule's style attribute");
+
+        test(function() {
+            rule.style = "margin: 15px; padding: 2px;";
+
+            assert_equals(rule.style.margin, "15px", "margin");
+            assert_equals(rule.style.padding, "2px", "padding");
+        }, "CSSStyleRule's style has [PutForwards]");
     </script>
 </body>
 </html>

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/interfaces-expected.txt	2017-06-08 03:25:06 UTC (rev 217916)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/interfaces-expected.txt	2017-06-08 03:32:21 UTC (rev 217917)
@@ -108,7 +108,7 @@
 PASS CSSStyleRule interface: existence and properties of interface prototype object 
 PASS CSSStyleRule interface: existence and properties of interface prototype object's "constructor" property 
 PASS CSSStyleRule interface: attribute selectorText 
-FAIL CSSStyleRule interface: attribute style assert_equals: setter must be function for PutForwards, Replaceable, or non-readonly attributes expected "function" but got "undefined"
+PASS CSSStyleRule interface: attribute style 
 PASS CSSStyleRule interface: style_element.sheet.cssRules[0] must inherit property "selectorText" with the proper type (0) 
 PASS CSSStyleRule interface: style_element.sheet.cssRules[0] must inherit property "style" with the proper type (1) 
 PASS CSSRule interface: style_element.sheet.cssRules[0] must inherit property "STYLE_RULE" with the proper type (0) 
@@ -151,7 +151,7 @@
 FAIL CSSPageRule interface: existence and properties of interface prototype object assert_own_property: should inherit from CSSGroupingRule, but self has no such property expected property "CSSGroupingRule" missing
 PASS CSSPageRule interface: existence and properties of interface prototype object's "constructor" property 
 PASS CSSPageRule interface: attribute selectorText 
-FAIL CSSPageRule interface: attribute style assert_equals: setter must be function for PutForwards, Replaceable, or non-readonly attributes expected "function" but got "undefined"
+PASS CSSPageRule interface: attribute style 
 FAIL CSSMarginRule interface: existence and properties of interface object assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing
 FAIL CSSMarginRule interface object length assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing
 FAIL CSSMarginRule interface object name assert_own_property: self does not have own property "CSSMarginRule" expected property "CSSMarginRule" missing

Modified: trunk/Source/WebCore/ChangeLog (217916 => 217917)


--- trunk/Source/WebCore/ChangeLog	2017-06-08 03:25:06 UTC (rev 217916)
+++ trunk/Source/WebCore/ChangeLog	2017-06-08 03:32:21 UTC (rev 217917)
@@ -1,3 +1,27 @@
+2017-06-07  Chris Dumez  <[email protected]>
+
+        CSSStyleRule.style / CSSPageRule.style / CSSKeyframeRule.style should be settable
+        https://bugs.webkit.org/show_bug.cgi?id=164537
+        <rdar://problem/29181773>
+
+        Reviewed by Sam Weinig.
+
+        CSSStyleRule.style / CSSPageRule.style / CSSKeyframeRule.style should be settable
+        as per:
+        - https://drafts.csswg.org/cssom/#the-cssstylerule-interface
+        - https://drafts.csswg.org/cssom/#the-csspagerule-interface
+        - https://drafts.csswg.org/css-animations/#interface-csskeyframerule
+
+        Tests:
+        http/wpt/cssom/CSSPageRule.html
+        imported/w3c/web-platform-tests/cssom/CSSKeyframeRule.html
+        imported/w3c/web-platform-tests/cssom/CSSStyleRule.html
+        imported/w3c/web-platform-tests/cssom/interfaces.html
+
+        * css/CSSKeyframeRule.idl:
+        * css/CSSPageRule.idl:
+        * css/CSSStyleRule.idl:
+
 2017-06-07  Sam Weinig  <[email protected]>
 
         [WebIDL] Split up attribute generation to match operation generation

Modified: trunk/Source/WebCore/css/CSSKeyframeRule.idl (217916 => 217917)


--- trunk/Source/WebCore/css/CSSKeyframeRule.idl	2017-06-08 03:25:06 UTC (rev 217916)
+++ trunk/Source/WebCore/css/CSSKeyframeRule.idl	2017-06-08 03:32:21 UTC (rev 217917)
@@ -30,7 +30,7 @@
 interface CSSKeyframeRule : CSSRule {
 
     attribute DOMString keyText;
-    readonly attribute CSSStyleDeclaration style;
+    [PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
 
 };
 

Modified: trunk/Source/WebCore/css/CSSPageRule.idl (217916 => 217917)


--- trunk/Source/WebCore/css/CSSPageRule.idl	2017-06-08 03:25:06 UTC (rev 217916)
+++ trunk/Source/WebCore/css/CSSPageRule.idl	2017-06-08 03:32:21 UTC (rev 217917)
@@ -22,6 +22,6 @@
 interface CSSPageRule : CSSRule {
     attribute DOMString? selectorText;
 
-    readonly attribute CSSStyleDeclaration style;
+    [PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
 };
 

Modified: trunk/Source/WebCore/css/CSSStyleRule.idl (217916 => 217917)


--- trunk/Source/WebCore/css/CSSStyleRule.idl	2017-06-08 03:25:06 UTC (rev 217916)
+++ trunk/Source/WebCore/css/CSSStyleRule.idl	2017-06-08 03:32:21 UTC (rev 217917)
@@ -22,6 +22,6 @@
 interface CSSStyleRule : CSSRule {
     attribute DOMString? selectorText;
 
-    readonly attribute CSSStyleDeclaration style;
+    [PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to