blob: 8c541b259643c508dc853ea1d2715de3e733392f [file] [log] [blame]
<html>
<head>
<style>
.lr { -webkit-writing-mode:vertical-lr; background-color:green; width:100px; height:100px; position:relative; top:50%; }
</style>
</head>
<body>
This is a test that relative position percentages are computed with respect to physical dimensions.
<div style="width:300px; height:100px;border:2px solid black">
<div class="lr" id="test"></div>
</div>
<div id="console" style="position:relative;top:100px"></div>
<script>
if (window.testRunner)
window.testRunner.dumpAsText();
test = document.getElementById("test");
rect = test.getBoundingClientRect();
parentRect = test.parentNode.getBoundingClientRect();
if (rect.top - parentRect.top != 52) {
document.getElementById('console').innerHTML = "FAIL: The block should be at a y-offset of 52.";
test.style.backgroundColor = 'red';
} else
document.getElementById('console').innerHTML = "PASS: The block is in the correct position.";
</script>
</body>