32 lines
1.4 KiB
HTML
32 lines
1.4 KiB
HTML
<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-pre.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>
|
|
<script src="../../resources/js-test-post.js"></script>
|
|
</body>
|
|
</html>
|