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/sizes/sizes-dynamic-001.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/sizes/sizes-dynamic-001.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/embedded-content/the-img-element/sizes/sizes-dynamic-001.html | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/sizes/sizes-dynamic-001.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/sizes/sizes-dynamic-001.html new file mode 100644 index 0000000000..51f8145bf9 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/sizes/sizes-dynamic-001.html @@ -0,0 +1,20 @@ +<!doctype html> +<html class="reftest-wait"> +<title>Image intrinsic size specified via sizes attribute reacts properly to media changes</title> +<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> +<link rel="match" href="sizes-dynamic-001-ref.html"> +<link rel="help" href="https://html.spec.whatwg.org/#sizes-attributes"> +<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1149357"> +<script> +function frameLoaded(frame) { + frame.width = "500"; + let img = frame.contentDocument.querySelector('img'); + + // Trigger the viewport resize, which will trigger the image load task. + img.offsetWidth; + + // Wait for the image load task to run. + setTimeout(() => document.documentElement.removeAttribute("class"), 0); +} +</script> +<iframe onload="frameLoaded(this)" width="200" height="500" srcdoc='<!doctype html><img srcset="/images/green-256x256.png 100w" style="max-width: 100%" sizes="(min-width: 400px) 10px, 20px">'></iframe> |