summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-ui/parsing/outline-color-computed.html
blob: c6631881b01de8299fa45c1db9048f62077fa0a9 (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
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS UI Level 3: getComputedStyle().outlineColor</title>
<link rel="help" href="https://drafts.csswg.org/css-ui-3/#outline-color">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/css/support/computed-testcommon.js"></script>
<style>
  #target {
    color: blue;
    outline-style: auto;
    outline-color: auto;
  }
  #target2 {
    color: blue;
    outline-style: solid;
    outline-color: auto;
  }
</style>
</head>
<body>
<div id="target"></div>
<div id="target2"></div>
<script>
'use strict';
const currentColor = "rgb(0, 0, 255)";
test_computed_value("outline-color", "currentColor", currentColor);
test_computed_value("outline-color", "red", "rgb(255, 0, 0)");

test(() => {
  const target = document.getElementById('target');
  const target2 = document.getElementById('target2');
  assert_equals(getComputedStyle(target).outlineColor, 'auto');
  assert_equals(getComputedStyle(target2).outlineColor, currentColor);
}, 'auto computes to itself or to currentColor depending on the value of outline-style');
</script>
</body>
</html>