| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <style> | 3 <style> |
| 4 .testContent { | 4 .testContent { |
| 5 font-face: Arial; font-size: 16px; | 5 font-face: Arial; font-size: 16px; |
| 6 } | 6 } |
| 7 </style> | 7 </style> |
| 8 </head> | 8 </head> |
| 9 <body> | 9 <body> |
| 10 <div id="testContent"> | 10 <div id="testContent"> |
| 11 <span id="span-position-static" style="position:static">T</span> | 11 <span id="span-position-static" style="position:static">T</span> |
| 12 <span id="span-position-fixed" style="position:fixed">T</span> | 12 <span id="span-position-fixed" style="position:fixed">T</span> |
| 13 <span id="span-position-absolute" style="position:absolute">T</span> | 13 <span id="span-position-absolute" style="position:absolute">T</span> |
| 14 <span id="span-position-relative" style="position:relative">T</span> | 14 <span id="span-position-relative" style="position:relative">T</span> |
| 15 </div> | 15 </div> |
| 16 <script src="../js/resources/js-test-pre.js"></script> | 16 <script src="../js/resources/js-test-pre.js"></script> |
| 17 <script> | 17 <script> |
| 18 description("Test case for bug 90097. This tests span sizes with different C
SS position attributes."); | 18 description("Test case for bug 90097. This tests span sizes with different C
SS position attributes."); |
| 19 var spans = testContent.querySelectorAll('span'); | 19 var spans = testContent.querySelectorAll('span'); |
| 20 var expected_width = document.getElementById('span-position-static').getBoun
dingClientRect().width; | 20 var expected_width = document.getElementById('span-position-static').getBoun
dingClientRect().width; |
| 21 // if expected_width is integral, all should match, otherwise should be clos
e | 21 // if expected_width is integral, all should match, otherwise should be clos
e |
| 22 var tolerance = expected_width % 1.0 == 0.0 ? 0.0 : 1.0 / 60; | 22 var tolerance = expected_width % 1.0 == 0.0 ? 0.0 : 1.0 / 60; |
| 23 | 23 |
| 24 shouldBeCloseTo('document.getElementById("span-position-fixed").getBoundingC
lientRect().width', expected_width, tolerance, true); | 24 shouldBeCloseTo('document.getElementById("span-position-fixed").getBoundingC
lientRect().width', expected_width, tolerance, true); |
| 25 shouldBeCloseTo('document.getElementById("span-position-absolute").getBoundi
ngClientRect().width', expected_width, tolerance, true); | 25 shouldBeCloseTo('document.getElementById("span-position-absolute").getBoundi
ngClientRect().width', expected_width, tolerance, true); |
| 26 shouldBeCloseTo('document.getElementById("span-position-relative").getBoundi
ngClientRect().width', expected_width, tolerance, true); | 26 shouldBeCloseTo('document.getElementById("span-position-relative").getBoundi
ngClientRect().width', expected_width, tolerance, true); |
| 27 document.getElementById("testContent").style.display = 'none'; | 27 document.getElementById("testContent").style.display = 'none'; |
| 28 </script> | 28 </script> |
| 29 <script src="../js/resources/js-test-post.js"></script> | |
| 30 </body> | 29 </body> |
| 31 </html> | 30 </html> |
| OLD | NEW |