OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Inserting an @viewport rule before an existing one (CSSOM)</title> | 4 <title>Inserting an @viewport rule before an existing one (CSSOM)</title> |
5 <style> | 5 <style> |
6 @viewport { | 6 @viewport { |
7 width: 500px; | 7 width: 500px; |
8 } | 8 } |
9 </style> | 9 </style> |
10 <script> | 10 <script> |
11 if (window.testRunner) | 11 if (window.testRunner) |
12 testRunner.addUserStyleSheet("@viewport { width: extend-to-zoom 980px; min-z
oom: 0.25; max-zoom: 5; height: auto; zoom: auto; user-zoom: zoom; orientation:
auto }", true); | 12 testRunner.injectStyleSheet("@viewport { width: extend-to-zoom 980px; min-zo
om: 0.25; max-zoom: 5; height: auto; zoom: auto; user-zoom: zoom; orientation: a
uto }", true); |
13 | 13 |
14 function test() { | 14 function test() { |
15 if (window.testRunner) { | 15 if (window.testRunner) { |
16 testRunner.dumpAsText(); | 16 testRunner.dumpAsText(); |
17 document.styleSheets[0].insertRule("@viewport {width: 1000px}", 0); | 17 document.styleSheets[0].insertRule("@viewport {width: 1000px}", 0); |
18 document.body.offsetWidth; // Trigger style resolving | 18 document.body.offsetWidth; // Trigger style resolving |
19 alert(internals.viewportAsText(document, 1, 320, 352)); | 19 alert(internals.viewportAsText(document, 1, 320, 352)); |
20 } | 20 } |
21 } | 21 } |
22 </script> | 22 </script> |
23 </head> | 23 </head> |
24 <body onload="test()"></body> | 24 <body onload="test()"></body> |
25 </html> | 25 </html> |
OLD | NEW |