OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 |
| 3 <script src="../../../resources/testharness.js"></script> |
| 4 <script src="../../../resources/testharnessreport.js"></script> |
| 5 |
| 6 <!-- The linked stylesheet must not be in the same directory as this test file.
--> |
| 7 <!-- This is intended to test that relative URLs in stylesheets remain relative
--> |
| 8 <!-- to the stylesheet's directory rather than the page that uses it. --> |
| 9 <link href="../resources/image-url-var.css" rel="stylesheet"> |
| 10 |
| 11 <div id="target"></div> |
| 12 |
| 13 <script> |
| 14 for (var property of ['background', 'background-image']) { |
| 15 for (var value of ['image-set', 'url']) { |
| 16 test(() => { |
| 17 target.classList.remove(...target.classList); |
| 18 assert_equals(target.classList.length, 0); |
| 19 var initial = getComputedStyle(target)[property]; |
| 20 |
| 21 target.classList.add(property); |
| 22 target.classList.add(value); |
| 23 target.classList.add('var'); |
| 24 var actual = getComputedStyle(target)[property]; |
| 25 |
| 26 target.classList.remove('var'); |
| 27 target.classList.add('inline'); |
| 28 var expected = getComputedStyle(target)[property]; |
| 29 assert_not_equals(expected, initial); |
| 30 |
| 31 assert_equals(actual, expected); |
| 32 }, property + ' should resolve ' + value + ' the same whether via var() or n
ot.'); |
| 33 } |
| 34 } |
| 35 </script> |
OLD | NEW |