Chromium Code Reviews| 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 <div id="test"></div> | |
| 10 <script src="../../../resources/js-test.js"></script> | |
| 11 <script> | |
| 12 var style = document.styleSheets[0].rules[0].style; | |
| 13 shouldBeEqualToString('style.getPropertyValue("--important")', "green"); | |
| 14 shouldBeEqualToString('style.getPropertyValue("--not-important")', "red"); | |
| 15 shouldBeEqualToString('style.getPropertyValue("color")', "var(--important)"); | |
| 16 shouldBeEqualToString('style.getPropertyPriority("--important")', "important"); | |
| 17 shouldBeEqualToString('style.getPropertyPriority("--not-important")', ""); | |
| 18 style.setProperty("--foo", "papayawhip"); | |
| 19 style.setProperty("--important-foo", "navajowhite", "important"); | |
| 20 shouldBeEqualToString('style.getPropertyValue("--foo")', "papayawhip"); | |
| 21 shouldBeEqualToString('style.getPropertyPriority("--foo")', ""); | |
| 22 shouldBeEqualToString('style.getPropertyPriority("--important-foo")', "important "); | |
| 23 style.setProperty("--important-foo", "") | |
| 24 shouldBeEqualToString('style.getPropertyValue("--important-foo")', ""); | |
| 25 shouldBeEqualToString('style.removeProperty("--foo")', "papayawhip"); | |
| 26 shouldBeEqualToString('style.getPropertyValue("--foo")', ""); | |
| 27 var computedStyle = window.getComputedStyle(document.getElementById("test")); | |
| 28 shouldThrow('computedStyle.setProperty("--error", "")', | |
| 29 '"NoModificationAllowedError: Failed to execute \'setProperty\' on \'CSSStyl eDeclaration\': These styles are computed, and therefore the \'--error\' propert y is read-only."'); | |
|
alancutter (OOO until 2018)
2015/11/17 07:10:42
Does this pass? I don't think getPropertyNameStrin
leviw_travelin_and_unemployed
2015/11/17 07:23:44
It does pass.
Timothy Loh
2015/11/19 00:47:42
I had a look, CSSComputedStyleDeclaration::setProp
| |
| 30 </script> | |
| OLD | NEW |