-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Expand file tree
/
Copy pathforced-colors.html
More file actions
24 lines (21 loc) · 1.04 KB
/
forced-colors.html
File metadata and controls
24 lines (21 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<link rel="help" href="https://drafts.csswg.org/mediaqueries-5/#forced-colors" />
<script type="text/javascript" src="/resources/testharness.js"></script>
<script type="text/javascript" src="/resources/testharnessreport.js"></script>
<script type="text/javascript" src="resources/matchmedia-utils.js"></script>
<script>
query_should_be_known("(forced-colors)");
query_should_be_known("(forced-colors: none)");
query_should_be_known("(forced-colors: active)");
query_should_be_unknown("(forced-colors: 0)");
query_should_be_unknown("(forced-colors: no-preference)");
query_should_be_unknown("(forced-colors: 10px)");
query_should_be_unknown("(forced-colors: active 0)");
query_should_be_unknown("(forced-colors: none active)");
query_should_be_unknown("(forced-colors: active/none)");
test(() => {
let booleanContext = window.matchMedia("(forced-colors)");
let none = window.matchMedia("(forced-colors: none)");
assert_equals(booleanContext.matches, !none.matches);
}, "Check that none evaluates to false in the boolean context");
</script>