OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <style> |
| 5 body { |
| 6 --a: red; |
| 7 --b: blue; |
| 8 } |
| 9 |
| 10 .foo { |
| 11 --a: green; |
| 12 } |
| 13 |
| 14 .container { |
| 15 --a: var(--b); |
| 16 } |
| 17 |
| 18 .here { |
| 19 background: var(--a); |
| 20 width: 100px; |
| 21 height: 100px; |
| 22 } |
| 23 </style> |
| 24 <div id="outer"> |
| 25 <div class="here" id='red'></div> |
| 26 |
| 27 <div class="container" id='container'> |
| 28 <div class="here" id='blue'></div> |
| 29 </div> |
| 30 </div> |
| 31 |
| 32 <script> |
| 33 test(function() { |
| 34 assert_equals(getComputedStyle(red).backgroundColor, "rgb(255, 0, 0)"); |
| 35 assert_equals(getComputedStyle(blue).backgroundColor, "rgb(0, 0, 255)"); |
| 36 outer.classList.add('foo'); |
| 37 assert_equals(getComputedStyle(red).backgroundColor, "rgb(0, 128, 0)"); |
| 38 assert_equals(getComputedStyle(blue).backgroundColor, "rgb(0, 0, 255)"); |
| 39 }, 'Custom properties are recomputed when parent style changes.'); |
| 40 </script> |
OLD | NEW |