blob: 5f206f73eb82bb9ed3e94b87481510f78164275d [file] [log] [blame]
<html>
<head>
<script>
function testRects()
{
if (!window.testRunner || !window.internals)
return;
testRunner.dumpAsText();
var range = document.createRange();
range.selectNodeContents(document.getElementById('div'));
var rect = range.getBoundingClientRect();
window.internals.setPageScaleFactor(2, 0, 0);
var scaledRange = document.createRange();
scaledRange.selectNodeContents(document.getElementById('div'));
var scaledRect = scaledRange.getBoundingClientRect();
var result = document.getElementById("result");
if (rect.left == scaledRect.left &&
rect.top == scaledRect.top &&
rect.right == scaledRect.right &&
rect.bottom == scaledRect.bottom)
result.innerHTML = "Pass";
else
result.innerHTML = "Fail";
}
</script>
</head>
<body onload="testRects();">
<div id="div" style="width:100px; height:100px; background-color:green;"></div>
<p id="result">This test must be run via DumpRenderTree.</p>
</body>
</html>