[go: nahoru, domu]

Skip to content

Commit

Permalink
Bug 1643934 [wpt PR 24024] - Align prefers-color-scheme:no-preference…
Browse files Browse the repository at this point in the history
… tests with spec., a=testonly

Automatic update from web-platform-tests
Align prefers-color-scheme:no-preference tests with spec.

The 'no-preference' value has been removed from the spec per resolution
in [1].

[1] w3c/csswg-drafts#3857 (comment)

Bug: 1091806
Change-Id: Id5fd41b93f14c7ee60d10aa4dae036558271c948
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2232924
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#775910}

--

wpt-commits: 16f0e250577490c6d7dcba06d818a3a806a667c0
wpt-pr: 24024
  • Loading branch information
Rune Lillesveen authored and moz-wptsync-bot committed Jun 12, 2020
1 parent 08311a9 commit 57f5180
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<script type="text/javascript" src="resources/matchmedia-utils.js"></script>
<script>
query_should_be_css_parseable("(prefers-color-scheme)");
query_should_be_css_parseable("(prefers-color-scheme: no-preference)");
query_should_be_css_parseable("(prefers-color-scheme: light)");
query_should_be_css_parseable("(prefers-color-scheme: dark)");

Expand All @@ -16,9 +15,9 @@
query_should_not_be_css_parseable("(prefers-color-scheme: dark 0)");
query_should_not_be_css_parseable("(prefers-color-scheme: dark light)");
query_should_not_be_css_parseable("(prefers-color-scheme: light/dark)");
query_should_not_be_css_parseable("(prefers-color-scheme: no-preference)");

query_should_be_js_parseable("(prefers-color-scheme)");
query_should_be_js_parseable("(prefers-color-scheme: no-preference)");
query_should_be_js_parseable("(prefers-color-scheme: light)");
query_should_be_js_parseable("(prefers-color-scheme: dark)");

Expand All @@ -28,10 +27,10 @@
query_should_not_be_js_parseable("(prefers-color-scheme: dark 0)");
query_should_not_be_js_parseable("(prefers-color-scheme: dark light)");
query_should_not_be_js_parseable("(prefers-color-scheme: light/dark)");
query_should_not_be_js_parseable("(prefers-color-scheme: no-preference)");

test(() => {
let booleanContext = window.matchMedia("(prefers-color-scheme)");
let noPreference = window.matchMedia("(prefers-color-scheme: no-preference)");
assert_equals(booleanContext.matches, !noPreference.matches);
}, "Check that no-preference evaluates to false in the boolean context");
assert_true(booleanContext.matches);
}, "Check that prefer-color-scheme evaluates to true in the boolean context");
</script>

0 comments on commit 57f5180

Please sign in to comment.