Skip to content

Commit

Permalink
[css-ui] Resolved value of caret-color should be the used value
Browse files Browse the repository at this point in the history
As discussed on issue w3c/csswg-drafts#781, I'm updating the tests
so that caret-color behaves similar to the rest of color properties.

Build from revision 5b3a864679e8b965513bd285487b7af640fb3f30
  • Loading branch information
CssBuildBot committed Jan 4, 2017
1 parent 9788742 commit e286d7b
Show file tree
Hide file tree
Showing 25 changed files with 121 additions and 103 deletions.
14 changes: 7 additions & 7 deletions css-color-3_dev/html4/caret-color-013.htm
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@
}

var textarea = document.getElementById("textarea");
setAndCheckCaretColor(textarea, "", "", "auto", "Test default caret-color");
setAndCheckCaretColor(textarea, "initial", "initial", "auto", "Test caret-color: initial");
setAndCheckCaretColor(textarea, "inherit", "inherit", "auto", "Test caret-color: inherit");
setAndCheckCaretColor(textarea, "auto", "auto", "auto", "Test caret-color: auto");
setAndCheckCaretColor(textarea, "currentcolor", "currentcolor", "currentcolor", "Test caret-color: currentcolor");
setAndCheckCaretColor(textarea, "", "", "rgb(0, 0, 0)", "Test default caret-color");
setAndCheckCaretColor(textarea, "initial", "initial", "rgb(0, 0, 0)", "Test caret-color: initial");
setAndCheckCaretColor(textarea, "inherit", "inherit", "rgb(0, 0, 0)", "Test caret-color: inherit");
setAndCheckCaretColor(textarea, "auto", "auto", "rgb(0, 0, 0)", "Test caret-color: auto");
setAndCheckCaretColor(textarea, "currentcolor", "currentcolor", "rgb(0, 0, 0)", "Test caret-color: currentcolor");
setAndCheckCaretColor(textarea, "lime", "lime", "rgb(0, 255, 0)", "Test caret-color: lime");
setAndCheckCaretColor(textarea, "initial", "initial", "auto", "Reset caret-color: initial");
setAndCheckCaretColor(textarea, "initial", "initial", "rgb(0, 0, 0)", "Reset caret-color: initial");
setAndCheckCaretColor(textarea, "rgb(0, 100, 100)", "rgb(0, 100, 100)", "rgb(0, 100, 100)", "Test caret-color: rgb(0, 100, 100)");

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

setAndCheckCaretColor(textarea, "initial", "initial", "auto", "Test caret-color: initial (inherited)");
setAndCheckCaretColor(textarea, "initial", "initial", "rgb(0, 0, 0)", "Test caret-color: initial (inherited)");
setAndCheckCaretColor(textarea, "inherit", "inherit", "rgb(0, 128, 0)", "Test caret-color: inherit (inherited)");
setAndCheckCaretColor(textarea, "blue", "blue", "rgb(0, 0, 255)", "Test caret-color: blue (inherited)");
</script>
Expand Down
4 changes: 2 additions & 2 deletions css-color-3_dev/implementation-report-TEMPLATE.data
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# http://test.csswg.org/suites/css-color-3_dev/DATESTAMP/
# See http://wiki.csswg.org/test/implementation-report for instructions
testname revision result comment
html4/caret-color-013.htm 9d819d02f818d6dd752192ff7136ce1ca2fa2bc6 ?
xhtml1/caret-color-013.xht 9d819d02f818d6dd752192ff7136ce1ca2fa2bc6 ?
html4/caret-color-013.htm 0e52cf5be9ac07172ba7be4d7feae0446c2156ee ?
xhtml1/caret-color-013.xht 0e52cf5be9ac07172ba7be4d7feae0446c2156ee ?
html4/caret-color-016.htm 4d7ff9d4e4f8f12da4c2a6242ea91c22b8304d95 ?
xhtml1/caret-color-016.xht 4d7ff9d4e4f8f12da4c2a6242ea91c22b8304d95 ?
html4/caret-color-018.htm 2b42067b6dbf7c555d46c69f305f3fd7bd42876f ?
Expand Down
2 changes: 1 addition & 1 deletion css-color-3_dev/testinfo.data
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
id references title flags links revision credits assertion
caret-color-013 caret-color dynamic changes dom,script http://www.w3.org/TR/css3-ui/#caret-color,https://www.w3.org/TR/css3-color/#color0 9d819d02f818d6dd752192ff7136ce1ca2fa2bc6 `Manuel Rego Casasnovas`<mailto:rego@igalia.com> Test checks checks that carret-color can be correctly changed using the style attribute, and that the computed value is done correctly.
caret-color-013 caret-color dynamic changes dom,script http://www.w3.org/TR/css3-ui/#caret-color,https://www.w3.org/TR/css3-color/#color0 0e52cf5be9ac07172ba7be4d7feae0446c2156ee `Manuel Rego Casasnovas`<mailto:rego@igalia.com> Test checks checks that carret-color can be correctly changed using the style attribute, and that the computed value is done correctly.
caret-color-016 caret-color visited link computed value interact,may,script http://www.w3.org/TR/css3-ui/#caret-color,https://www.w3.org/TR/css3-color/#color0,https://www.w3.org/TR/selectors4/#link 4d7ff9d4e4f8f12da4c2a6242ea91c22b8304d95 `Manuel Rego Casasnovas`<mailto:rego@igalia.com> Test checks that computed style of caret-color on visited links doesn't leak privacy information.
caret-color-018 caret-color test animation script http://www.w3.org/TR/css3-ui/#caret-color,https://www.w3.org/TR/web-animations-1/#dom-animatable-animate,https://www.w3.org/TR/css3-color/#color0 2b42067b6dbf7c555d46c69f305f3fd7bd42876f `Manuel Rego Casasnovas`<mailto:rego@igalia.com> Test checks that caret-color is animatable as a color, and that the computed values during the animation are the expected ones.
t31-color-currentColor-b reference/t31-color-currentColor-b-ref color http://www.w3.org/TR/css3-color/#foreground,http://www.w3.org/TR/css3-color/#currentcolor 4dde926ad6a739b59385977b3d01c5676854e069 `L. David Baron`<https://dbaron.org/>,`Mozilla Corporation`<http://mozilla.com/> That currentColor on the color property acts like inherit.
Expand Down
14 changes: 7 additions & 7 deletions css-color-3_dev/xhtml1/caret-color-013.xht
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@
}

var textarea = document.getElementById("textarea");
setAndCheckCaretColor(textarea, "", "", "auto", "Test default caret-color");
setAndCheckCaretColor(textarea, "initial", "initial", "auto", "Test caret-color: initial");
setAndCheckCaretColor(textarea, "inherit", "inherit", "auto", "Test caret-color: inherit");
setAndCheckCaretColor(textarea, "auto", "auto", "auto", "Test caret-color: auto");
setAndCheckCaretColor(textarea, "currentcolor", "currentcolor", "currentcolor", "Test caret-color: currentcolor");
setAndCheckCaretColor(textarea, "", "", "rgb(0, 0, 0)", "Test default caret-color");
setAndCheckCaretColor(textarea, "initial", "initial", "rgb(0, 0, 0)", "Test caret-color: initial");
setAndCheckCaretColor(textarea, "inherit", "inherit", "rgb(0, 0, 0)", "Test caret-color: inherit");
setAndCheckCaretColor(textarea, "auto", "auto", "rgb(0, 0, 0)", "Test caret-color: auto");
setAndCheckCaretColor(textarea, "currentcolor", "currentcolor", "rgb(0, 0, 0)", "Test caret-color: currentcolor");
setAndCheckCaretColor(textarea, "lime", "lime", "rgb(0, 255, 0)", "Test caret-color: lime");
setAndCheckCaretColor(textarea, "initial", "initial", "auto", "Reset caret-color: initial");
setAndCheckCaretColor(textarea, "initial", "initial", "rgb(0, 0, 0)", "Reset caret-color: initial");
setAndCheckCaretColor(textarea, "rgb(0, 100, 100)", "rgb(0, 100, 100)", "rgb(0, 100, 100)", "Test caret-color: rgb(0, 100, 100)");

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

setAndCheckCaretColor(textarea, "initial", "initial", "auto", "Test caret-color: initial (inherited)");
setAndCheckCaretColor(textarea, "initial", "initial", "rgb(0, 0, 0)", "Test caret-color: initial (inherited)");
setAndCheckCaretColor(textarea, "inherit", "inherit", "rgb(0, 128, 0)", "Test caret-color: inherit (inherited)");
setAndCheckCaretColor(textarea, "blue", "blue", "rgb(0, 0, 255)", "Test caret-color: blue (inherited)");
</script>
Expand Down
14 changes: 7 additions & 7 deletions css-color-3_dev/xhtml1print/caret-color-013.xht
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@
}

var textarea = document.getElementById("textarea");
setAndCheckCaretColor(textarea, "", "", "auto", "Test default caret-color");
setAndCheckCaretColor(textarea, "initial", "initial", "auto", "Test caret-color: initial");
setAndCheckCaretColor(textarea, "inherit", "inherit", "auto", "Test caret-color: inherit");
setAndCheckCaretColor(textarea, "auto", "auto", "auto", "Test caret-color: auto");
setAndCheckCaretColor(textarea, "currentcolor", "currentcolor", "currentcolor", "Test caret-color: currentcolor");
setAndCheckCaretColor(textarea, "", "", "rgb(0, 0, 0)", "Test default caret-color");
setAndCheckCaretColor(textarea, "initial", "initial", "rgb(0, 0, 0)", "Test caret-color: initial");
setAndCheckCaretColor(textarea, "inherit", "inherit", "rgb(0, 0, 0)", "Test caret-color: inherit");
setAndCheckCaretColor(textarea, "auto", "auto", "rgb(0, 0, 0)", "Test caret-color: auto");
setAndCheckCaretColor(textarea, "currentcolor", "currentcolor", "rgb(0, 0, 0)", "Test caret-color: currentcolor");
setAndCheckCaretColor(textarea, "lime", "lime", "rgb(0, 255, 0)", "Test caret-color: lime");
setAndCheckCaretColor(textarea, "initial", "initial", "auto", "Reset caret-color: initial");
setAndCheckCaretColor(textarea, "initial", "initial", "rgb(0, 0, 0)", "Reset caret-color: initial");
setAndCheckCaretColor(textarea, "rgb(0, 100, 100)", "rgb(0, 100, 100)", "rgb(0, 100, 100)", "Test caret-color: rgb(0, 100, 100)");

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

setAndCheckCaretColor(textarea, "initial", "initial", "auto", "Test caret-color: initial (inherited)");
setAndCheckCaretColor(textarea, "initial", "initial", "rgb(0, 0, 0)", "Test caret-color: initial (inherited)");
setAndCheckCaretColor(textarea, "inherit", "inherit", "rgb(0, 128, 0)", "Test caret-color: inherit (inherited)");
setAndCheckCaretColor(textarea, "blue", "blue", "rgb(0, 0, 255)", "Test caret-color: blue (inherited)");
</script>
Expand Down
17 changes: 10 additions & 7 deletions css-color-4_dev/html/caret-color-009.htm
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@
<link href="http://www.w3.org/TR/css3-ui/#caret-color" rel="help">
<link href="https://drafts.csswg.org/css-color-4/#currentcolor-color" rel="help">
<meta content="dom" name="flags">
<meta content="Test checks that auto and currentcolor compute to themselves for caret-color and that initial computes to auto" name="assert">
<meta content="Test checks that the resolved value of auto, currentcolor and initial for caret-color property, is the used value." name="assert">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#d1 {
color: lime;
caret-color: auto;
}
#d2 {
color: cyan;
caret-color: currentcolor;
}
#d3 {
color: magenta;
caret-color: initial;
}
</style>
Expand All @@ -29,18 +32,18 @@
test(
function(){
var d1 = document.getElementById("d1");
assert_equals(window.getComputedStyle(d1)["caret-color"], "auto");
}, "The computed value of auto should be auto");
assert_equals(window.getComputedStyle(d1)["caret-color"], "rgb(0, 255, 0)");
}, "Check the resolved value of 'auto'");
test(
function(){
var d2 = document.getElementById("d2");
assert_equals(window.getComputedStyle(d2)["caret-color"], "currentcolor");
}, "The computed value of currentcolor should be currentcolor");
assert_equals(window.getComputedStyle(d2)["caret-color"], "rgb(0, 255, 255)");
}, "Check the resolved value of 'currentcolor'");
test(
function(){
var d3 = document.getElementById("d3");
assert_equals(window.getComputedStyle(d3)["caret-color"], "auto");
}, "The computed value of initial should be auto");
assert_equals(window.getComputedStyle(d3)["caret-color"], "rgb(255, 0, 255)");
}, "Check the resolved value of 'initial'");
</script>


Expand Down
2 changes: 1 addition & 1 deletion css-color-4_dev/html/chapter-5.htm
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ <h2>Named Colors (6 tests)</h2>
<td><abbr class="dom" title="Requires Document Object Model support">DOM/JS</abbr><abbr class="script" title="Executes tests in script">Script</abbr></td>
<td>caret-color computed values
<ul class="assert">
<li>Test checks that auto and currentcolor compute to themselves for caret-color and that initial computes to auto</li>
<li>Test checks that the resolved value of auto, currentcolor and initial for caret-color property, is the used value.</li>
</ul>
</td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions css-color-4_dev/implementation-report-TEMPLATE.data
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ html/border-top-color.htm 36dd8fc359f31235f9b475f3ee72d224e013d988 ?
xhtml1/border-top-color.xht 36dd8fc359f31235f9b475f3ee72d224e013d988 ?
html/caret-color-007.htm adf2d7c68b94cd989f66054829398a4645768204 ?
xhtml1/caret-color-007.xht adf2d7c68b94cd989f66054829398a4645768204 ?
html/caret-color-009.htm de98bbd248400ce59cb26c48dcebf717d83852d7 ?
xhtml1/caret-color-009.xht de98bbd248400ce59cb26c48dcebf717d83852d7 ?
html/caret-color-009.htm 5cf99f4d75a5c16334cf11c5424ab533f1a568a1 ?
xhtml1/caret-color-009.xht 5cf99f4d75a5c16334cf11c5424ab533f1a568a1 ?
html/color-001.htm 2d4cc48f3fd2db3f4763e93e20b22efab2dbcc94 ?
xhtml1/color-001.xht 2d4cc48f3fd2db3f4763e93e20b22efab2dbcc94 ?
html/color-002.htm 590ce67fac62516559c06fa26086af436d398819 ?
Expand Down
2 changes: 1 addition & 1 deletion css-color-4_dev/testinfo.data
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ border-left-color reference/border-color-ref Border-left-color set to hex with t
border-right-color reference/border-color-ref Border-right-color set to hex with three digits with the maximum plus one value of #1000 https://drafts.csswg.org/css-color-4/#hex-notation 4baa69dd17c4593022e00b394eecd9b2b8cf78b5 `Microsoft`<http://www.microsoft.com/>,`Jack Moffitt`<http://metajack.im/>,`Ms2ger`<mailto:Ms2ger@gmail.com> The 'border-right-color' set to #1000 is a transparent dark red square.
border-top-color reference/border-color-ref Border-top-color set to hex with three digits with the maximum plus one value of #1000 https://drafts.csswg.org/css-color-4/#hex-notation 36dd8fc359f31235f9b475f3ee72d224e013d988 `Microsoft`<http://www.microsoft.com/>,`Jack Moffitt`<http://metajack.im/>,`Ms2ger`<mailto:Ms2ger@gmail.com> The 'border-top-color' set to #1000 is a transparent dark red square.
caret-color-007 caret-color: currentColor interact http://www.w3.org/TR/css3-ui/#caret-color,https://drafts.csswg.org/css-color-4/#currentcolor-color adf2d7c68b94cd989f66054829398a4645768204 `Chris Lilley`<mailto:chris@w3.org>,`Florian Rivoal`<mailto:florian@rivoal.net> Test checks that caret-color:currentColor is inherited as currentColor and resolves to the value of the color property at used value time
caret-color-009 caret-color computed values dom,script http://www.w3.org/TR/css3-ui/#caret-color,https://drafts.csswg.org/css-color-4/#currentcolor-color de98bbd248400ce59cb26c48dcebf717d83852d7 `Florian Rivoal`<mailto:florian@rivoal.net> Test checks that auto and currentcolor compute to themselves for caret-color and that initial computes to auto
caret-color-009 caret-color computed values dom,script http://www.w3.org/TR/css3-ui/#caret-color,https://drafts.csswg.org/css-color-4/#currentcolor-color 5cf99f4d75a5c16334cf11c5424ab533f1a568a1 `Florian Rivoal`<mailto:florian@rivoal.net> Test checks that the resolved value of auto, currentcolor and initial for caret-color property, is the used value.
color-001 reference/greentext-ref CSS Color 4: color property https://drafts.csswg.org/css-color-4/#the-color-property 2d4cc48f3fd2db3f4763e93e20b22efab2dbcc94 `Chris Lilley`<mailto:chris@w3.org> This property describes the foreground fill color of an element&#8217;s text content.
color-002 reference/blacktext-ref CSS Color 4: color property, initial value https://drafts.csswg.org/css-color-4/#the-color-property 590ce67fac62516559c06fa26086af436d398819 `Chris Lilley`<mailto:chris@w3.org> The initial value of this property is black.
color-003 reference/greentext-ref CSS Color 4: color property, initial value https://drafts.csswg.org/css-color-4/#the-color-property d5556ee193cc822a1b4f516a2c60ae5e5b1d943b `Chris Lilley`<mailto:chris@w3.org> If the currentcolor keyword is set on the color property itself, it is treated as color: inherit.
Expand Down
17 changes: 10 additions & 7 deletions css-color-4_dev/xhtml1/caret-color-009.xht
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@
<link href="http://www.w3.org/TR/css3-ui/#caret-color" rel="help" />
<link href="https://drafts.csswg.org/css-color-4/#currentcolor-color" rel="help" />
<meta content="dom" name="flags" />
<meta content="Test checks that auto and currentcolor compute to themselves for caret-color and that initial computes to auto" name="assert" />
<meta content="Test checks that the resolved value of auto, currentcolor and initial for caret-color property, is the used value." name="assert" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#d1 {
color: lime;
caret-color: auto;
}
#d2 {
color: cyan;
caret-color: currentcolor;
}
#d3 {
color: magenta;
caret-color: initial;
}
</style>
Expand All @@ -29,18 +32,18 @@
test(
function(){
var d1 = document.getElementById("d1");
assert_equals(window.getComputedStyle(d1)["caret-color"], "auto");
}, "The computed value of auto should be auto");
assert_equals(window.getComputedStyle(d1)["caret-color"], "rgb(0, 255, 0)");
}, "Check the resolved value of 'auto'");
test(
function(){
var d2 = document.getElementById("d2");
assert_equals(window.getComputedStyle(d2)["caret-color"], "currentcolor");
}, "The computed value of currentcolor should be currentcolor");
assert_equals(window.getComputedStyle(d2)["caret-color"], "rgb(0, 255, 255)");
}, "Check the resolved value of 'currentcolor'");
test(
function(){
var d3 = document.getElementById("d3");
assert_equals(window.getComputedStyle(d3)["caret-color"], "auto");
}, "The computed value of initial should be auto");
assert_equals(window.getComputedStyle(d3)["caret-color"], "rgb(255, 0, 255)");
}, "Check the resolved value of 'initial'");
</script>


Expand Down
2 changes: 1 addition & 1 deletion css-color-4_dev/xhtml1/chapter-5.xht
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@
<td><abbr class="dom" title="Requires Document Object Model support">DOM/JS</abbr><abbr class="script" title="Executes tests in script">Script</abbr></td>
<td>caret-color computed values
<ul class="assert">
<li>Test checks that auto and currentcolor compute to themselves for caret-color and that initial computes to auto</li>
<li>Test checks that the resolved value of auto, currentcolor and initial for caret-color property, is the used value.</li>
</ul>
</td>
</tr>
Expand Down
17 changes: 10 additions & 7 deletions css-color-4_dev/xhtml1print/caret-color-009.xht
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@
<link href="http://www.w3.org/TR/css3-ui/#caret-color" rel="help" />
<link href="https://drafts.csswg.org/css-color-4/#currentcolor-color" rel="help" />
<meta content="dom" name="flags" />
<meta content="Test checks that auto and currentcolor compute to themselves for caret-color and that initial computes to auto" name="assert" />
<meta content="Test checks that the resolved value of auto, currentcolor and initial for caret-color property, is the used value." name="assert" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#d1 {
color: lime;
caret-color: auto;
}
#d2 {
color: cyan;
caret-color: currentcolor;
}
#d3 {
color: magenta;
caret-color: initial;
}
</style>
Expand All @@ -29,18 +32,18 @@
test(
function(){
var d1 = document.getElementById("d1");
assert_equals(window.getComputedStyle(d1)["caret-color"], "auto");
}, "The computed value of auto should be auto");
assert_equals(window.getComputedStyle(d1)["caret-color"], "rgb(0, 255, 0)");
}, "Check the resolved value of 'auto'");
test(
function(){
var d2 = document.getElementById("d2");
assert_equals(window.getComputedStyle(d2)["caret-color"], "currentcolor");
}, "The computed value of currentcolor should be currentcolor");
assert_equals(window.getComputedStyle(d2)["caret-color"], "rgb(0, 255, 255)");
}, "Check the resolved value of 'currentcolor'");
test(
function(){
var d3 = document.getElementById("d3");
assert_equals(window.getComputedStyle(d3)["caret-color"], "auto");
}, "The computed value of initial should be auto");
assert_equals(window.getComputedStyle(d3)["caret-color"], "rgb(255, 0, 255)");
}, "Check the resolved value of 'initial'");
</script>


Expand Down
2 changes: 1 addition & 1 deletion css-color-4_dev/xhtml1print/chapter-5.xht
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@
<td><abbr class="dom" title="Requires Document Object Model support">DOM/JS</abbr><abbr class="script" title="Executes tests in script">Script</abbr></td>
<td>caret-color computed values
<ul class="assert">
<li>Test checks that auto and currentcolor compute to themselves for caret-color and that initial computes to auto</li>
<li>Test checks that the resolved value of auto, currentcolor and initial for caret-color property, is the used value.</li>
</ul>
</td>
</tr>
Expand Down
Loading

0 comments on commit e286d7b

Please sign in to comment.