| Differences between
and this patch
- a/LayoutTests/ChangeLog +9 lines
Lines 1-3 a/LayoutTests/ChangeLog_sec1
1
2020-10-25  Emilio Cobos Álvarez  <emilio@crisal.io>
2
3
        Update CSSOM WPT tests.
4
        https://bugs.webkit.org/show_bug.cgi?id=218157
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * tests-options.json:
9
1
2020-10-24  Jer Noble  <jer.noble@apple.com>
10
2020-10-24  Jer Noble  <jer.noble@apple.com>
2
11
3
        [BigSur] Appending a new WebM init segment between Cluster elements throws an error
12
        [BigSur] Appending a new WebM init segment between Cluster elements throws an error
- a/LayoutTests/imported/w3c/ChangeLog +33 lines
Lines 1-3 a/LayoutTests/imported/w3c/ChangeLog_sec1
1
2020-10-25  Emilio Cobos Álvarez  <emilio@crisal.io>
2
3
        Update CSSOM WPT tests.
4
        https://bugs.webkit.org/show_bug.cgi?id=218157
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * resources/resource-files.json:
9
        * web-platform-tests/css/cssom/CSS.html: Removed.
10
        * web-platform-tests/css/cssom/CSSCounterStyleRule-expected.txt: Added.
11
        * web-platform-tests/css/cssom/CSSCounterStyleRule.html: Added.
12
        * web-platform-tests/css/cssom/CSSFontFaceRule-expected.txt: Added.
13
        * web-platform-tests/css/cssom/CSSFontFaceRule.html: Added.
14
        * web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative-expected.txt:
15
        * web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html:
16
        * web-platform-tests/css/cssom/css-style-attr-decl-block.html:
17
        * web-platform-tests/css/cssom/cssimportrule.html:
18
        * web-platform-tests/css/cssom/escape.html:
19
        * web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
20
        * web-platform-tests/css/cssom/getComputedStyle-detached-subtree.html:
21
        * web-platform-tests/css/cssom/getComputedStyle-resolved-colors-expected.txt: Added.
22
        * web-platform-tests/css/cssom/getComputedStyle-resolved-colors.html: Added.
23
        * web-platform-tests/css/cssom/medialist-interfaces-003-expected.txt: Removed.
24
        * web-platform-tests/css/cssom/medialist-interfaces-003.html: Removed.
25
        * web-platform-tests/css/cssom/mediaquery-sort-dedup-expected.txt: Added.
26
        * web-platform-tests/css/cssom/mediaquery-sort-dedup.html: Added.
27
        * web-platform-tests/css/cssom/removerule-invalidation-crash.html: Added.
28
        * web-platform-tests/css/cssom/rule-restrictions-expected.txt: Added.
29
        * web-platform-tests/css/cssom/rule-restrictions.html: Added.
30
        * web-platform-tests/css/cssom/serialize-media-rule-expected.txt:
31
        * web-platform-tests/css/cssom/serialize-media-rule.html:
32
        * web-platform-tests/css/cssom/w3c-import.log:
33
1
2020-10-23  Diego Pino Garcia  <dpino@igalia.com>
34
2020-10-23  Diego Pino Garcia  <dpino@igalia.com>
2
35
3
        REGRESSION (r267402): [ iOS Mojave+ Release ] imported/w3c/web-platform-tests/user-timing/measure-l3.any.html is a flaky failure
36
        REGRESSION (r267402): [ iOS Mojave+ Release ] imported/w3c/web-platform-tests/user-timing/measure-l3.any.html is a flaky failure
- a/LayoutTests/imported/w3c/resources/resource-files.json +1 lines
Lines 783-788 a/LayoutTests/imported/w3c/resources/resource-files.json_sec1
783
        "web-platform-tests/css/css-writing-modes/vertical-alignment-vrl-018.xht",
783
        "web-platform-tests/css/css-writing-modes/vertical-alignment-vrl-018.xht",
784
        "web-platform-tests/css/css-writing-modes/vertical-alignment-vrl-020.xht",
784
        "web-platform-tests/css/css-writing-modes/vertical-alignment-vrl-020.xht",
785
        "web-platform-tests/css/cssom-view/iframe.html",
785
        "web-platform-tests/css/cssom-view/iframe.html",
786
        "web-platform-tests/css/cssom/removerule-invalidation-crash.html",
786
        "web-platform-tests/css/cssom/support/xmlss-pi.xhtml",
787
        "web-platform-tests/css/cssom/support/xmlss-pi.xhtml",
787
        "web-platform-tests/css/mediaqueries/media-queries-001.xht",
788
        "web-platform-tests/css/mediaqueries/media-queries-001.xht",
788
        "web-platform-tests/css/mediaqueries/media-queries-002.xht",
789
        "web-platform-tests/css/mediaqueries/media-queries-002.xht",
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSS.html -48 lines
Lines 1-48 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSS.html_sec1
1
<!doctype html>
2
<meta charset="utf-8">
3
<title>CSSOM - CSS interface</title>
4
<link rel="help" href="https://drafts.csswg.org/cssom/#the-css.escape()-method">
5
<script src="/resources/testharness.js"></script>
6
<script src="/resources/testharnessreport.js"></script>
7
<script>
8
    test(function () {
9
        // https://drafts.csswg.org/cssom/#dom-css-escape
10
        // https://drafts.csswg.org/cssom/#serialize-an-identifier
11
        assert_equals(CSS.escape("hello world"), "hello\\ world", "CSS.escape: spaces get escaped with backslashes");
12
        assert_equals(CSS.escape("hello\0world"), "hello\u{FFFD}world", "CSS.escape: NULL get replaced with U+FFFD REPLACEMENT CHARACTER");
13
        assert_equals(CSS.escape("hello0world"), "hello0world", "CSS.escape: Numbers within string preserved");
14
        assert_equals(CSS.escape("hello\x10world"), "hello\\10 world", "CSS.escape: Values between \\x01 and \\x1f are unicode escaped");
15
        assert_equals(CSS.escape("hello\\world"), "hello\\\\world", "CSS.escape: Backslashes get backslash-escaped");
16
        assert_equals(CSS.escape("hello\u{1234}world"), "hello\u{1234}world", "CSS.escape: Code points greater than U+0080 are preserved");
17
        assert_equals(CSS.escape("hello\x7Fworld"), "hello\\7f world", "CSS.escape: Some code points less than U+0080 are unicode-escaped");
18
        assert_equals(CSS.escape("-"), "\\-", "CSS.escape: Single dash escaped");
19
        assert_equals(CSS.escape("0foo"), "\\30 foo", "CSS.escape: Numbers at the beginning of an ident get unicode escaped");
20
        assert_equals(CSS.escape("-0foo"), "-\\30 foo", "CSS.escape: Numbers at the beginning of an ident after single hyphen get unicode escaped");
21
        assert_equals(CSS.escape("--0foo"), "--0foo", "CSS.escape: Numbers at the beginning of an ident after multiple hyphens do not get unicode escaped");
22
    }, "CSS.escape");
23
    test(function () {
24
        // https://drafts.csswg.org/css-conditional/#dom-css-supports
25
        // https://drafts.csswg.org/css-conditional/#typedef-supports-condition
26
        assert_equals(CSS.supports("color: red"), true, "CSS.supports: Single-argument form allows for declarations without enclosing parentheses");
27
        assert_equals(CSS.supports("(color: red) and (color: blue)"), true, "CSS.supports: Complex conditions allowed");
28
        assert_equals(CSS.supports("not (foobar)"), true, "CSS.supports: general_enclosed still parses");
29
        assert_equals(CSS.supports("color: something-pointless var(--foo)"), true, "Variable references always parse");
30
        assert_equals(CSS.supports("color: something-pointless(var(--foo))"), true, "Variable references in an unknown function always parse");
31
    }, "CSS.supports, one argument form");
32
    test(function () {
33
        // https://drafts.csswg.org/css-conditional/#dom-css-supports
34
        // https://drafts.csswg.org/css-conditional/#dfn-support
35
        assert_equals(CSS.supports("color", "red"), true, "CSS.supports: two argument form succeeds for known property");
36
        assert_equals(CSS.supports("unknownproperty", "blah"), false, "CSS.supports: two argument form fails for unknown property");
37
        assert_equals(CSS.supports("width", "blah"), false, "CSS.supports: two argument form fails for invalid value");
38
        assert_equals(CSS.supports("--foo", "blah"), true, "CSS.supports: two argument form succeeds for custom property");
39
    }, "CSS.supports, two argument form");
40
    test(function () {
41
        assert_equals(CSS.supports("selector(div)"), true, "CSS.supports: selector() function accepts a selector");
42
        assert_equals(CSS.supports("selector(div, div)"), false, "CSS.supports: selector() function doesn't accept a selector list");
43
        assert_equals(CSS.supports("selector(::-webkit-unknown-pseudo-element)"), false, "CSS.supports: selector() function rejects unknown webkit pseudo-elements.");
44
        assert_equals(CSS.supports("selector(::before)"), true, "CSS.supports: selector() function accepts known pseudo-elements");
45
        assert_equals(CSS.supports("selector(div + .c)"), true, "CSS.supports: selector() with simple combinators");
46
        assert_equals(CSS.supports("selector(div | .c)"), false, "CSS.supports: selector() with unknown combinators");
47
    }, "CSS.supports, selector function");
48
</script>
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSCounterStyleRule-expected.txt +3 lines
Line 0 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSCounterStyleRule-expected.txt_sec1
1
2
FAIL CSSCounterStyleRule.cssText doesn't serialize with newlines undefined is not an object (evaluating 'rule.cssText')
3
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSCounterStyleRule.html +21 lines
Line 0 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSCounterStyleRule.html_sec1
1
<!doctype html>
2
<meta charset="utf-8">
3
<title>CSSOM - CSSCounterStyleRule interface</title>
4
<link rel="help" href="https://drafts.csswg.org/css-counter-styles-3/#csscounterstylerule">
5
<script src="/resources/testharness.js"></script>
6
<script src="/resources/testharnessreport.js"></script>
7
<style>
8
  @counter-style foo {
9
    system: cyclic;
10
    symbols: ‣;
11
    suffix: " ";
12
  }
13
</style>
14
<script>
15
test(function() {
16
  // TODO: The exact serialization isn't well specified (the ordering of the
17
  // descriptors isn't defined).
18
  let rule = document.styleSheets[0].cssRules[0];
19
  assert_false(rule.cssText.includes('\n'));
20
}, "CSSCounterStyleRule.cssText doesn't serialize with newlines");
21
</script>
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSFontFaceRule-expected.txt +3 lines
Line 0 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSFontFaceRule-expected.txt_sec1
1
2
PASS CSSFontFaceRule.cssText doesn't serialize with newlines
3
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSFontFaceRule.html +21 lines
Line 0 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSFontFaceRule.html_sec1
1
<!doctype html>
2
<meta charset="utf-8">
3
<title>CSSOM -  CSSFontFaceRule interface</title>
4
<link rel="help" href="https://drafts.csswg.org/css-fonts-4/#cssfontfacerule">
5
<script src="/resources/testharness.js"></script>
6
<script src="/resources/testharnessreport.js"></script>
7
<style>
8
  @font-face {
9
    src: local("foo");
10
    font-family: foo;
11
    font-weight: bold;
12
  }
13
</style>
14
<script>
15
test(function() {
16
  // TODO: The exact serialization isn't consistent across browsers
17
  // (Firefox doesn't preserve ordering of the descriptors, WebKit/Blink does).
18
  let rule = document.styleSheets[0].cssRules[0];
19
  assert_false(rule.cssText.includes('\n'));
20
}, "CSSFontFaceRule.cssText doesn't serialize with newlines");
21
</script>
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative-expected.txt -11 / +1 lines
Lines 1-16 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative-expected.txt_sec1
1
CONSOLE MESSAGE: Unhandled Promise Rejection: TypeError: Illegal constructor
2
3
Harness Error (FAIL), message = Unhandled rejection: Illegal constructor
4
5
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
6
TIMEOUT @import rules should not trigger any loads. Test timed out
7
FAIL @import rules are not parsed in CSSStyleSheet.replace Illegal constructor
8
FAIL @import rules are not parsed in CSSStyleSheet.replaceSync Illegal constructor
9
10
Harness Error (FAIL), message = Unhandled rejection: Illegal constructor
11
1
12
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
2
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
13
TIMEOUT @import rules should not trigger any loads. Test timed out
3
FAIL @import rules should not trigger any loads. promise_test: Unhandled rejection with value: object "TypeError: Illegal constructor"
14
FAIL @import rules are not parsed in CSSStyleSheet.replace Illegal constructor
4
FAIL @import rules are not parsed in CSSStyleSheet.replace Illegal constructor
15
FAIL @import rules are not parsed in CSSStyleSheet.replaceSync Illegal constructor
5
FAIL @import rules are not parsed in CSSStyleSheet.replaceSync Illegal constructor
16
6
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html -9 / +11 lines
Lines 21-27 test(() => { a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html_sec1
21
  assert_throws_dom("SyntaxError", () => { (new CSSStyleSheet).insertRule(import_text) });
21
  assert_throws_dom("SyntaxError", () => { (new CSSStyleSheet).insertRule(import_text) });
22
}, 'Inserting an @import rule through insertRule on a constructed stylesheet throws an exception');
22
}, 'Inserting an @import rule through insertRule on a constructed stylesheet throws an exception');
23
23
24
async_test(async t => {
24
promise_test(async t => {
25
    const importUrl = "support/constructable-import.css";
25
    const importUrl = "support/constructable-import.css";
26
    const sheet = new CSSStyleSheet();
26
    const sheet = new CSSStyleSheet();
27
27
Lines 32-48 async_test(async t => { a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSStyleSheet-constructable-disallow-import.tentative.html_sec2
32
    const timeAfterImportsInvoked = performance.now();
32
    const timeAfterImportsInvoked = performance.now();
33
33
34
    let link = document.createElement("link");
34
    let link = document.createElement("link");
35
    t.add_cleanup(() => { link.remove(); });
35
    link.rel = "stylesheet";
36
    link.rel = "stylesheet";
36
    link.href = importUrl;
37
    link.href = importUrl;
37
38
38
    link.addEventListener("error", t.unreached_func("Load shouldn't fail"));
39
    await new Promise((resolve, reject) => {
39
    link.addEventListener("load", t.step_func_done(event => {
40
      link.addEventListener("load", resolve);
40
      let entries = window.performance.getEntriesByType('resource').filter(entry => entry.name.includes(importUrl));
41
      link.addEventListener("error", reject);
41
      assert_equals(entries.length, 1, "There should be only one entry for the import URL");
42
      document.body.appendChild(link);
42
      assert_greater_than_equal(entries[0].startTime, timeAfterImportsInvoked, "The entry's start time should be after all throws");
43
    });
43
      link.remove();
44
44
    }));
45
    let entries = window.performance.getEntriesByType('resource').filter(entry => entry.name.includes(importUrl));
45
    document.body.appendChild(link);
46
    assert_equals(entries.length, 1, "There should be only one entry for the import URL");
47
    assert_greater_than_equal(entries[0].startTime, timeAfterImportsInvoked, "The entry's start time should be after all throws");
46
}, "@import rules should not trigger any loads.")
48
}, "@import rules should not trigger any loads.")
47
49
48
promise_test(() => {
50
promise_test(() => {
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/css-style-attr-decl-block.html -1 / +1 lines
Lines 92-98 test(function() { a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/css-style-attr-decl-block.html_sec1
92
  observer.observe(elem, {attributes: true});
92
  observer.observe(elem, {attributes: true});
93
  function assert_no_record(action) {
93
  function assert_no_record(action) {
94
    let records = observer.takeRecords();
94
    let records = observer.takeRecords();
95
    assert_true(records.length == 0, "expect no record after " + action);
95
    assert_equals(records.length, 0, "expect no record after " + action);
96
  }
96
  }
97
  style.setProperty("z-index", "invalid");
97
  style.setProperty("z-index", "invalid");
98
  assert_no_record("setting invalid value to property");
98
  assert_no_record("setting invalid value to property");
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/cssimportrule.html -2 / +2 lines
Lines 95-102 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/cssimportrule.html_sec1
95
95
96
        test(function() {
96
        test(function() {
97
            var ruleWithPage = ruleList[3];
97
            var ruleWithPage = ruleList[3];
98
            ruleWithPage.style = "background-color: green;"
98
            ruleWithPage.style = "margin-top: 10px;"
99
            assert_equals(ruleWithPage.style.cssText, "background-color: green;");
99
            assert_equals(ruleWithPage.style.cssText, "margin-top: 10px;");
100
        }, "CSSStyleDeclaration cssText attribute should be updated due to [PutForwards]");
100
        }, "CSSStyleDeclaration cssText attribute should be updated due to [PutForwards]");
101
101
102
        test(function() {
102
        test(function() {
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/escape.html +4 lines
Lines 85-90 test(function() { a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/escape.html_sec1
85
  assert_equals(CSS.escape('abcdefghijklmnopqrstuvwxyz'), 'abcdefghijklmnopqrstuvwxyz');
85
  assert_equals(CSS.escape('abcdefghijklmnopqrstuvwxyz'), 'abcdefghijklmnopqrstuvwxyz');
86
  assert_equals(CSS.escape('ABCDEFGHIJKLMNOPQRSTUVWXYZ'), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');
86
  assert_equals(CSS.escape('ABCDEFGHIJKLMNOPQRSTUVWXYZ'), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');
87
87
88
  assert_equals(CSS.escape("hello\\world"), "hello\\\\world", "Backslashes get backslash-escaped");
89
  assert_equals(CSS.escape("hello\u{1234}world"), "hello\u{1234}world", "Code points greater than U+0080 are preserved");
90
  assert_equals(CSS.escape("-"), "\\-", "CSS.escape: Single dash escaped");
91
88
  assert_equals(CSS.escape('\x20\x21\x78\x79'), '\\ \\!xy');
92
  assert_equals(CSS.escape('\x20\x21\x78\x79'), '\\ \\!xy');
89
}, "Various tests");
93
}, "Various tests");
90
94
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-resolved-colors-expected.txt +15 lines
Line 0 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-resolved-colors-expected.txt_sec1
1
2
PASS The resolved value for 'background-color' is the used value
3
PASS The resolved value for 'border-block-end-color' is the used value
4
PASS The resolved value for 'border-block-start-color' is the used value
5
PASS The resolved value for 'border-bottom-color' is the used value
6
PASS The resolved value for 'border-inline-end-color' is the used value
7
PASS The resolved value for 'border-inline-start-color' is the used value
8
PASS The resolved value for 'border-left-color' is the used value
9
PASS The resolved value for 'border-right-color' is the used value
10
PASS The resolved value for 'border-top-color' is the used value
11
PASS The resolved value for 'box-shadow' is the used value
12
PASS The resolved value for 'caret-color' is the used value
13
PASS The resolved value for 'color' is the used value
14
PASS The resolved value for 'outline-color' is the used value
15
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-resolved-colors.html +42 lines
Line 0 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-resolved-colors.html_sec1
1
<!doctype html>
2
<meta charset="utf-8">
3
<title>CSSOM: resolved values of certain color properties are used values</title>
4
<link rel="help" href="https://drafts.csswg.org/cssom/#resolved-value">
5
<script src="/resources/testharness.js"></script>
6
<script src="/resources/testharnessreport.js"></script>
7
<style>
8
  #target {
9
    background-color: Menu;
10
    border: 1px solid Menu;
11
    box-shadow: 1px 1px Menu;
12
    caret-color: Menu;
13
    color: Menu;
14
    outline-color: Menu;
15
  }
16
</style>
17
<div id="target"></div>
18
<script>
19
  const properties_to_test = [
20
    "background-color",
21
    "border-block-end-color",
22
    "border-block-start-color",
23
    "border-bottom-color",
24
    "border-inline-end-color",
25
    "border-inline-start-color",
26
    "border-left-color",
27
    "border-right-color",
28
    "border-top-color",
29
    "box-shadow",
30
    "caret-color",
31
    "color",
32
    "outline-color",
33
  ];
34
35
  for (const property of properties_to_test) {
36
    test(function() {
37
      let resolved_value =
38
        window.getComputedStyle(document.getElementById("target")).getPropertyValue(property);
39
      assert_regexp_match(resolved_value, /^rgb[a]?\(/);
40
    }, "The resolved value for '" + property + "' is the used value");
41
  }
42
</script>
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-interfaces-003-expected.txt -4 lines
Lines 1-4 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-interfaces-003-expected.txt_sec1
1
2
PASS mediatest_mediaquery_serialize_1
3
PASS mediatest_mediaquery_serialize_2
4
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-interfaces-003.html -61 lines
Lines 1-61 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-interfaces-003.html_sec1
1
<!DOCTYPE html>
2
<html>
3
 <head>
4
  <title>CSS Test: CSSOM Media Query Serialization</title>
5
  <link rel="author" title="Ben Sheldon" href="mailto:ben@codeforamerica.org">
6
  <link rel="author" title="Chapman Shoop" href="mailto:chapman.shoop@gmail.com">
7
  <link rel="help" href="http://www.w3.org/TR/cssom-1/#serializing-media-queries">
8
  <meta name="flags" content="dom">
9
  <meta name="assert" content="Media Queries are serialized according to the specification">
10
  <script src="/resources/testharness.js" type="text/javascript"></script>
11
  <script src="/resources/testharnessreport.js" type="text/javascript"></script>
12
 </head>
13
 <body>
14
  <noscript>Test not run - javascript required.</noscript>
15
  <div id="log"></div>
16
  <script type="text/javascript">
17
18
    var styleElement;
19
    var styleSheet;
20
    var mediaList;
21
22
    // Setup - accepts media value for style element, e.g. <style media=???">
23
    function setupMedia(media) {
24
      styleElement = document.getElementById("styleElement");
25
26
      if (styleElement) {
27
        // teardown
28
        document.getElementsByTagName("head")[0].removeChild(styleElement);
29
        styleElement = undefined;
30
        styleSheet = undefined;
31
        mediaList = undefined;
32
      }
33
34
      styleElement = document.createElement("style");
35
      styleElement.id = "styleElement";
36
      styleElement.type = "text/css";
37
      styleElement.media = media;
38
      document.getElementsByTagName("head")[0].appendChild(styleElement);
39
      styleSheet = styleElement.sheet;
40
      mediaList = styleSheet.media;
41
    }
42
43
    // First explicit example input (first column) and output (second column) in specification.
44
    test(function() {
45
        setupMedia('not screen and (min-WIDTH:5px) AND (max-width:40px )');
46
47
        assert_equals(mediaList.mediaText, "not screen and (max-width: 40px) and (min-width: 5px)");
48
49
    }, "mediatest_mediaquery_serialize_1");
50
51
    // Second explicit example input (first column) and output (second column) in specification.
52
    test(function() {
53
        setupMedia('all and (color) and (color)	');
54
55
        assert_equals(mediaList.mediaText, "(color)");
56
57
    }, "mediatest_mediaquery_serialize_2");
58
59
  </script>
60
 </body>
61
</html>
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/mediaquery-sort-dedup-expected.txt +4 lines
Line 0 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/mediaquery-sort-dedup-expected.txt_sec1
1
2
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)"
3
FAIL Media queries are not deduplicated assert_equals: expected "(color) and (color)" but got "(color)"
4
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/mediaquery-sort-dedup.html +16 lines
Line 0 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/mediaquery-sort-dedup.html_sec1
1
<!DOCTYPE html>
2
<meta charset="utf-8">
3
<title>CSSOM test: Media query serialization quirks</title>
4
<link rel="help" href="https://drafts.csswg.org/cssom/#serializing-media-queries">
5
<link rel="author" href="mailto:emilio@crisal.io" title="Emilio Cobos Álvarez">
6
<link rel="author" href="https://mozilla.org" title="Mozilla">
7
<script src="/resources/testharness.js"></script>
8
<script src="/resources/testharnessreport.js"></script>
9
<script>
10
test(function() {
11
  assert_equals(matchMedia("(min-width: 10px) and (min-height: 10px)").media, "(min-width: 10px) and (min-height: 10px)");
12
} , "Media queries are not sorted lexicographically");
13
test(function() {
14
  assert_equals(matchMedia("(color) and (color)").media, "(color) and (color)");
15
}, "Media queries are not deduplicated");
16
</script>
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/removerule-invalidation-crash.html +16 lines
Line 0 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/removerule-invalidation-crash.html_sec1
1
<!DOCTYPE html>
2
<meta charset="UTF-8">
3
<title>CSSOM - removeRule doesn't assert when removing a particular set of rules</title>
4
<link rel="help" href="https://drafts.csswg.org/cssom/#cssstylesheet">
5
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1659718">
6
<style>
7
@media all {
8
  * { color: red; }
9
10
  #foobar { color: blue }
11
}
12
</style>
13
<script>
14
  document.documentElement.getBoundingClientRect();
15
  document.styleSheets[0].deleteRule(0);
16
</script>
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/rule-restrictions-expected.txt +4 lines
Line 0 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/rule-restrictions-expected.txt_sec1
1
2
FAIL @page assert_equals: Transform doesn't quite apply to pages expected 1 but got 2
3
FAIL @keyframe assert_equals: animation-name doesn't apply to keyframes expected 1 but got 2
4
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/rule-restrictions.html +51 lines
Line 0 a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/rule-restrictions.html_sec1
1
<!doctype html>
2
<meta charset="utf-8">
3
<title>CSSOM Should correctly honor property restrictions</title>
4
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
5
<link rel="author" title="Mozilla" href="https://mozilla.org">
6
<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1665816">
7
<link rel="help" href="https://drafts.csswg.org/css-page-3/#conform-partial">
8
<link rel="help" href="https://drafts.csswg.org/css-animations/#keyframes">
9
<script src="/resources/testharness.js"></script>
10
<script src="/resources/testharnessreport.js"></script>
11
<style>
12
  @page {
13
    margin-top: 10px;
14
    transform: scale(1);
15
  }
16
17
  @keyframes foo {
18
    from {
19
      margin-top: 10px;
20
      animation-name: none;
21
    }
22
  }
23
</style>
24
<script>
25
test(function() {
26
  let rule = document.styleSheets[0].cssRules[0];
27
  assert_equals(rule.type, CSSRule.PAGE_RULE, "Should be a page rule");
28
  assert_equals(rule.style.length, 1, "Transform doesn't quite apply to pages");
29
  assert_equals(rule.style.marginTop, "10px", "Should have a margin-top declaration");
30
  rule.style.setProperty("transform", "scale(1)");
31
  assert_equals(rule.style.getPropertyValue("transform"), "", "Shouldn't have been able to set the transform property via setProperty");
32
  assert_equals(rule.style.length, 1, "Shouldn't have been able to set transform via setProperty");
33
  rule.style.cssText = "margin-bottom: 10px; transform: scale(1);";
34
  assert_equals(rule.style.length, 1, "Should not have been able to set transform via cssText");
35
  assert_equals(rule.style.marginBottom, "10px", "Should have a margin-bottom declaration");
36
}, "@page");
37
38
test(function() {
39
  let rule = document.styleSheets[0].cssRules[1].cssRules[0];
40
  assert_equals(rule.type, CSSRule.KEYFRAME_RULE, "Should be a keyframe rule");
41
  assert_equals(rule.style.length, 1, "animation-name doesn't apply to keyframes");
42
  assert_equals(rule.style.marginTop, "10px", "Should have a margin-top declaration");
43
  rule.style.setProperty("animation-name", "none");
44
  assert_equals(rule.style.getPropertyValue("animation-name"), "", "Shouldn't have been able to set the animation-nameproperty via setProperty");
45
  assert_equals(rule.style.length, 1, "Shouldn't have been able to set animation-name via setProperty");
46
  rule.style.cssText = "margin-bottom: 10px; animation-name: none;";
47
  assert_equals(rule.style.length, 1, "Should not have been able to set animation-name via cssText");
48
  assert_equals(rule.style.marginBottom, "10px", "Should have a margin-bottom declaration");
49
50
}, "@keyframe");
51
</script>
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/serialize-media-rule-expected.txt -1 / +1 lines
Lines 7-13 FAIL type - omission of all assert_equals: expected "@media (color) {\n}" but go a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/serialize-media-rule-expected.txt_sec1
7
FAIL type - inclusion of negated all assert_equals: expected "@media not all and (color) {\n}" but got "@media not all and (color) { \n}"
7
FAIL type - inclusion of negated all assert_equals: expected "@media not all and (color) {\n}" but got "@media not all and (color) { \n}"
8
FAIL features - character case normalization assert_equals: expected "@media screen and (color) {\n}" but got "@media screen and (color) { \n}"
8
FAIL features - character case normalization assert_equals: expected "@media screen and (color) {\n}" but got "@media screen and (color) { \n}"
9
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}"
9
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}"
10
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}"
10
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}"
11
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}"
11
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}"
12
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}"
12
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}"
13
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}"
13
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}"
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/serialize-media-rule.html -2 / +2 lines
Lines 132-140 test(function(t) { a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/serialize-media-rule.html_sec1
132
  );
132
  );
133
  assert_equals(
133
  assert_equals(
134
    sheet.cssRules[1].cssText,
134
    sheet.cssRules[1].cssText,
135
    '@media screen and (color) and (max-width: 0px) {\n}'
135
    '@media screen and (max-width: 0px) and (color) {\n}'
136
  );
136
  );
137
}, 'features - lexicographical sorting');
137
}, 'features - no lexicographical sorting');
138
138
139
test(function(t) {
139
test(function(t) {
140
  var sheet = makeSheet(t);
140
  var sheet = makeSheet(t);
- a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/w3c-import.log -2 / +6 lines
Lines 15-21 None a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/w3c-import.log_sec1
15
------------------------------------------------------------------------
15
------------------------------------------------------------------------
16
List of files:
16
List of files:
17
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSS-namespace-object-class-string.html
17
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSS-namespace-object-class-string.html
18
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSS.html
18
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSCounterStyleRule.html
19
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSFontFaceRule.html
19
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSGroupingRule-cssRules.html
20
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSGroupingRule-cssRules.html
20
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSGroupingRule-insertRule.html
21
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSGroupingRule-insertRule.html
21
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSKeyframeRule.html
22
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/CSSKeyframeRule.html
Lines 104-109 List of files: a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/w3c-import.log_sec2
104
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-logical-enumeration.html
105
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-logical-enumeration.html
105
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-property-order.html
106
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-property-order.html
106
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-pseudo.html
107
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-pseudo.html
108
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-resolved-colors.html
107
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-resolved-min-max-clamping.html
109
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-resolved-min-max-clamping.html
108
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-sticky-pos-percent.html
110
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-sticky-pos-percent.html
109
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-width-scroll.tentative.html
111
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-width-scroll.tentative.html
Lines 121-131 List of files: a/LayoutTests/imported/w3c/web-platform-tests/css/cssom/w3c-import.log_sec3
121
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-dynamic-001.html
123
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-dynamic-001.html
122
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-interfaces-001.html
124
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-interfaces-001.html
123
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-interfaces-002.html
125
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-interfaces-002.html
124
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-interfaces-003.html
125
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-interfaces-004.html
126
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/medialist-interfaces-004.html
127
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/mediaquery-sort-dedup.html
126
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/overflow-serialization.html
128
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/overflow-serialization.html
127
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/preferred-stylesheet-order.html
129
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/preferred-stylesheet-order.html
128
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/preferred-stylesheet-reversed-order.html
130
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/preferred-stylesheet-reversed-order.html
131
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/removerule-invalidation-crash.html
132
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/rule-restrictions.html
129
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/selectorSerialize.html
133
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/selectorSerialize.html
130
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/selectorText-modification-restyle-001-expected.html
134
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/selectorText-modification-restyle-001-expected.html
131
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/selectorText-modification-restyle-001.html
135
/LayoutTests/imported/w3c/web-platform-tests/css/cssom/selectorText-modification-restyle-001.html
- a/LayoutTests/tests-options.json +3 lines
Lines 689-694 a/LayoutTests/tests-options.json_sec1
689
    "imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html": [
689
    "imported/w3c/web-platform-tests/css/cssom-view/scroll-behavior-subframe-window.html": [
690
        "slow"
690
        "slow"
691
    ],
691
    ],
692
    "imported/w3c/web-platform-tests/css/cssom/idlharness.html": [
693
        "slow"
694
    ],
692
    "imported/w3c/web-platform-tests/dom/events/Event-dispatch-on-disabled-elements.html": [
695
    "imported/w3c/web-platform-tests/dom/events/Event-dispatch-on-disabled-elements.html": [
693
        "slow"
696
        "slow"
694
    ],
697
    ],

Return to Bug 218157