servo: Merge #6774 - Check if naturalWidth / naturalHeight works w/ DPR (from notriddle:master); r=jdm

$ ./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.

Source-Repo: https://github.com/servo/servo
Source-Revision: 1eeb05d914bcec1b4839b3f0be7b13c98b711783
This commit is contained in:
Michael Howell 2015-07-27 17:13:02 -06:00
Родитель 8325a09ce0
Коммит 885f81a912
1 изменённых файлов: 24 добавлений и 0 удалений

Просмотреть файл

@ -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>