blob: 812bc25a70bfd7b0b967acf692d20cf78f4d2e6d [file] [log] [blame]
<html>
<head>
<style>
.testContent {
font-face: Arial; font-size: 16px;
}
</style>
</head>
<body>
<div id="testContent">
<span id="span-position-static" style="position:static">T</span>
<span id="span-position-fixed" style="position:fixed">T</span>
<span id="span-position-absolute" style="position:absolute">T</span>
<span id="span-position-relative" style="position:relative">T</span>
</div>
<script src="../../resources/js-test.js"></script>
<script>
description("Test case for bug 90097. This tests span sizes with different CSS position attributes.");
var spans = testContent.querySelectorAll('span');
var expected_width = document.getElementById('span-position-static').getBoundingClientRect().width;
// if expected_width is integral, all should match, otherwise should be close
var tolerance = expected_width % 1.0 == 0.0 ? 0.0 : 1.0 / 60;
shouldBeCloseTo('document.getElementById("span-position-fixed").getBoundingClientRect().width', expected_width, tolerance, true);
shouldBeCloseTo('document.getElementById("span-position-absolute").getBoundingClientRect().width', expected_width, tolerance, true);
shouldBeCloseTo('document.getElementById("span-position-relative").getBoundingClientRect().width', expected_width, tolerance, true);
document.getElementById("testContent").style.display = 'none';
</script>
</body>
</html>