| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <meta charset="UTF-8"> | 4 <meta charset="UTF-8"> |
| 5 <title>CSS Test: @viewport constrained - width 20rem</title> | 5 <title>CSS Test: @viewport constrained - width 20rem</title> |
| 6 <link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com"> | 6 <link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com"> |
| 7 <link rel="help" href="http://www.w3.org/TR/css-device-adapt/#constraining-pro
cedure"> | 7 <link rel="help" href="http://www.w3.org/TR/css-device-adapt/#constraining-pro
cedure"> |
| 8 <meta name="flags" content="visual scroll dom"> | 8 <meta name="flags" content="visual scroll dom"> |
| 9 <meta name="assert" content="Setting width in @viewport to 20rem will set the
actual viewport width to 20 times the initial font-size."> | 9 <meta name="assert" content="Setting width in @viewport to 20rem will set the
actual viewport width to 20 times the initial font-size."> |
| 10 <script src="../../../resources/testharness.js" type="text/javascript"></scrip
t> | 10 <script src="../../../resources/testharness.js" type="text/javascript"></scrip
t> |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 testStyleSheet.disabled = false; | 78 testStyleSheet.disabled = false; |
| 79 | 79 |
| 80 /* Retrieve the actual viewport values for the test. */ | 80 /* Retrieve the actual viewport values for the test. */ |
| 81 viewport.actualWidth = testElm.offsetWidth; | 81 viewport.actualWidth = testElm.offsetWidth; |
| 82 viewport.actualHeight = testElm.offsetHeight; | 82 viewport.actualHeight = testElm.offsetHeight; |
| 83 viewport.zoom = viewport.initialWidth / window.innerWidth; | 83 viewport.zoom = viewport.initialWidth / window.innerWidth; |
| 84 } | 84 } |
| 85 | 85 |
| 86 /* Check viewport values. */ | 86 /* Check viewport values. */ |
| 87 test.step(function(){ | 87 test.step(function(){ |
| 88 assert_equals(viewport.actualWidth, 20*viewport.fontSize); | 88 assert_equals(viewport.actualWidth, 320); |
| 89 }); | 89 }); |
| 90 | 90 |
| 91 /* Finished. Show the results. */ | 91 /* Finished. Show the results. */ |
| 92 test.done(); | 92 test.done(); |
| 93 testStyleSheet.disabled = true; | 93 testStyleSheet.disabled = true; |
| 94 document.getElementById("log").style.display = "block"; | 94 document.getElementById("log").style.display = "block"; |
| 95 } | 95 } |
| 96 </script> | 96 </script> |
| 97 </head> | 97 </head> |
| 98 <body> | 98 <body> |
| 99 <div id="test"> | 99 <div id="test"> |
| 100 <div id="log"></div> | 100 <div id="log"></div> |
| 101 </div> | 101 </div> |
| 102 </body> | 102 </body> |
| 103 </html> | 103 </html> |
| OLD | NEW |