Skip to content

Commit

Permalink
Align prefers-color-scheme:no-preference tests with spec.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Commit-Queue: Rune Lillesveen <[email protected]>
Cr-Commit-Position: refs/heads/master@{#775910}
  • Loading branch information
Rune Lillesveen authored and chromium-wpt-export-bot committed Jun 8, 2020
1 parent 0a89735 commit 16f0e25
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions css/mediaqueries/prefers-color-scheme.html
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 16f0e25

Please sign in to comment.