blob: 5b9de67bbcf7295f4c1adf4b2c0069c0728e65f5 [file] [log] [blame]
<html>
<head>
<script>
function testRects()
{
if (!window.testRunner || !window.eventSender || !window.internals)
return;
testRunner.dumpAsText();
var range = document.createRange();
range.selectNode(document.getElementById('div'));
var rect = range.getBoundingClientRect();
internals.setPageScaleFactor(2);
var scaledRange = document.createRange();
scaledRange.selectNode(document.getElementById('div'));
var scaledRect = scaledRange.getBoundingClientRect();
var result = document.getElementById("result");
if (rect.width && rect.height &&
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>