OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>This test is successful if fixed position elements re-layout correctly on
page scale changes</title> | 4 <title>This test is successful if fixed position elements re-layout correctly on
page scale changes</title> |
5 <style> | 5 <style> |
6 .fixed_size { | 6 .fixed_size { |
7 position:fixed; | 7 position:fixed; |
8 background-color:#ccffcc; | 8 background-color:#ccffcc; |
9 width:50px; | 9 width:50px; |
10 height:50px; | 10 height:50px; |
11 } | 11 } |
12 .percentage_size { | 12 .percentage_size { |
13 position:fixed; | 13 position:fixed; |
14 background-color:#ccccff; | 14 background-color:#ccccff; |
15 width:10%; | 15 width:10%; |
16 height:10%; | 16 height:10%; |
17 } | 17 } |
18 </style> | 18 </style> |
19 </head> | 19 </head> |
20 <body onload="runTest();" style="width:1600px;height:1200px;margin:0;"> | 20 <body onload="runTest();" style="width:1600px;height:1200px;margin:0;"> |
21 <div class="fixed_size" style="left:10px;top:20px"></div> | 21 <div class="fixed_size" style="left:10px;top:20px"></div> |
22 <div class="fixed_size" style="right:30px;top:40px"></div> | 22 <div class="fixed_size" style="right:30px;top:40px"></div> |
23 <div class="fixed_size" style="left:50px;bottom:60px"></div> | 23 <div class="fixed_size" style="left:50px;bottom:60px"></div> |
24 <div class="fixed_size" style="right:70px;bottom:80px"></div> | 24 <div class="fixed_size" style="right:70px;bottom:80px"></div> |
25 <div class="percentage_size" style="left:40%;top:35%"></div> | 25 <div class="percentage_size" style="left:40%;top:35%"></div> |
26 <div class="percentage_size" style="right:30%;top:25%"></div> | 26 <div class="percentage_size" style="right:30%;top:25%"></div> |
27 <div class="percentage_size" style="left:20%;bottom:15%"></div> | 27 <div class="percentage_size" style="left:20%;bottom:15%"></div> |
28 <div class="percentage_size" style="right:10%;bottom:5%"></div> | 28 <div class="percentage_size" style="right:10%;bottom:5%"></div> |
| 29 <div id="spacer" style="width: 1700px; height: 1300px"></div> |
29 <script> | 30 <script> |
30 function runTest() { | 31 function runTest() { |
31 if (window.internals && window.eventSender) { | 32 if (window.internals && window.eventSender) { |
32 window.internals.settings.setFixedElementsLayoutRelativeToFrame(true); | 33 window.internals.setPageScaleFactorLimits(0.5, 4); |
| 34 window.internals.setPageScaleFactor(0.5); |
33 | 35 |
34 // Force scrollbar to hide and re-layout immediately. | 36 // Force scrollbar to hide and re-layout immediately. |
35 window.internals.setPageScaleFactor(0.1); | 37 var spacer = document.getElementById('spacer'); |
| 38 spacer.style.display = "none"; |
36 document.body.offsetTop; | 39 document.body.offsetTop; |
37 | |
38 window.internals.setPageScaleFactor(0.5); | |
39 } | 40 } |
40 } | 41 } |
41 </script> | 42 </script> |
42 </body> | 43 </body> |
43 </html> | 44 </html> |
OLD | NEW |