1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 13:55:08 +00:00
serenity/Tests/LibWeb/Text/input/IntersectionObserver/img-lazy-loading-not-blocked-by-img-outside-viewport.html
Andreas Kling fe04d83ef5 LibWeb: Process all pending lazy loading intersection observations
This fixes an issue where images outside the viewport could prevent
loading of images inside the viewport, depending on DOM order.
2023-12-24 13:23:40 +01:00

19 lines
953 B
HTML

<!doctype html><style>
img {
border: 1px solid black;
width: 30px;
height: 30px;
}
/* This element will not be visible in the viewport */
#notInViewport {
position: relative;
top: -1000px;
}
</style><body><img id="notInViewport" loading="lazy" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAAUElEQVRo3u3PQQ0AMAgEsGP+xeEIVOxB0jpodSaXvRwnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg8N8ChgACTxD8p8QAAAAASUVORK5CYII="><img id="inViewport" loading="lazy" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAAUElEQVRo3u3PQQ0AMAgEsGP+xeEIVOxB0jpodSaXvRwnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg8N8ChgACTxD8p8QAAAAASUVORK5CYII=">
<script>
const inViewport = document.getElementById("inViewport");
inViewport.addEventListener("load", function() {
document.body.innerHTML = "PASS";
internals.signalTextTestIsDone();
});
</script>