OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html style="font-size: 16px"> | 2 <html style="font-size: 16px"> |
3 <head> | 3 <head> |
4 | |
5 <meta name="viewport" content="width=800"> | 4 <meta name="viewport" content="width=800"> |
6 <style> | 5 <style> |
7 body { | 6 body { |
8 width: 800px; | 7 width: 800px; |
9 margin: 0; | 8 margin: 0; |
10 overflow-y: hidden; | 9 overflow-y: hidden; |
11 } | 10 } |
12 .largersize{font-size: 1.1em} | 11 .largersize{font-size: 1.1em} |
13 </style> | 12 </style> |
14 | |
15 <script src="resources/autosizingTest.js"></script> | 13 <script src="resources/autosizingTest.js"></script> |
16 | |
17 </head> | 14 </head> |
18 <body> | 15 <body> |
19 | 16 <div> |
20 <div style="top: 50px; position: absolute; overflow: auto;"> | 17 This paragraph should be autosized to 40px<br/> |
21 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . .<br/> | |
22 This paragraph should be autosized to 19.8px<br/> | |
23 because it contains line breaks.<br/> | 18 because it contains line breaks.<br/> |
24 This test is intended to check<br/> | 19 This test is intended to check<br/> |
25 that there are no oscillations due to javascript<br/> | 20 that there are no oscillations due to javascript<br/> |
26 briefly increasing the font size of a<br/> | 21 briefly increasing the font size of a<br/> |
27 small paragraph below. | 22 small paragraph below. |
28 </div> | 23 </div> |
29 <div id="sizechanging"> | 24 <div id="sizechanging" style="position: absolute; bottom: 0;"> |
30 This text changes size using javascript below. | 25 This text changes size using javascript below. |
31 </div> | 26 </div> |
32 | |
33 <script> | 27 <script> |
34 element = document.getElementById("sizechanging"); | 28 var element = document.getElementById("sizechanging"); |
35 if (element.offsetHeight) { | 29 var forceLayout = element.offsetHeight; |
36 // force layout (computation of offsetHeight triggers reflow) | 30 element.className = 'largersize'; |
37 } | 31 forceLayout = element.offsetHeight; |
38 element.className = 'largersize'; | 32 element.className = ''; |
39 if (element.offsetHeight) {} | 33 forceLayout = element.offsetHeight; |
40 element.className = ''; | |
41 if (element.offsetHeight) {} | |
42 </script> | 34 </script> |
43 <noscript>fail (no support for javascript)</noscript> | |
44 | |
45 </body> | 35 </body> |
46 </html> | 36 </html> |
OLD | NEW |