Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / sub-pixel / size-of-span-with-different-positions.html
blob812bc25a70bfd7b0b967acf692d20cf78f4d2e6d
1 <html>
2 <head>
3 <style>
4 .testContent {
5 font-face: Arial; font-size: 16px;
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.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;
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 </body>
30 </html>