OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>@viewport user agent stylesheet</title> | 4 <title>Empty @viewport not overriding Viewport Meta tag</title> |
5 <script src="../../resources/testharness.js"></script> | 5 <script src="../../resources/testharness.js"></script> |
6 <script src="../../resources/testharnessreport.js"></script> | 6 <script src="../../resources/testharnessreport.js"></script> |
7 <script> | 7 <script> |
8 if (window.testRunner) { | 8 if (window.testRunner) { |
9 testRunner.enableFixedLayoutMode(true); | 9 testRunner.enableFixedLayoutMode(true); |
10 internals.settings.setViewportEnabled(true); | 10 internals.settings.setViewportEnabled(true); |
11 } | 11 } |
12 </script> | 12 </script> |
13 <style> | 13 <meta name="viewport" content="width=5000"> |
14 html, body { width: 100%; height: 100%; margin: 0 } | 14 <style>@viewport {}</style> |
15 </style> | |
16 </head> | 15 </head> |
17 <body> | 16 <body> |
18 <div id="log"></div> | 17 <div id="log"></div> |
19 <script> | 18 <script> |
| 19 var rootWidth = document.documentElement.offsetWidth; |
20 test(function(){ | 20 test(function(){ |
21 assert_equals(document.body.offsetWidth, 980); | 21 assert_equals(rootWidth, 5000, "documentElement.offsetWidth equals M
eta viewport width."); |
22 }, "Check that we get a viewport width of 980px from the user agent styl
esheet."); | 22 }, "Check that Meta viewport is not overridden by empty @viewport rule."
); |
23 </script> | 23 </script> |
24 </body> | 24 </body> |
25 </html> | 25 </html> |
OLD | NEW |