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