Title: [203782] trunk
Revision
203782
Author
[email protected]
Date
2016-07-27 11:04:16 -0700 (Wed, 27 Jul 2016)

Log Message

Align CSSSupportsRule with the specification
https://bugs.webkit.org/show_bug.cgi?id=160256

Reviewed by Darin Adler.

Source/WebCore:

Align CSSSupportsRule with the specification:
- https://drafts.csswg.org/css-conditional-3/#csssupportsrule

In particular:
- Make the parameters to insertRule() / deleteRule() mandatory
- Expose CSSSupportsRule on the global Window object

Both Firefox and Chrome agree with the specification here.

Test: fast/css/CSSSupportsRule-parameters.html

* css/CSSSupportsRule.idl:

LayoutTests:

* fast/css/CSSSupportsRule-parameters-expected.txt: Added.
* fast/css/CSSSupportsRule-parameters.html: Added.
Add layout test coverage for mandatory parameters.

* platform/efl/js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/js/dom/global-constructors-attributes-expected.txt:
Rebaseline existing test now that CSSSupportsRule is exposed on the
global Window object.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (203781 => 203782)


--- trunk/LayoutTests/ChangeLog	2016-07-27 17:15:50 UTC (rev 203781)
+++ trunk/LayoutTests/ChangeLog	2016-07-27 18:04:16 UTC (rev 203782)
@@ -1,3 +1,22 @@
+2016-07-27  Chris Dumez  <[email protected]>
+
+        Align CSSSupportsRule with the specification
+        https://bugs.webkit.org/show_bug.cgi?id=160256
+
+        Reviewed by Darin Adler.
+
+        * fast/css/CSSSupportsRule-parameters-expected.txt: Added.
+        * fast/css/CSSSupportsRule-parameters.html: Added.
+        Add layout test coverage for mandatory parameters.
+
+        * platform/efl/js/dom/global-constructors-attributes-expected.txt:
+        * platform/gtk/js/dom/global-constructors-attributes-expected.txt:
+        * platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
+        * platform/mac/js/dom/global-constructors-attributes-expected.txt:
+        * platform/win/js/dom/global-constructors-attributes-expected.txt:
+        Rebaseline existing test now that CSSSupportsRule is exposed on the
+        global Window object.
+
 2016-07-27  Miguel Gomez  <[email protected]>
 
         [GTK] Unreviewed gardening: update expectations after r203770

Added: trunk/LayoutTests/fast/css/CSSSupportsRule-parameters-expected.txt (0 => 203782)


--- trunk/LayoutTests/fast/css/CSSSupportsRule-parameters-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/CSSSupportsRule-parameters-expected.txt	2016-07-27 18:04:16 UTC (rev 203782)
@@ -0,0 +1,13 @@
+Tests that the parameters to CSSSupportsRule.insertRule() / deleteRule() are mandatory.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS supportsRule.__proto__ is CSSSupportsRule.prototype
+PASS supportsRule.insertRule() threw exception TypeError: Not enough arguments.
+PASS supportsRule.insertRule('width: 0') threw exception TypeError: Not enough arguments.
+PASS supportsRule.deleteRule() threw exception TypeError: Not enough arguments.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/css/CSSSupportsRule-parameters.html (0 => 203782)


--- trunk/LayoutTests/fast/css/CSSSupportsRule-parameters.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/CSSSupportsRule-parameters.html	2016-07-27 18:04:16 UTC (rev 203782)
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@supports (border: black) and (padding: 0) and (width: 0) {
+    dfn { width:0; }
+}
+</style>
+</head>
+<body>
+<script src=""
+<script>
+description("Tests that the parameters to CSSSupportsRule.insertRule() / deleteRule() are mandatory.");
+
+var supportsRule = document.styleSheets[0].cssRules[0];
+shouldBe("supportsRule.__proto__", "CSSSupportsRule.prototype");
+
+shouldThrow("supportsRule.insertRule()", "'TypeError: Not enough arguments'");
+shouldThrow("supportsRule.insertRule('width: 0')", "'TypeError: Not enough arguments'");
+shouldThrow("supportsRule.deleteRule()", "'TypeError: Not enough arguments'");
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt (203781 => 203782)


--- trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt	2016-07-27 17:15:50 UTC (rev 203781)
+++ trunk/LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt	2016-07-27 18:04:16 UTC (rev 203782)
@@ -173,6 +173,11 @@
 PASS Object.getOwnPropertyDescriptor(global, 'CSSStyleSheet').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'CSSStyleSheet').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'CSSStyleSheet').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').value is CSSSupportsRule
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'CSSValue').value is CSSValue
 PASS Object.getOwnPropertyDescriptor(global, 'CSSValue').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'CSSValue').hasOwnProperty('set') is false

Modified: trunk/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt (203781 => 203782)


--- trunk/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt	2016-07-27 17:15:50 UTC (rev 203781)
+++ trunk/LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt	2016-07-27 18:04:16 UTC (rev 203782)
@@ -173,6 +173,11 @@
 PASS Object.getOwnPropertyDescriptor(global, 'CSSStyleSheet').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'CSSStyleSheet').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'CSSStyleSheet').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').value is CSSSupportsRule
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'CSSValue').value is CSSValue
 PASS Object.getOwnPropertyDescriptor(global, 'CSSValue').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'CSSValue').hasOwnProperty('set') is false

Modified: trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt (203781 => 203782)


--- trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt	2016-07-27 17:15:50 UTC (rev 203781)
+++ trunk/LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt	2016-07-27 18:04:16 UTC (rev 203782)
@@ -193,6 +193,11 @@
 PASS Object.getOwnPropertyDescriptor(global, 'CSSStyleSheet').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'CSSStyleSheet').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'CSSStyleSheet').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').value is CSSSupportsRule
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'CSSValue').value is CSSValue
 PASS Object.getOwnPropertyDescriptor(global, 'CSSValue').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'CSSValue').hasOwnProperty('set') is false

Modified: trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt (203781 => 203782)


--- trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt	2016-07-27 17:15:50 UTC (rev 203781)
+++ trunk/LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt	2016-07-27 18:04:16 UTC (rev 203782)
@@ -193,6 +193,11 @@
 PASS Object.getOwnPropertyDescriptor(global, 'CSSStyleSheet').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'CSSStyleSheet').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'CSSStyleSheet').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').value is CSSSupportsRule
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'CSSValue').value is CSSValue
 PASS Object.getOwnPropertyDescriptor(global, 'CSSValue').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'CSSValue').hasOwnProperty('set') is false

Modified: trunk/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt (203781 => 203782)


--- trunk/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt	2016-07-27 17:15:50 UTC (rev 203781)
+++ trunk/LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt	2016-07-27 18:04:16 UTC (rev 203782)
@@ -123,6 +123,11 @@
 PASS Object.getOwnPropertyDescriptor(global, 'CSSStyleSheet').hasOwnProperty('set') is false
 PASS Object.getOwnPropertyDescriptor(global, 'CSSStyleSheet').enumerable is false
 PASS Object.getOwnPropertyDescriptor(global, 'CSSStyleSheet').configurable is true
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').value is CSSSupportsRule
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').hasOwnProperty('get') is false
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').hasOwnProperty('set') is false
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').enumerable is false
+PASS Object.getOwnPropertyDescriptor(global, 'CSSSupportsRule').configurable is true
 PASS Object.getOwnPropertyDescriptor(global, 'CSSValue').value is CSSValue
 PASS Object.getOwnPropertyDescriptor(global, 'CSSValue').hasOwnProperty('get') is false
 PASS Object.getOwnPropertyDescriptor(global, 'CSSValue').hasOwnProperty('set') is false

Modified: trunk/Source/WebCore/ChangeLog (203781 => 203782)


--- trunk/Source/WebCore/ChangeLog	2016-07-27 17:15:50 UTC (rev 203781)
+++ trunk/Source/WebCore/ChangeLog	2016-07-27 18:04:16 UTC (rev 203782)
@@ -1,3 +1,23 @@
+2016-07-27  Chris Dumez  <[email protected]>
+
+        Align CSSSupportsRule with the specification
+        https://bugs.webkit.org/show_bug.cgi?id=160256
+
+        Reviewed by Darin Adler.
+
+        Align CSSSupportsRule with the specification:
+        - https://drafts.csswg.org/css-conditional-3/#csssupportsrule
+
+        In particular:
+        - Make the parameters to insertRule() / deleteRule() mandatory
+        - Expose CSSSupportsRule on the global Window object
+
+        Both Firefox and Chrome agree with the specification here.
+
+        Test: fast/css/CSSSupportsRule-parameters.html
+
+        * css/CSSSupportsRule.idl:
+
 2016-07-27  Carlos Garcia Campos  <[email protected]>
 
         [Soup] Test http/tests/xmlhttprequest/auth-reject-protection-space.html fails since added in r203743

Modified: trunk/Source/WebCore/css/CSSSupportsRule.idl (203781 => 203782)


--- trunk/Source/WebCore/css/CSSSupportsRule.idl	2016-07-27 17:15:50 UTC (rev 203781)
+++ trunk/Source/WebCore/css/CSSSupportsRule.idl	2016-07-27 18:04:16 UTC (rev 203782)
@@ -26,15 +26,11 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-[
-    NoInterfaceObject,
-] interface CSSSupportsRule : CSSRule {
+interface CSSSupportsRule : CSSRule {
     readonly attribute CSSRuleList cssRules;
     readonly attribute DOMString conditionText;
 
-    // FIXME: Using "undefined" as default parameter value is wrong.
-    [RaisesException] unsigned long insertRule(optional DOMString rule = "undefined",
-                             optional unsigned long index = 0);
-    [RaisesException] void deleteRule(optional unsigned long index = 0);
+    [RaisesException] unsigned long insertRule(DOMString rule, unsigned long index);
+    [RaisesException] void deleteRule(unsigned long index);
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to