aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2015-07-25 15:38:49 -0700
committerMichael Howell <michael@notriddle.com>2015-07-25 15:41:38 -0700
commit337832fde4eb82357b3ffabb121c03dfccb141fe (patch)
tree5f960fb5cb27fd13864d53564f66794332348c09
parent3af6992151b087412b2dd460d20b34fb9fc2f28f (diff)
downloadservo-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.html24
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>