Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Commit ddd614b

Browse files
authored
Merge pull request #1161 from mrego/caret-color-resolved-value
[css-ui] Resolved value of caret-color should be the used value
2 parents eb50e24 + 984848a commit ddd614b

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

css-ui-3/caret-color-009.html

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,20 @@
55
<link rel="help" href="http://www.w3.org/TR/css3-ui/#caret-color">
66
<link rel="help" href="https://drafts.csswg.org/css-color-4/#currentcolor-color">
77
<meta name="flags" content="dom">
8-
<meta name="assert" content="Test checks that auto and currentcolor compute to themselves for caret-color and that initial computes to auto">
8+
<meta name="assert" content="Test checks that the resolved value of auto, currentcolor and initial for caret-color property, is the used value.">
99
<script src="/resources/testharness.js"></script>
1010
<script src="/resources/testharnessreport.js"></script>
1111
<style>
1212
#d1 {
13+
color: lime;
1314
caret-color: auto;
1415
}
1516
#d2 {
17+
color: cyan;
1618
caret-color: currentcolor;
1719
}
1820
#d3 {
21+
color: magenta;
1922
caret-color: initial;
2023
}
2124
</style>
@@ -29,18 +32,18 @@
2932
test(
3033
function(){
3134
var d1 = document.getElementById("d1");
32-
assert_equals(window.getComputedStyle(d1)["caret-color"], "auto");
33-
}, "The computed value of auto should be auto");
35+
assert_equals(window.getComputedStyle(d1)["caret-color"], "rgb(0, 255, 0)");
36+
}, "Check the resolved value of 'auto'");
3437
test(
3538
function(){
3639
var d2 = document.getElementById("d2");
37-
assert_equals(window.getComputedStyle(d2)["caret-color"], "currentcolor");
38-
}, "The computed value of currentcolor should be currentcolor");
40+
assert_equals(window.getComputedStyle(d2)["caret-color"], "rgb(0, 255, 255)");
41+
}, "Check the resolved value of 'currentcolor'");
3942
test(
4043
function(){
4144
var d3 = document.getElementById("d3");
42-
assert_equals(window.getComputedStyle(d3)["caret-color"], "auto");
43-
}, "The computed value of initial should be auto");
45+
assert_equals(window.getComputedStyle(d3)["caret-color"], "rgb(255, 0, 255)");
46+
}, "Check the resolved value of 'initial'");
4447
</script>
4548
</body>
4649
</html>

css-ui-3/caret-color-013.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@
3232
}
3333

3434
var textarea = document.getElementById("textarea");
35-
setAndCheckCaretColor(textarea, "", "", "auto", "Test default caret-color");
36-
setAndCheckCaretColor(textarea, "initial", "initial", "auto", "Test caret-color: initial");
37-
setAndCheckCaretColor(textarea, "inherit", "inherit", "auto", "Test caret-color: inherit");
38-
setAndCheckCaretColor(textarea, "auto", "auto", "auto", "Test caret-color: auto");
39-
setAndCheckCaretColor(textarea, "currentcolor", "currentcolor", "currentcolor", "Test caret-color: currentcolor");
35+
setAndCheckCaretColor(textarea, "", "", "rgb(0, 0, 0)", "Test default caret-color");
36+
setAndCheckCaretColor(textarea, "initial", "initial", "rgb(0, 0, 0)", "Test caret-color: initial");
37+
setAndCheckCaretColor(textarea, "inherit", "inherit", "rgb(0, 0, 0)", "Test caret-color: inherit");
38+
setAndCheckCaretColor(textarea, "auto", "auto", "rgb(0, 0, 0)", "Test caret-color: auto");
39+
setAndCheckCaretColor(textarea, "currentcolor", "currentcolor", "rgb(0, 0, 0)", "Test caret-color: currentcolor");
4040
setAndCheckCaretColor(textarea, "lime", "lime", "rgb(0, 255, 0)", "Test caret-color: lime");
41-
setAndCheckCaretColor(textarea, "initial", "initial", "auto", "Reset caret-color: initial");
41+
setAndCheckCaretColor(textarea, "initial", "initial", "rgb(0, 0, 0)", "Reset caret-color: initial");
4242
setAndCheckCaretColor(textarea, "rgb(0, 100, 100)", "rgb(0, 100, 100)", "rgb(0, 100, 100)", "Test caret-color: rgb(0, 100, 100)");
4343

4444
var wrapper = document.getElementById("wrapper");
4545
wrapper.style.caretColor = "green";
4646

47-
setAndCheckCaretColor(textarea, "initial", "initial", "auto", "Test caret-color: initial (inherited)");
47+
setAndCheckCaretColor(textarea, "initial", "initial", "rgb(0, 0, 0)", "Test caret-color: initial (inherited)");
4848
setAndCheckCaretColor(textarea, "inherit", "inherit", "rgb(0, 128, 0)", "Test caret-color: inherit (inherited)");
4949
setAndCheckCaretColor(textarea, "blue", "blue", "rgb(0, 0, 255)", "Test caret-color: blue (inherited)");
5050
</script>

0 commit comments

Comments
 (0)