Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/embedded-content/the-img-element/disconnected-image-loading-lazy.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
async_test(t => {
x = new Image();
x.loading = "auto";
x.src = "resources/image.png?auto";
x.onload = t.step_func_done();
t.step_timeout(t.unreached_func("Disconnected loading=auto image loads " +
"successfully, and doesn't timeout"), 2000);
}, "loading=auto for disconnected image");
async_test(t => {
x = new Image();
x.loading = "eager";
x.src = "resources/image.png?eager";
x.onload = t.step_func_done();
t.step_timeout(t.unreached_func("Disconnected loading=eager image loads " +
"successfully, and doesn't timeout"), 2000);
}, "loading=eager for disconnected image");
async_test(t => {
x = new Image();
x.loading = "lazy";
x.src = "resources/image.png?lazy";
x.onload = t.unreached_func("Disconnected loading=lazy image loads lazily.");
t.step_timeout(t.step_func_done(), 2000);
}, "loading=lazy for disconnected image");
</script>
</body>