Title: [268961] trunk/LayoutTests
Revision
268961
Author
[email protected]
Date
2020-10-25 14:43:54 -0700 (Sun, 25 Oct 2020)

Log Message

Update CSSOM WPT tests.
https://bugs.webkit.org/show_bug.cgi?id=218157

Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

* resources/resource-files.json:
* web-platform-tests/css/cssom/CSS.html: Removed.
* web-platform-tests/css/cssom/CSSCounterStyleRule-expected.txt: Added.
* web-platform-tests/css/cssom/CSSCounterStyleRule.html: Added.
* web-platform-tests/css/cssom/CSSFontFaceRule-expected.txt: Added.
* web-platform-tests/css/cssom/CSSFontFaceRule.html: Added.
* web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative-expected.txt:
* web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html:
* web-platform-tests/css/cssom/css-style-attr-decl-block.html:
* web-platform-tests/css/cssom/cssimportrule.html:
* web-platform-tests/css/cssom/escape.html:
* web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
* web-platform-tests/css/cssom/getComputedStyle-detached-subtree.html:
* web-platform-tests/css/cssom/getComputedStyle-resolved-colors-expected.txt: Added.
* web-platform-tests/css/cssom/getComputedStyle-resolved-colors.html: Added.
* web-platform-tests/css/cssom/medialist-interfaces-003-expected.txt: Removed.
* web-platform-tests/css/cssom/medialist-interfaces-003.html: Removed.
* web-platform-tests/css/cssom/mediaquery-sort-dedup-expected.txt: Added.
* web-platform-tests/css/cssom/mediaquery-sort-dedup.html: Added.
* web-platform-tests/css/cssom/removerule-invalidation-crash.html: Added.
* web-platform-tests/css/cssom/rule-restrictions-expected.txt: Added.
* web-platform-tests/css/cssom/rule-restrictions.html: Added.
* web-platform-tests/css/cssom/serialize-media-rule-expected.txt:
* web-platform-tests/css/cssom/serialize-media-rule.html:
* web-platform-tests/css/cssom/w3c-import.log:

LayoutTests:

* tests-options.json:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (268960 => 268961)


--- trunk/LayoutTests/ChangeLog	2020-10-25 21:34:47 UTC (rev 268960)
+++ trunk/LayoutTests/ChangeLog	2020-10-25 21:43:54 UTC (rev 268961)
@@ -1,3 +1,12 @@
+2020-10-25  Emilio Cobos Álvarez  <[email protected]>
+
+        Update CSSOM WPT tests.
+        https://bugs.webkit.org/show_bug.cgi?id=218157
+
+        Reviewed by Simon Fraser.
+
+        * tests-options.json:
+
 2020-10-25  Zalan Bujtas  <[email protected]>
 
         Remove unneeded whitespace between content and <br>

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (268960 => 268961)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2020-10-25 21:34:47 UTC (rev 268960)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2020-10-25 21:43:54 UTC (rev 268961)
@@ -1,3 +1,36 @@
+2020-10-25  Emilio Cobos Álvarez  <[email protected]>
+
+        Update CSSOM WPT tests.
+        https://bugs.webkit.org/show_bug.cgi?id=218157
+
+        Reviewed by Simon Fraser.
+
+        * resources/resource-files.json:
+        * web-platform-tests/css/cssom/CSS.html: Removed.
+        * web-platform-tests/css/cssom/CSSCounterStyleRule-expected.txt: Added.
+        * web-platform-tests/css/cssom/CSSCounterStyleRule.html: Added.
+        * web-platform-tests/css/cssom/CSSFontFaceRule-expected.txt: Added.
+        * web-platform-tests/css/cssom/CSSFontFaceRule.html: Added.
+        * web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative-expected.txt:
+        * web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html:
+        * web-platform-tests/css/cssom/css-style-attr-decl-block.html:
+        * web-platform-tests/css/cssom/cssimportrule.html:
+        * web-platform-tests/css/cssom/escape.html:
+        * web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
+        * web-platform-tests/css/cssom/getComputedStyle-detached-subtree.html:
+        * web-platform-tests/css/cssom/getComputedStyle-resolved-colors-expected.txt: Added.
+        * web-platform-tests/css/cssom/getComputedStyle-resolved-colors.html: Added.
+        * web-platform-tests/css/cssom/medialist-interfaces-003-expected.txt: Removed.
+        * web-platform-tests/css/cssom/medialist-interfaces-003.html: Removed.
+        * web-platform-tests/css/cssom/mediaquery-sort-dedup-expected.txt: Added.
+        * web-platform-tests/css/cssom/mediaquery-sort-dedup.html: Added.
+        * web-platform-tests/css/cssom/removerule-invalidation-crash.html: Added.
+        * web-platform-tests/css/cssom/rule-restrictions-expected.txt: Added.
+        * web-platform-tests/css/cssom/rule-restrictions.html: Added.
+        * web-platform-tests/css/cssom/serialize-media-rule-expected.txt:
+        * web-platform-tests/css/cssom/serialize-media-rule.html:
+        * web-platform-tests/css/cssom/w3c-import.log:
+
 2020-10-23  Diego Pino Garcia  <[email protected]>
 
         REGRESSION (r267402): [ iOS Mojave+ Release ] imported/w3c/web-platform-tests/user-timing/measure-l3.any.html is a flaky failure

Modified: trunk/LayoutTests/imported/w3c/resources/resource-files.json (268960 => 268961)


--- trunk/LayoutTests/imported/w3c/resources/resource-files.json	2020-10-25 21:34:47 UTC (rev 268960)
+++ trunk/LayoutTests/imported/w3c/resources/resource-files.json	2020-10-25 21:43:54 UTC (rev 268961)
@@ -783,6 +783,7 @@
         "web-platform-tests/css/css-writing-modes/vertical-alignment-vrl-018.xht",
         "web-platform-tests/css/css-writing-modes/vertical-alignment-vrl-020.xht",
         "web-platform-tests/css/cssom-view/iframe.html",
+        "web-platform-tests/css/cssom/removerule-invalidation-crash.html",
         "web-platform-tests/css/cssom/support/xmlss-pi.xhtml",
         "web-platform-tests/css/mediaqueries/media-queries-001.xht",
         "web-platform-tests/css/mediaqueries/media-queries-002.xht",

Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSS.html (268960 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSS.html	2020-10-25 21:34:47 UTC (rev 268960)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSS.html	2020-10-25 21:43:54 UTC (rev 268961)
@@ -1,48 +0,0 @@
-<!doctype html>
-<meta charset="utf-8">
-<title>CSSOM - CSS interface</title>
-<link rel="help" href=""
-<script src=""
-<script src=""
-<script>
-    test(function () {
-        // https://drafts.csswg.org/cssom/#dom-css-escape
-        // https://drafts.csswg.org/cssom/#serialize-an-identifier
-        assert_equals(CSS.escape("hello world"), "hello\\ world", "CSS.escape: spaces get escaped with backslashes");
-        assert_equals(CSS.escape("hello\0world"), "hello\u{FFFD}world", "CSS.escape: NULL get replaced with U+FFFD REPLACEMENT CHARACTER");
-        assert_equals(CSS.escape("hello0world"), "hello0world", "CSS.escape: Numbers within string preserved");
-        assert_equals(CSS.escape("hello\x10world"), "hello\\10 world", "CSS.escape: Values between \\x01 and \\x1f are unicode escaped");
-        assert_equals(CSS.escape("hello\\world"), "hello\\\\world", "CSS.escape: Backslashes get backslash-escaped");
-        assert_equals(CSS.escape("hello\u{1234}world"), "hello\u{1234}world", "CSS.escape: Code points greater than U+0080 are preserved");
-        assert_equals(CSS.escape("hello\x7Fworld"), "hello\\7f world", "CSS.escape: Some code points less than U+0080 are unicode-escaped");
-        assert_equals(CSS.escape("-"), "\\-", "CSS.escape: Single dash escaped");
-        assert_equals(CSS.escape("0foo"), "\\30 foo", "CSS.escape: Numbers at the beginning of an ident get unicode escaped");
-        assert_equals(CSS.escape("-0foo"), "-\\30 foo", "CSS.escape: Numbers at the beginning of an ident after single hyphen get unicode escaped");
-        assert_equals(CSS.escape("--0foo"), "--0foo", "CSS.escape: Numbers at the beginning of an ident after multiple hyphens do not get unicode escaped");
-    }, "CSS.escape");
-    test(function () {
-        // https://drafts.csswg.org/css-conditional/#dom-css-supports
-        // https://drafts.csswg.org/css-conditional/#typedef-supports-condition
-        assert_equals(CSS.supports("color: red"), true, "CSS.supports: Single-argument form allows for declarations without enclosing parentheses");
-        assert_equals(CSS.supports("(color: red) and (color: blue)"), true, "CSS.supports: Complex conditions allowed");
-        assert_equals(CSS.supports("not (foobar)"), true, "CSS.supports: general_enclosed still parses");
-        assert_equals(CSS.supports("color: something-pointless var(--foo)"), true, "Variable references always parse");
-        assert_equals(CSS.supports("color: something-pointless(var(--foo))"), true, "Variable references in an unknown function always parse");
-    }, "CSS.supports, one argument form");
-    test(function () {
-        // https://drafts.csswg.org/css-conditional/#dom-css-supports
-        // https://drafts.csswg.org/css-conditional/#dfn-support
-        assert_equals(CSS.supports("color", "red"), true, "CSS.supports: two argument form succeeds for known property");
-        assert_equals(CSS.supports("unknownproperty", "blah"), false, "CSS.supports: two argument form fails for unknown property");
-        assert_equals(CSS.supports("width", "blah"), false, "CSS.supports: two argument form fails for invalid value");
-        assert_equals(CSS.supports("--foo", "blah"), true, "CSS.supports: two argument form succeeds for custom property");
-    }, "CSS.supports, two argument form");
-    test(function () {
-        assert_equals(CSS.supports("selector(div)"), true, "CSS.supports: selector() function accepts a selector");
-        assert_equals(CSS.supports("selector(div, div)"), false, "CSS.supports: selector() function doesn't accept a selector list");
-        assert_equals(CSS.supports("selector(::-webkit-unknown-pseudo-element)"), false, "CSS.supports: selector() function rejects unknown webkit pseudo-elements.");
-        assert_equals(CSS.supports("selector(::before)"), true, "CSS.supports: selector() function accepts known pseudo-elements");
-        assert_equals(CSS.supports("selector(div + .c)"), true, "CSS.supports: selector() with simple combinators");
-        assert_equals(CSS.supports("selector(div | .c)"), false, "CSS.supports: selector() with unknown combinators");
-    }, "CSS.supports, selector function");
-</script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSCounterStyleRule-expected.txt (0 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSCounterStyleRule-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSCounterStyleRule-expected.txt	2020-10-25 21:43:54 UTC (rev 268961)
@@ -0,0 +1,3 @@
+
+FAIL CSSCounterStyleRule.cssText doesn't serialize with newlines undefined is not an object (evaluating 'rule.cssText')
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSCounterStyleRule.html (0 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSCounterStyleRule.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSCounterStyleRule.html	2020-10-25 21:43:54 UTC (rev 268961)
@@ -0,0 +1,21 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>CSSOM - CSSCounterStyleRule interface</title>
+<link rel="help" href=""
+<script src=""
+<script src=""
+<style>
+  @counter-style foo {
+    system: cyclic;
+    symbols: ‣;
+    suffix: " ";
+  }
+</style>
+<script>
+test(function() {
+  // TODO: The exact serialization isn't well specified (the ordering of the
+  // descriptors isn't defined).
+  let rule = document.styleSheets[0].cssRules[0];
+  assert_false(rule.cssText.includes('\n'));
+}, "CSSCounterStyleRule.cssText doesn't serialize with newlines");
+</script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSFontFaceRule-expected.txt (0 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSFontFaceRule-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSFontFaceRule-expected.txt	2020-10-25 21:43:54 UTC (rev 268961)
@@ -0,0 +1,3 @@
+
+PASS CSSFontFaceRule.cssText doesn't serialize with newlines
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSFontFaceRule.html (0 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSFontFaceRule.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSFontFaceRule.html	2020-10-25 21:43:54 UTC (rev 268961)
@@ -0,0 +1,21 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>CSSOM -  CSSFontFaceRule interface</title>
+<link rel="help" href=""
+<script src=""
+<script src=""
+<style>
+  @font-face {
+    src: local("foo");
+    font-family: foo;
+    font-weight: bold;
+  }
+</style>
+<script>
+test(function() {
+  // TODO: The exact serialization isn't consistent across browsers
+  // (Firefox doesn't preserve ordering of the descriptors, WebKit/Blink does).
+  let rule = document.styleSheets[0].cssRules[0];
+  assert_false(rule.cssText.includes('\n'));
+}, "CSSFontFaceRule.cssText doesn't serialize with newlines");
+</script>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative-expected.txt (268960 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative-expected.txt	2020-10-25 21:34:47 UTC (rev 268960)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative-expected.txt	2020-10-25 21:43:54 UTC (rev 268961)
@@ -1,16 +1,6 @@
-CONSOLE MESSAGE: Unhandled Promise Rejection: TypeError: Illegal constructor
 
-Harness Error (FAIL), message = Unhandled rejection: Illegal constructor
-
 FAIL Inserting an @import rule through insertRule on a constructed stylesheet throws an exception assert_throws_dom: function "() => { (new CSSStyleSheet).insertRule(import_text) }" threw object "TypeError: Illegal constructor" that is not a DOMException SyntaxError: property "code" is equal to undefined, expected 12
-TIMEOUT @import rules should not trigger any loads. Test timed out
+FAIL @import rules should not trigger any loads. promise_test: Unhandled rejection with value: object "TypeError: Illegal constructor"
 FAIL @import rules are not parsed in CSSStyleSheet.replace Illegal constructor
 FAIL @import rules are not parsed in CSSStyleSheet.replaceSync Illegal constructor
 
-Harness Error (FAIL), message = Unhandled rejection: Illegal constructor
-
-FAIL Inserting an @import rule through insertRule on a constructed stylesheet throws an exception assert_throws_dom: function "() => { (new CSSStyleSheet).insertRule(import_text) }" threw object "TypeError: Illegal constructor" that is not a DOMException SyntaxError: property "code" is equal to undefined, expected 12
-TIMEOUT @import rules should not trigger any loads. Test timed out
-FAIL @import rules are not parsed in CSSStyleSheet.replace Illegal constructor
-FAIL @import rules are not parsed in CSSStyleSheet.replaceSync Illegal constructor
-

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html (268960 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html	2020-10-25 21:34:47 UTC (rev 268960)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html	2020-10-25 21:43:54 UTC (rev 268961)
@@ -21,7 +21,7 @@
   assert_throws_dom("SyntaxError", () => { (new CSSStyleSheet).insertRule(import_text) });
 }, 'Inserting an @import rule through insertRule on a constructed stylesheet throws an exception');
 
-async_test(async t => {
+promise_test(async t => {
     const importUrl = "support/constructable-import.css";
     const sheet = new CSSStyleSheet();
 
@@ -32,17 +32,19 @@
     const timeAfterImportsInvoked = performance.now();
 
     let link = document.createElement("link");
+    t.add_cleanup(() => { link.remove(); });
     link.rel = "stylesheet";
     link.href = ""
 
-    link.addEventListener("error", t.unreached_func("Load shouldn't fail"));
-    link.addEventListener("load", t.step_func_done(event => {
-      let entries = window.performance.getEntriesByType('resource').filter(entry => entry.name.includes(importUrl));
-      assert_equals(entries.length, 1, "There should be only one entry for the import URL");
-      assert_greater_than_equal(entries[0].startTime, timeAfterImportsInvoked, "The entry's start time should be after all throws");
-      link.remove();
-    }));
-    document.body.appendChild(link);
+    await new Promise((resolve, reject) => {
+      link.addEventListener("load", resolve);
+      link.addEventListener("error", reject);
+      document.body.appendChild(link);
+    });
+
+    let entries = window.performance.getEntriesByType('resource').filter(entry => entry.name.includes(importUrl));
+    assert_equals(entries.length, 1, "There should be only one entry for the import URL");
+    assert_greater_than_equal(entries[0].startTime, timeAfterImportsInvoked, "The entry's start time should be after all throws");
 }, "@import rules should not trigger any loads.")
 
 promise_test(() => {

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/css-style-attr-decl-block.html (268960 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/css-style-attr-decl-block.html	2020-10-25 21:34:47 UTC (rev 268960)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/css-style-attr-decl-block.html	2020-10-25 21:43:54 UTC (rev 268961)
@@ -92,7 +92,7 @@
   observer.observe(elem, {attributes: true});
   function assert_no_record(action) {
     let records = observer.takeRecords();
-    assert_true(records.length == 0, "expect no record after " + action);
+    assert_equals(records.length, 0, "expect no record after " + action);
   }
   style.setProperty("z-index", "invalid");
   assert_no_record("setting invalid value to property");

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/cssimportrule.html (268960 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/cssimportrule.html	2020-10-25 21:34:47 UTC (rev 268960)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/cssimportrule.html	2020-10-25 21:43:54 UTC (rev 268961)
@@ -95,8 +95,8 @@
 
         test(function() {
             var ruleWithPage = ruleList[3];
-            ruleWithPage.style = "background-color: green;"
-            assert_equals(ruleWithPage.style.cssText, "background-color: green;");
+            ruleWithPage.style = "margin-top: 10px;"
+            assert_equals(ruleWithPage.style.cssText, "margin-top: 10px;");
         }, "CSSStyleDeclaration cssText attribute should be updated due to [PutForwards]");
 
         test(function() {

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/escape.html (268960 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/escape.html	2020-10-25 21:34:47 UTC (rev 268960)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/escape.html	2020-10-25 21:43:54 UTC (rev 268961)
@@ -85,6 +85,10 @@
   assert_equals(CSS.escape('abcdefghijklmnopqrstuvwxyz'), 'abcdefghijklmnopqrstuvwxyz');
   assert_equals(CSS.escape('ABCDEFGHIJKLMNOPQRSTUVWXYZ'), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');
 
+  assert_equals(CSS.escape("hello\\world"), "hello\\\\world", "Backslashes get backslash-escaped");
+  assert_equals(CSS.escape("hello\u{1234}world"), "hello\u{1234}world", "Code points greater than U+0080 are preserved");
+  assert_equals(CSS.escape("-"), "\\-", "CSS.escape: Single dash escaped");
+
   assert_equals(CSS.escape('\x20\x21\x78\x79'), '\\ \\!xy');
 }, "Various tests");
 

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-resolved-colors-expected.txt (0 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-resolved-colors-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-resolved-colors-expected.txt	2020-10-25 21:43:54 UTC (rev 268961)
@@ -0,0 +1,15 @@
+
+PASS The resolved value for 'background-color' is the used value
+PASS The resolved value for 'border-block-end-color' is the used value
+PASS The resolved value for 'border-block-start-color' is the used value
+PASS The resolved value for 'border-bottom-color' is the used value
+PASS The resolved value for 'border-inline-end-color' is the used value
+PASS The resolved value for 'border-inline-start-color' is the used value
+PASS The resolved value for 'border-left-color' is the used value
+PASS The resolved value for 'border-right-color' is the used value
+PASS The resolved value for 'border-top-color' is the used value
+PASS The resolved value for 'box-shadow' is the used value
+PASS The resolved value for 'caret-color' is the used value
+PASS The resolved value for 'color' is the used value
+PASS The resolved value for 'outline-color' is the used value
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-resolved-colors.html (0 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-resolved-colors.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-resolved-colors.html	2020-10-25 21:43:54 UTC (rev 268961)
@@ -0,0 +1,42 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>CSSOM: resolved values of certain color properties are used values</title>
+<link rel="help" href=""
+<script src=""
+<script src=""
+<style>
+  #target {
+    background-color: Menu;
+    border: 1px solid Menu;
+    box-shadow: 1px 1px Menu;
+    caret-color: Menu;
+    color: Menu;
+    outline-color: Menu;
+  }
+</style>
+<div id="target"></div>
+<script>
+  const properties_to_test = [
+    "background-color",
+    "border-block-end-color",
+    "border-block-start-color",
+    "border-bottom-color",
+    "border-inline-end-color",
+    "border-inline-start-color",
+    "border-left-color",
+    "border-right-color",
+    "border-top-color",
+    "box-shadow",
+    "caret-color",
+    "color",
+    "outline-color",
+  ];
+
+  for (const property of properties_to_test) {
+    test(function() {
+      let resolved_value =
+        window.getComputedStyle(document.getElementById("target")).getPropertyValue(property);
+      assert_regexp_match(resolved_value, /^rgb[a]?\(/);
+    }, "The resolved value for '" + property + "' is the used value");
+  }
+</script>

Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-interfaces-003-expected.txt (268960 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-interfaces-003-expected.txt	2020-10-25 21:34:47 UTC (rev 268960)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-interfaces-003-expected.txt	2020-10-25 21:43:54 UTC (rev 268961)
@@ -1,4 +0,0 @@
-
-PASS mediatest_mediaquery_serialize_1
-PASS mediatest_mediaquery_serialize_2
-

Deleted: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-interfaces-003.html (268960 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-interfaces-003.html	2020-10-25 21:34:47 UTC (rev 268960)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-interfaces-003.html	2020-10-25 21:43:54 UTC (rev 268961)
@@ -1,61 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
-  <title>CSS Test: CSSOM Media Query Serialization</title>
-  <link rel="author" title="Ben Sheldon" href=""
-  <link rel="author" title="Chapman Shoop" href=""
-  <link rel="help" href=""
-  <meta name="flags" content="dom">
-  <meta name="assert" content="Media Queries are serialized according to the specification">
-  <script src="" type="text/_javascript_"></script>
-  <script src="" type="text/_javascript_"></script>
- </head>
- <body>
-  <noscript>Test not run - _javascript_ required.</noscript>
-  <div id="log"></div>
-  <script type="text/_javascript_">
-
-    var styleElement;
-    var styleSheet;
-    var mediaList;
-
-    // Setup - accepts media value for style element, e.g. <style media=???">
-    function setupMedia(media) {
-      styleElement = document.getElementById("styleElement");
-
-      if (styleElement) {
-        // teardown
-        document.getElementsByTagName("head")[0].removeChild(styleElement);
-        styleElement = undefined;
-        styleSheet = undefined;
-        mediaList = undefined;
-      }
-
-      styleElement = document.createElement("style");
-      styleElement.id = "styleElement";
-      styleElement.type = "text/css";
-      styleElement.media = media;
-      document.getElementsByTagName("head")[0].appendChild(styleElement);
-      styleSheet = styleElement.sheet;
-      mediaList = styleSheet.media;
-    }
-
-    // First explicit example input (first column) and output (second column) in specification.
-    test(function() {
-        setupMedia('not screen and (min-WIDTH:5px) AND (max-width:40px )');
-
-        assert_equals(mediaList.mediaText, "not screen and (max-width: 40px) and (min-width: 5px)");
-
-    }, "mediatest_mediaquery_serialize_1");
-
-    // Second explicit example input (first column) and output (second column) in specification.
-    test(function() {
-        setupMedia('all and (color) and (color)	');
-
-        assert_equals(mediaList.mediaText, "(color)");
-
-    }, "mediatest_mediaquery_serialize_2");
-
-  </script>
- </body>
-</html>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/mediaquery-sort-dedup-expected.txt (0 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/mediaquery-sort-dedup-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/mediaquery-sort-dedup-expected.txt	2020-10-25 21:43:54 UTC (rev 268961)
@@ -0,0 +1,4 @@
+
+FAIL Media queries are not sorted lexicographically assert_equals: expected "(min-width: 10px) and (min-height: 10px)" but got "(min-height: 10px) and (min-width: 10px)"
+FAIL Media queries are not deduplicated assert_equals: expected "(color) and (color)" but got "(color)"
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/mediaquery-sort-dedup.html (0 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/mediaquery-sort-dedup.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/mediaquery-sort-dedup.html	2020-10-25 21:43:54 UTC (rev 268961)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSSOM test: Media query serialization quirks</title>
+<link rel="help" href=""
+<link rel="author" href="" title="Emilio Cobos Álvarez">
+<link rel="author" href="" title="Mozilla">
+<script src=""
+<script src=""
+<script>
+test(function() {
+  assert_equals(matchMedia("(min-width: 10px) and (min-height: 10px)").media, "(min-width: 10px) and (min-height: 10px)");
+} , "Media queries are not sorted lexicographically");
+test(function() {
+  assert_equals(matchMedia("(color) and (color)").media, "(color) and (color)");
+}, "Media queries are not deduplicated");
+</script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/removerule-invalidation-crash.html (0 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/removerule-invalidation-crash.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/removerule-invalidation-crash.html	2020-10-25 21:43:54 UTC (rev 268961)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset="UTF-8">
+<title>CSSOM - removeRule doesn't assert when removing a particular set of rules</title>
+<link rel="help" href=""
+<link rel="help" href=""
+<style>
+@media all {
+  * { color: red; }
+
+  #foobar { color: blue }
+}
+</style>
+<script>
+  document.documentElement.getBoundingClientRect();
+  document.styleSheets[0].deleteRule(0);
+</script>

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/rule-restrictions-expected.txt (0 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/rule-restrictions-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/rule-restrictions-expected.txt	2020-10-25 21:43:54 UTC (rev 268961)
@@ -0,0 +1,4 @@
+
+FAIL @page assert_equals: Transform doesn't quite apply to pages expected 1 but got 2
+FAIL @keyframe assert_equals: animation-name doesn't apply to keyframes expected 1 but got 2
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/rule-restrictions.html (0 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/rule-restrictions.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/rule-restrictions.html	2020-10-25 21:43:54 UTC (rev 268961)
@@ -0,0 +1,51 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>CSSOM Should correctly honor property restrictions</title>
+<link rel="author" title="Emilio Cobos Álvarez" href=""
+<link rel="author" title="Mozilla" href=""
+<link rel="help" href=""
+<link rel="help" href=""
+<link rel="help" href=""
+<script src=""
+<script src=""
+<style>
+  @page {
+    margin-top: 10px;
+    transform: scale(1);
+  }
+
+  @keyframes foo {
+    from {
+      margin-top: 10px;
+      animation-name: none;
+    }
+  }
+</style>
+<script>
+test(function() {
+  let rule = document.styleSheets[0].cssRules[0];
+  assert_equals(rule.type, CSSRule.PAGE_RULE, "Should be a page rule");
+  assert_equals(rule.style.length, 1, "Transform doesn't quite apply to pages");
+  assert_equals(rule.style.marginTop, "10px", "Should have a margin-top declaration");
+  rule.style.setProperty("transform", "scale(1)");
+  assert_equals(rule.style.getPropertyValue("transform"), "", "Shouldn't have been able to set the transform property via setProperty");
+  assert_equals(rule.style.length, 1, "Shouldn't have been able to set transform via setProperty");
+  rule.style.cssText = "margin-bottom: 10px; transform: scale(1);";
+  assert_equals(rule.style.length, 1, "Should not have been able to set transform via cssText");
+  assert_equals(rule.style.marginBottom, "10px", "Should have a margin-bottom declaration");
+}, "@page");
+
+test(function() {
+  let rule = document.styleSheets[0].cssRules[1].cssRules[0];
+  assert_equals(rule.type, CSSRule.KEYFRAME_RULE, "Should be a keyframe rule");
+  assert_equals(rule.style.length, 1, "animation-name doesn't apply to keyframes");
+  assert_equals(rule.style.marginTop, "10px", "Should have a margin-top declaration");
+  rule.style.setProperty("animation-name", "none");
+  assert_equals(rule.style.getPropertyValue("animation-name"), "", "Shouldn't have been able to set the animation-nameproperty via setProperty");
+  assert_equals(rule.style.length, 1, "Shouldn't have been able to set animation-name via setProperty");
+  rule.style.cssText = "margin-bottom: 10px; animation-name: none;";
+  assert_equals(rule.style.length, 1, "Should not have been able to set animation-name via cssText");
+  assert_equals(rule.style.marginBottom, "10px", "Should have a margin-bottom declaration");
+
+}, "@keyframe");
+</script>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/serialize-media-rule-expected.txt (268960 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/serialize-media-rule-expected.txt	2020-10-25 21:34:47 UTC (rev 268960)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/serialize-media-rule-expected.txt	2020-10-25 21:43:54 UTC (rev 268961)
@@ -7,7 +7,7 @@
 FAIL type - inclusion of negated all assert_equals: expected "@media not all and (color) {\n}" but got "@media not all and (color) { \n}"
 FAIL features - character case normalization assert_equals: expected "@media screen and (color) {\n}" but got "@media screen and (color) { \n}"
 FAIL features - preservation of overspecified features assert_equals: expected "@media print and (max-width: 23px) and (max-width: 45px) {\n}" but got "@media print and (max-width: 23px) and (max-width: 45px) { \n}"
-FAIL features - lexicographical sorting assert_equals: expected "@media screen and (color) and (max-width: 0px) {\n}" but got "@media screen and (color) and (max-width: 0px) { \n}"
+FAIL features - no lexicographical sorting assert_equals: expected "@media screen and (color) and (max-width: 0px) {\n}" but got "@media screen and (color) and (max-width: 0px) { \n}"
 FAIL media query list assert_equals: expected "@media screen and (max-width: 0px), screen and (color) {\n}" but got "@media screen and (max-width: 0px), screen and (color) { \n}"
 FAIL one rule assert_equals: expected "@media print {\n  #foo { z-index: 23; float: left; }\n}" but got "@media print { \n  #foo { z-index: 23; float: left; }\n}"
 FAIL many rules assert_equals: expected "@media print {\n  #bar { float: none; z-index: 45; }\n  #foo { z-index: 23; float: left; }\n}" but got "@media print { \n  #bar { float: none; z-index: 45; }\n  #foo { z-index: 23; float: left; }\n}"

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/serialize-media-rule.html (268960 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/serialize-media-rule.html	2020-10-25 21:34:47 UTC (rev 268960)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/serialize-media-rule.html	2020-10-25 21:43:54 UTC (rev 268961)
@@ -132,9 +132,9 @@
   );
   assert_equals(
     sheet.cssRules[1].cssText,
-    '@media screen and (color) and (max-width: 0px) {\n}'
+    '@media screen and (max-width: 0px) and (color) {\n}'
   );
-}, 'features - lexicographical sorting');
+}, 'features - no lexicographical sorting');
 
 test(function(t) {
   var sheet = makeSheet(t);

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/w3c-import.log (268960 => 268961)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/w3c-import.log	2020-10-25 21:34:47 UTC (rev 268960)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/cssom/w3c-import.log	2020-10-25 21:43:54 UTC (rev 268961)
@@ -15,7 +15,8 @@
 ------------------------------------------------------------------------
 List of files:
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSS-namespace-object-class-string.html
-/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSS.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSCounterStyleRule.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSFontFaceRule.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSGroupingRule-cssRules.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSGroupingRule-insertRule.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSKeyframeRule.html
@@ -104,6 +105,7 @@
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-logical-enumeration.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-property-order.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-pseudo.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-resolved-colors.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-resolved-min-max-clamping.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-sticky-pos-percent.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-width-scroll.tentative.html
@@ -121,11 +123,13 @@
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-dynamic-001.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-interfaces-001.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-interfaces-002.html
-/LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-interfaces-003.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-interfaces-004.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom/mediaquery-sort-dedup.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom/overflow-serialization.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom/preferred-stylesheet-order.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom/preferred-stylesheet-reversed-order.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom/removerule-invalidation-crash.html
+/LayoutTests/imported/w3c/web-platform-tests/css/cssom/rule-restrictions.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom/selectorSerialize.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom/selectorText-modification-restyle-001-expected.html
 /LayoutTests/imported/w3c/web-platform-tests/css/cssom/selectorText-modification-restyle-001.html

Modified: trunk/LayoutTests/tests-options.json (268960 => 268961)


--- trunk/LayoutTests/tests-options.json	2020-10-25 21:34:47 UTC (rev 268960)
+++ trunk/LayoutTests/tests-options.json	2020-10-25 21:43:54 UTC (rev 268961)
@@ -689,6 +689,9 @@
     "imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html": [
         "slow"
     ],
+    "imported/w3c/web-platform-tests/css/cssom/idlharness.html": [
+        "slow"
+    ],
     "imported/w3c/web-platform-tests/dom/events/Event-dispatch-on-disabled-elements.html": [
         "slow"
     ],
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to