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> |
| 12 <tr> |
| 13 <td> |
| 14 <table width="800" style="table-layout:fixed;"> |
| 15 <tr> |
| 16 <td class="supercluster" style="width:800px"> |
| 17 <div class="inheritedcluter" id="content" style="wid
th:800px">short content...</div> |
| 18 </td> |
| 19 </tr> |
| 20 </table> |
| 21 </td> |
| 22 </tr> |
| 23 |
| 24 <tr> |
| 25 <td> |
| 26 <table width="800" style="table-layout:fixed;"> |
| 27 <tr> |
| 28 <td class="supercluster" style="width:800px"> |
| 29 <div class="inheritedcluter" style="width:800px">comments:</
div> |
| 30 </td> |
| 31 </tr> |
| 32 </table> |
| 33 </td> |
| 34 </tr> |
| 35 |
| 36 </table> |
| 37 |
| 38 <script> |
| 39 function changeText() { |
| 40 var inheritedcluter1 = document.createElement("d
iv"); |
| 41 inheritedcluter1.setAttribute("class", "inherite
dcluter"); |
| 42 inheritedcluter1.style="width:800px"; |
| 43 inheritedcluter1.innerText="inert short text"; |
| 44 document.getElementsByClassName("supercluster")[
1].appendChild(inheritedcluter1); |
| 45 |
| 46 var inheritedcluter2 = document.createElement("d
iv"); |
| 47 inheritedcluter2.setAttribute("class", "inherite
dcluter"); |
| 48 inheritedcluter2.setAttribute("id", "lastcomment
"); |
| 49 inheritedcluter2.style="width:800px"; |
| 50 inheritedcluter2.innerText="inert long text...in
ert long text...inert long text...inert long text...inert long text...inert long
text...inert long text...inert long text...inert long text...inert long text...
inert long text...inert long text..."; |
| 51 document.getElementsByClassName("supercluster")[1].app
endChild(inheritedcluter2); |
| 52 } |
| 53 |
| 54 function testConsistent() { |
| 55 var lastcomment = document.getElementById('lastcomment'); |
| 56 var lastcommentComputedFontSize = parseInt(window.getCompute
dStyle(lastcomment).fontSize); |
| 57 |
| 58 var content = document.getElementById('content'); |
| 59 var contentComputedFontSize = parseInt(window.getComputedSty
le(content).fontSize); |
| 60 |
| 61 if (lastcommentComputedFontSize == contentComputedFontSize &
& contentComputedFontSize > 16) |
| 62 document.write('PASS'); |
| 63 else |
| 64 document.write('FAIL. Expected contentComputedFontSize ==
lastcommentComputedFontSize.\n ' + contentComputedFontSize + ': ' + lastcommentC
omputedFontSize); |
| 65 |
| 66 if (window.testRunner) |
| 67 testRunner.dumpAsText(); |
| 68 } |
| 69 |
| 70 setTimeout("changeText()", 100); |
| 71 setTimeout("testConsistent()", 200); |
| 72 </script> |
| 73 </body> |
| 74 </html> |
| 75 |
| 76 |
OLD | NEW |