summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/forced-colors-mode/forced-colors-mode-50.html
blob: 42957248b4efd08eb8a3c25d24610090859cb20c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<meta charset="utf-8">
<title>Forced colors mode - accent-color.</title>
<link rel="help" href="https://www.w3.org/TR/css-color-adjust-1/#forced-colors-properties">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
  #a, #b {
    accent-color: green;
  }
  #a, #c {
    forced-color-adjust: none;
  }
  #c, #d {
    accent-color: CanvasText;
  }
</style>
<input type="checkbox" id="a" checked>
<input type="checkbox" id="b" checked>
<input type="checkbox" id="c" checked>
<input type="checkbox" id="d" checked>
<script>
  test(function(){
    assert_equals(getComputedStyle(a).accentColor, "rgb(0, 128, 0)");
    assert_equals(getComputedStyle(b).accentColor, "auto");
    assert_equals(getComputedStyle(c).accentColor, getComputedStyle(d).accentColor)
  }, "Accent-color computes to auto in forced colors mode, unless forced-color-adjust is none or accent-color is a system color.");
</script>