OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <style> |
| 5 #container { |
| 6 --a: it was the best of times; |
| 7 --b: it was the worst of times; |
| 8 --c: also the blurst of times; |
| 9 } |
| 10 |
| 11 #b { |
| 12 --c: it was the age of wisdom; |
| 13 } |
| 14 </style> |
| 15 |
| 16 <div id="container"> |
| 17 <div id="a"></div> |
| 18 <div id="b"><div id="c"></div></div> |
| 19 </div> |
| 20 |
| 21 <script> |
| 22 test(function() { |
| 23 assert_equals(getComputedStyle(container).getPropertyValue("--a"), " it was th
e best of times"); |
| 24 assert_equals(getComputedStyle(container).getPropertyValue("--b"), " it was th
e worst of times"); |
| 25 assert_equals(getComputedStyle(container).getPropertyValue("--c"), " also the
blurst of times"); |
| 26 }, 'Directly declared custom properties appear in computed style.'); |
| 27 |
| 28 test(function() { |
| 29 assert_equals(getComputedStyle(a).getPropertyValue("--a"), " it was the best o
f times"); |
| 30 assert_equals(getComputedStyle(a).getPropertyValue("--b"), " it was the worst
of times"); |
| 31 assert_equals(getComputedStyle(a).getPropertyValue("--c"), " also the blurst o
f times"); |
| 32 }, 'Inherited custom properties appear in computed style.'); |
| 33 |
| 34 test(function() { |
| 35 assert_equals(getComputedStyle(b).getPropertyValue("--a"), " it was the best o
f times"); |
| 36 assert_equals(getComputedStyle(b).getPropertyValue("--b"), " it was the worst
of times"); |
| 37 assert_equals(getComputedStyle(b).getPropertyValue("--c"), " it was the age of
wisdom"); |
| 38 }, 'Inherited custom properties overidden values appear correctly in computed st
yle.'); |
| 39 |
| 40 test(function() { |
| 41 assert_equals(getComputedStyle(c).getPropertyValue("--a"), " it was the best o
f times"); |
| 42 assert_equals(getComputedStyle(c).getPropertyValue("--b"), " it was the worst
of times"); |
| 43 assert_equals(getComputedStyle(c).getPropertyValue("--c"), " it was the age of
wisdom"); |
| 44 }, 'Overidden and inherited custom properties appear in computed style.'); |
| 45 </script> |
OLD | NEW |