diff options
author | Michael Howell <michael@notriddle.com> | 2015-07-25 15:38:49 -0700 |
---|---|---|
committer | Michael Howell <michael@notriddle.com> | 2015-07-25 15:41:38 -0700 |
commit | 337832fde4eb82357b3ffabb121c03dfccb141fe (patch) | |
tree | 5f960fb5cb27fd13864d53564f66794332348c09 | |
parent | 3af6992151b087412b2dd460d20b34fb9fc2f28f (diff) | |
download | servo-337832fde4eb82357b3ffabb121c03dfccb141fe.tar.gz servo-337832fde4eb82357b3ffabb121c03dfccb141fe.zip |
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.
-rw-r--r-- | tests/html/get-natural-height.html | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/html/get-natural-height.html b/tests/html/get-natural-height.html new file mode 100644 index 00000000000..43e427dfeab --- /dev/null +++ b/tests/html/get-natural-height.html @@ -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> |