| 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 <div id='testElem'></div> | 4 <div id='testElem'></div> |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 test(function() { | 7 test(function() { |
| 8 assert_equals(testElem.getAttribute('style'), null); | 8 assert_equals(testElem.getAttribute('style'), null); |
| 9 testElem.style.setProperty('--foo', 'first'); | 9 testElem.style.setProperty('--foo', 'first'); |
| 10 assert_equals(testElem.style.getPropertyValue('--foo'), 'first'); | 10 assert_equals(testElem.style.getPropertyValue('--foo'), 'first'); |
| 11 assert_equals(getComputedStyle(testElem).getPropertyValue('--foo'), 'first'); | 11 assert_equals(getComputedStyle(testElem).getPropertyValue('--foo'), 'first'); |
| 12 assert_equals(testElem.getAttribute('style'), '--foo:first;'); | 12 assert_equals(testElem.getAttribute('style'), '--foo:first;'); |
| 13 testElem.style.setProperty('--foo', 'second'); | 13 testElem.style.setProperty('--foo', 'second'); |
| 14 assert_equals(testElem.style.getPropertyValue('--foo'), 'second'); | 14 assert_equals(testElem.style.getPropertyValue('--foo'), 'second'); |
| 15 assert_equals(testElem.getAttribute('style'), '--foo:second;'); | 15 assert_equals(testElem.getAttribute('style'), '--foo:second;'); |
| 16 }, "subsequent writes to inline style overwrite older values.") | 16 }, "subsequent writes to inline style overwrite older values.") |
| 17 | 17 |
| 18 test(function() { |
| 19 var value = '10 20% 30px bla("x")'; |
| 20 testElem.style.setProperty('--foo', value); |
| 21 assert_equals(testElem.style.getPropertyValue('--foo'), value); |
| 22 testElem.offsetTop; |
| 23 testElem.style.setProperty('--foo', value); |
| 24 assert_equals(testElem.style.getPropertyValue('--foo'), value); |
| 25 testElem.offsetTop; |
| 26 value = '-5 1.5px [ ]' |
| 27 testElem.style.setProperty('--foo', value); |
| 28 assert_equals(testElem.style.getPropertyValue('--foo'), value); |
| 29 }, "various token types can be compared") |
| 30 |
| 18 </script> | 31 </script> |
| OLD | NEW |