5 font-face: Arial; font-size:
16px;
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>
16 <script src=
"../../resources/js-test.js"></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';