OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <title>@viewport CSSOM - set descriptor values</title> |
| 5 <script src="../../resources/testharness.js"></script> |
| 6 <script src="../../resources/testharnessreport.js"></script> |
| 7 <style> |
| 8 @viewport { |
| 9 width: 200px; |
| 10 } |
| 11 </style> |
| 12 </head> |
| 13 <body> |
| 14 <div id="log"></div> |
| 15 <script> |
| 16 test(function(){ |
| 17 assert_equals(document.styleSheets[0].cssRules.length, 1, "Rule is f
ound"); |
| 18 assert_equals(document.styleSheets[0].cssRules[0].type, CSSRule.VIEW
PORT_RULE, "Rule is of type @viewport"); |
| 19 }, "@viewport rule exists"); |
| 20 |
| 21 var rule = document.styleSheets[0].cssRules[0]; |
| 22 |
| 23 test(function(){ |
| 24 rule.style.width = "400px"; |
| 25 assert_equals(rule.style.minWidth, "400px", "min-width is now 400px"
); |
| 26 }, "Setting width shorthand sets min-width"); |
| 27 |
| 28 test(function(){ |
| 29 rule.style.height = "900px"; |
| 30 assert_equals(rule.style.maxHeight, "900px", "max-height is now 900p
x"); |
| 31 }, "Setting height shorthand sets max-height"); |
| 32 </script> |
| 33 </body> |
| 34 </html> |
OLD | NEW |