mirror of
https://github.com/servo/servo.git
synced 2025-06-28 11:03:39 +01:00
36 lines
1.3 KiB
HTML
36 lines
1.3 KiB
HTML
<!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>
|