OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <meta name="viewport" content="width=800"> |
| 4 <style> |
| 5 html { font-size: 16px; } |
| 6 body { width: 800px; margin: 0; overflow-y: hidden; } |
| 7 </style> |
| 8 <script src="resources/autosizingTest.js"></script> |
| 9 </head> |
| 10 <body> |
| 11 <table width="760"> |
| 12 <tr> |
| 13 <td colspan="2"> |
| 14 <table width="760" style="table-layout:fixed;word-wrap:break-wor
d;"> |
| 15 <tr> |
| 16 <td class="read"> |
| 17 <div id="longText">short blah blah</div> |
| 18 </td> |
| 19 </tr> |
| 20 </table> |
| 21 </td> |
| 22 </tr> |
| 23 |
| 24 <tr> |
| 25 <td colspan="2"> |
| 26 <table width="760" style="table-layout:fixed;word-wrap:break-wor
d;"> |
| 27 <tr> |
| 28 <td class="read"> |
| 29 <div id="shortText">short blah blah</div> |
| 30 </td> |
| 31 </tr> |
| 32 </table> |
| 33 </td> |
| 34 </tr> |
| 35 </table> |
| 36 |
| 37 <script> |
| 38 function changeText() { |
| 39 document.getElementById("longText").innerHTML="l
ong blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah b
lah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah b
lah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah b
lah blah blah blah blah blah blah"; |
| 40 } |
| 41 |
| 42 function testConsistent() { |
| 43 var longText = document.getElementById('longText'); |
| 44 var longTextComputedFontSize = parseInt(window.getComputedSt
yle(longText).fontSize); |
| 45 |
| 46 var shortText = document.getElementById('shortText'); |
| 47 var shortTextComputedFontSize = parseInt(window.getComputedS
tyle(shortText).fontSize); |
| 48 |
| 49 if (longTextComputedFontSize == shortTextComputedFontSize) |
| 50 document.write('PASS'); |
| 51 else |
| 52 document.write('FAIL. Expected longTextComputedFontSize ==
shortTextComputedFontSize.\n ' + longTextComputedFontSize + ': ' + shortTextCom
putedFontSize); |
| 53 |
| 54 if (window.testRunner) |
| 55 testRunner.dumpAsText(); |
| 56 } |
| 57 |
| 58 setTimeout("changeText()", 100); |
| 59 setTimeout("testConsistent()", 200); |
| 60 </script> |
| 61 </body> |
| 62 </html> |
OLD | NEW |