OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 |
| 5 <style> |
| 6 body { |
| 7 font-size: 16px; |
| 8 } |
| 9 </style> |
| 10 |
| 11 <div id="div0" style="background-color: red"></div> |
| 12 <div id="div1" style="background-color: red"></div> |
| 13 <div id="div2" style="background-color: red"></div> |
| 14 <div id="div3"></div> |
| 15 <svg id="svg0" style="background-color: red"></svg> |
| 16 |
| 17 <script> |
| 18 div0.style = ''; |
| 19 div1.style = 'color:green'; |
| 20 div2.style = 'color:green; font-size:30px'; |
| 21 div3.style = 'color:green'; |
| 22 |
| 23 document.styleSheets[0].cssRules[0].style = 'font-size:30px'; |
| 24 |
| 25 svg0.style = ''; |
| 26 |
| 27 test(function() { |
| 28 assert_equals(div0.style.backgroundColor, ""); |
| 29 |
| 30 assert_equals(div1.style.backgroundColor, ""); |
| 31 assert_equals(div1.style.color, "green"); |
| 32 |
| 33 assert_equals(div2.style.backgroundColor, ""); |
| 34 assert_equals(div2.style.color, "green"); |
| 35 assert_equals(div2.style.fontSize, "30px"); |
| 36 |
| 37 assert_equals(div3.style.color, "green"); |
| 38 |
| 39 }, 'Assigning to HTMLElement.style updates the style declaration'); |
| 40 |
| 41 test(function() { |
| 42 assert_equals(svg0.style.backgroundColor, ""); |
| 43 }, 'Assigning to SVGElement.style updates the style declaration'); |
| 44 |
| 45 test(function() { |
| 46 assert_equals(document.styleSheets[0].cssRules[0].style.cssText, "font-size: 3
0px;"); |
| 47 }, 'Assigning to CSSStyleRule.style updates the style declaration'); |
| 48 |
| 49 </script> |
OLD | NEW |