aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wpt/web-platform-tests/loading/lazyload/remove-element-and-scroll.tentative.html
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wpt/web-platform-tests/loading/lazyload/remove-element-and-scroll.tentative.html')
-rw-r--r--tests/wpt/web-platform-tests/loading/lazyload/remove-element-and-scroll.tentative.html36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/wpt/web-platform-tests/loading/lazyload/remove-element-and-scroll.tentative.html b/tests/wpt/web-platform-tests/loading/lazyload/remove-element-and-scroll.tentative.html
new file mode 100644
index 00000000000..53708ceac75
--- /dev/null
+++ b/tests/wpt/web-platform-tests/loading/lazyload/remove-element-and-scroll.tentative.html
@@ -0,0 +1,36 @@
+<!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>
+
+<!--
+Marked as tentative until https://github.com/whatwg/html/pull/3752 is landed.
+-->
+
+<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>