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/remove-element-and-scroll.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/remove-element-and-scroll.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/embedded-content/the-img-element/remove-element-and-scroll.html | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/remove-element-and-scroll.html b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/remove-element-and-scroll.html new file mode 100644 index 0000000000..8e7fa1bfbf --- /dev/null +++ b/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/remove-element-and-scroll.html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<head> + <title>Images with loading='lazy' load being removed and then scrolled to</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="common.js"></script> +</head> + +<body> + <img id="in_viewport" src='resources/image.png?in_viewport&pipe=trickle(d1)'> + <div style="height:1000vh"></div> + <div id="below_viewport_div"></div> + <img id="below_viewport" src='resources/image.png?below_viewport' loading="lazy"> + + <script> + const in_viewport_element = document.getElementById("in_viewport"); + const below_viewport_element = document.getElementById("below_viewport"); + const below_viewport_div = document.getElementById("below_viewport_div"); + + async_test(t => { + below_viewport_element.onload = t.unreached_func("Removed loading=lazy image " + + "should not load when its old position is scrolled to."); + below_viewport_element.remove(); + + in_viewport_element.onload = () => { + below_viewport_div.scrollIntoView(); + t.step_timeout(t.step_func_done(), 2000); + }; + }, "Test that <img> below viewport is not loaded when removed from the " + + "document and then scrolled to"); + </script> +</body> |