blob: 2153ebac008f884f6f0436c59b58896b1e5eb339 [file] [log] [blame]
<!DOCTYPE html>
<title>Image should return a size of 250x166 regardless of zoom level.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<div style="height:166px; width:250px; overflow:hidden;">
<img src="resources/green-256x256.jpg" style="width: 100%; height:100%">
<script>
test(function() {
var imageElement = document.querySelector('img');
var wrapElement = document.querySelector('div');
function testSize(zoomLevel) {
document.body.style.zoom = zoomLevel;
assert_equals(imageElement.offsetWidth, 250);
assert_equals(imageElement.offsetHeight, 166);
assert_equals(wrapElement.offsetWidth, 250);
assert_equals(wrapElement.offsetHeight, 166);
}
for (var i = 90; i <= 200; i += 5)
testSize(i/100);
document.body.style.zoom = 1.0;
});
</script>