OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../../resources/testharness.js"></script> | 2 <script src="../../../resources/testharness.js"></script> |
3 <script src="../../../resources/testharnessreport.js"></script> | 3 <script src="../../../resources/testharnessreport.js"></script> |
4 <style> | 4 <style> |
5 #container { | 5 #container { |
6 --a: green; | 6 --a: green; |
7 } | 7 } |
8 | 8 |
9 #b { | 9 #b { |
10 --a: inherit; | 10 --a: inherit; |
11 } | 11 } |
12 | 12 |
13 </style> | 13 </style> |
14 | 14 |
15 <div id="container"> | 15 <div id="container"> |
16 <div id="a" style="--a: inherit;"></div> | 16 <div id="a" style="--a: inherit;"></div> |
17 <div id="b"></div> | 17 <div id="b"></div> |
18 </div> | 18 </div> |
19 | 19 |
20 <script> | 20 <script> |
21 test(function() { | 21 test(function() { |
22 assert_equals(getComputedStyle(container).getPropertyValue("--a"), " green"); | 22 assert_equals(getComputedStyle(container).getPropertyValue("--a"), " green"); |
23 assert_equals(getComputedStyle(a).getPropertyValue("--a"), " green"); | 23 assert_equals(getComputedStyle(a).getPropertyValue("--a"), " green"); |
24 assert_equals(a.style.getPropertyValue("--a"), " inherit"); | 24 assert_equals(a.style.getPropertyValue("--a"), "inherit"); |
| 25 assert_equals(a.style.cssText, "--a: inherit;"); |
25 }, 'The special inherit value can be read from inline style.'); | 26 }, 'The special inherit value can be read from inline style.'); |
26 | 27 |
27 test(function() { | 28 test(function() { |
28 a.style.setProperty("--a", "inherit"); | 29 a.style.setProperty("--a", "inherit"); |
29 assert_equals(a.style.getPropertyValue("--a"), " inherit"); | 30 assert_equals(a.style.getPropertyValue("--a"), "inherit"); |
30 }, 'The special inherit value can be read after setting.') | 31 }, 'The special inherit value can be read after setting.') |
31 | 32 |
32 test(function() { | 33 test(function() { |
33 assert_equals(document.styleSheets[0].rules[1].style.getPropertyValue("--a"),
" inherit"); | 34 assert_equals(document.styleSheets[0].rules[1].style.getPropertyValue("--a"),
"inherit"); |
34 }, 'The special inherit value can be read from a declared rule.') | 35 }, 'The special inherit value can be read from a declared rule.') |
35 </script> | 36 </script> |
OLD | NEW |