diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/html/semantics/embedded-content/the-img-element/current-pixel-density/basic.html | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/semantics/embedded-content/the-img-element/current-pixel-density/basic.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/embedded-content/the-img-element/current-pixel-density/basic.html | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/current-pixel-density/basic.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/current-pixel-density/basic.html new file mode 100644 index 0000000000..f7d47b3640 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/current-pixel-density/basic.html @@ -0,0 +1,37 @@ +<!doctype html> +<title>img current pixel density basic</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id=log></div> +<img src="/images/green-256x256.png" data-expect="256"> +<img srcset="/images/green-256x256.png 1x" data-expect="256"> +<img srcset="/images/green-256x256.png 1.6x" data-expect="160"> +<img srcset="/images/green-256x256.png 2x" data-expect="128"> +<img srcset="/images/green-256x256.png 10000x" data-expect="0"> +<img srcset="/images/green-256x256.png 9e99999999999999999999999x" data-expect="0"> +<img srcset="/images/green-256x256.png 256w" sizes="256px" data-expect="256"> +<img srcset="/images/green-256x256.png 512w" sizes="256px" data-expect="128"> +<img srcset="/images/green-256x256.png 256w" sizes="512px" data-expect="512"> +<img srcset="/images/green-256x256.png 256w" sizes="1px" data-expect="1"> +<img srcset="/images/green-256x256.png 256w" sizes="0px" data-expect="0"> +<!-- SVG --> +<img srcset="data:image/svg+xml,<svg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='-1%20-1%202%202'%20width='20'%20height='20'><circle%20r='1'/></svg> 2x" data-expect="10"> +<img srcset="data:image/svg+xml,<svg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='-1%20-1%202%202'%20width='20'><circle%20r='1'/></svg> 2x" data-expect="10"> +<img srcset="data:image/svg+xml,<svg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='-1%20-1%202%202'%20height='20'><circle%20r='1'/></svg> 2x" data-expect="10"> +<script> +setup({explicit_done:true}); +onload = function() { + [].forEach.call(document.images, function(img) { + test(function() { + var expected = parseFloat(img.dataset.expect); + assert_equals(img.width, expected, 'width'); + assert_equals(img.height, expected, 'height'); + assert_equals(img.clientWidth, expected, 'clientWidth'); + assert_equals(img.clientHeight, expected, 'clientHeight'); + assert_equals(img.naturalWidth, expected, 'naturalWidth'); + assert_equals(img.naturalHeight, expected, 'naturalHeight'); + }, img.outerHTML); + }); + done(); +}; +</script> |