OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <style> |
| 3 #test { |
| 4 --important:green!important; |
| 5 --not-important:red; |
| 6 color:var(--important); |
| 7 } |
| 8 </style> |
| 9 <script src="../../../resources/js-test.js"></script> |
| 10 <script> |
| 11 var style = document.styleSheets[0].rules[0].style; |
| 12 shouldBeEqualToString('style.getPropertyValue("--important")', "green"); |
| 13 shouldBeEqualToString('style.getPropertyValue("--not-important")', "red"); |
| 14 shouldBeEqualToString('style.getPropertyValue("color")', "var(--important)"); |
| 15 shouldBeEqualToString('style.getPropertyPriority("--important")', "important"); |
| 16 shouldBeEqualToString('style.getPropertyPriority("--not-important")', ""); |
| 17 style.setProperty("--foo", "papayawhip"); |
| 18 style.setProperty("--important-foo", "navajowhite", "important"); |
| 19 shouldBeEqualToString('style.getPropertyValue("--foo")', "papayawhip"); |
| 20 shouldBeEqualToString('style.getPropertyPriority("--foo")', ""); |
| 21 shouldBeEqualToString('style.getPropertyPriority("--important-foo")', "important
"); |
| 22 style.setProperty("--important-foo", "") |
| 23 shouldBeEqualToString('style.getPropertyValue("--important-foo")', ""); |
| 24 shouldBeEqualToString('style.removeProperty("--foo")', "papayawhip"); |
| 25 shouldBeEqualToString('style.getPropertyValue("--foo")', ""); |
| 26 </script> |
OLD | NEW |