Auto merge of #6774 - notriddle:master, r=jdm

Check if naturalWidth / naturalHeight works w/ DPR

    $ ./mach run --device-pixel-ratio=1 tests/html/get-natural-height.html
    ALERT: width: 600, height: 254
    $ ./mach run --device-pixel-ratio=2 tests/html/get-natural-height.html
    ALERT: width: 600, height: 254
    $ ./mach run --device-pixel-ratio=.5 tests/html/get-natural-height.html
    ALERT: width: 600, height: 254

It doesn't. Answers #6769.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6774)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-07-27 17:13:02 -06:00
commit 1eeb05d914

View file

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<style>
div {
font-size: 4em;
}
</style>
</head>
<body>
<img id="test-image" src="longcattop.png">
<div id="test-output"></div>
<script>
var testImage = document.getElementById('test-image');
var testOutput = document.getElementById('test-output');
testImage.onload = function() {
testOutput.innerHTML =
"width: " + testImage.naturalWidth + ", " +
"height: " + testImage.naturalHeight;
alert(testOutput.innerHTML);
};
</script>
</body>
</html>