Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!DOCTYPE html>
<link rel="author" title="Squarespace" href="https://www.squarespace.com/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
.below-viewport {
margin-top: 1000vh;
}
</style>
<body>
<script>
const t = async_test(
"Video with loading=lazy that is not visible in viewport does not load poster image"
);
const video = document.createElement("video");
video.loading = "lazy";
video.src = "/media/A4.webm";
video.poster = "/media/1x1-green.png?t=" + Date.now();
video.className = "below-viewport";
const posterUrl = new URL(video.poster, location.href).href;
document.body.appendChild(video);
t.step_timeout(() => {
const entries = performance.getEntriesByName(posterUrl);
assert_equals(entries.length, 0, "No network requests should be made for poster image");
t.done();
}, 1000);
</script>
</body>