Change fast/s* and fast/t* files to use pre and post js files in LayoutTests/resources.
[WebKit-https.git] / LayoutTests / fast / sub-pixel / size-of-span-with-different-positions.html
1 <html>
2 <head>
3 <style>
4     .testContent {
5         font-face: Arial; font-size: 16px;
6     }
7 </style>
8 </head>
9 <body>
10 <div id="testContent">
11     <span id="span-position-static"   style="position:static">T</span>
12     <span id="span-position-fixed"    style="position:fixed">T</span>
13     <span id="span-position-absolute" style="position:absolute">T</span>
14     <span id="span-position-relative" style="position:relative">T</span>
15 </div>
16 <script src="../../resources/js-test-pre.js"></script>
17 <script>
18     description("Test case for bug 90097. This tests span sizes with different CSS position attributes.");
19     var spans = testContent.querySelectorAll('span');
20     var expected_width = document.getElementById('span-position-static').getBoundingClientRect().width;
21     // if expected_width is integral, all should match, otherwise should be close
22     var tolerance = expected_width % 1.0 == 0.0 ? 0.0 : 1.0 / 60;
23
24     shouldBeCloseTo('document.getElementById("span-position-fixed").getBoundingClientRect().width', expected_width, tolerance, true);
25     shouldBeCloseTo('document.getElementById("span-position-absolute").getBoundingClientRect().width', expected_width, tolerance, true);
26     shouldBeCloseTo('document.getElementById("span-position-relative").getBoundingClientRect().width', expected_width, tolerance, true);
27     document.getElementById("testContent").style.display = 'none';
28 </script>
29 <script src="../../resources/js-test-post.js"></script>
30 </body>
31 </html>