caret-color-009

caret-color computed values

WeasyPrint

This browser

Flags
dom, script
Assertion
Test checks that the resolved value of auto, currentcolor and initial for caret-color property, is the used value.

Source

 1 <!DOCTYPE html>
 2 <html><head><meta charset="utf-8">
 3 <title>CSS Basic User Interface Test: caret-color computed values</title>
 4 <link href="mailto:florian@rivoal.net" rel="author" title="Florian Rivoal">
 5 <link href="http://www.w3.org/TR/css3-ui/#caret-color" rel="help">
 6 <link href="https://drafts.csswg.org/css-color-4/#currentcolor-color" rel="help">
 7 <meta content="dom" name="flags">
 8 <meta content="Test checks that the resolved value of auto, currentcolor and initial for caret-color property, is the used value." name="assert">
 9 <script src="/resources/testharness.js"></script>
10 <script src="/resources/testharnessreport.js"></script>
11 <style>
12 #d1 {
13 	color: lime;
14 	caret-color: auto;
15 }
16 #d2 {
17 	color: cyan;
18 	caret-color: currentcolor;
19 }
20 #d3 {
21 	color: magenta;
22 	caret-color: initial;
23 }
24 </style>
25 </head><body>
26   <div id="d1"></div>
27   <div id="d2"></div>
28   <div id="d3"></div>
29   <div id="log"></div>
30 
31 <script>
32 test(
33   function(){
34    var d1 = document.getElementById("d1");
35    assert_equals(window.getComputedStyle(d1)["caret-color"], "rgb(0, 255, 0)");
36   }, "Check the resolved value of 'auto'");
37 test(
38   function(){
39    var d2 = document.getElementById("d2");
40    assert_equals(window.getComputedStyle(d2)["caret-color"], "rgb(0, 255, 255)");
41   }, "Check the resolved value of 'currentcolor'");
42 test(
43   function(){
44    var d3 = document.getElementById("d3");
45    assert_equals(window.getComputedStyle(d3)["caret-color"], "rgb(255, 0, 255)");
46   }, "Check the resolved value of 'initial'");
47 </script>
48 
49 
50 </body></html>