Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/embedded-content/the-video-element/video-loading-lazy-window-onload.tentative.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<link rel="author" title="Squarespace" href="https://www.squarespace.com/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<video
id="target"
src="/media/A4.webm?pipe=trickle(d2)"
loading="lazy"
></video>
<script>
async_test(t => {
const video = document.getElementById("target");
window.addEventListener("load", t.step_func_done(() => {
assert_less_than(
video.readyState,
video.HAVE_CURRENT_DATA,
"Video should not have finished loading before window.onload fired"
);
}));
}, "Video with loading=lazy does not delay window onload event");
</script>