ladybird/Tests/LibWeb/Text/input/IntersectionObserver/box-without-layout-node-should-not-intersect.html
Aliaksandr Kalenik 3e1d718b7f LibWeb: Ignore boxes without layout node in intersection observer steps
Check if box has associated layout node is not mentioned in the spec,
but it is required to match behavior of other browsers that do not
invoke intersection observer steps for boxes without layout node.
2025-04-14 17:01:53 +02:00

24 lines
No EOL
766 B
HTML

<!DOCTYPE html>
<script src="../include.js"></script>
<div id="container" style="height:200px; display:none">
<div id="nested"></div>
</div>
<script>
asyncTest(done => {
let observer = new IntersectionObserver(entries => {
entries.forEach(entry => {
if (entry.isIntersecting) {
println('#nested is visible');
done();
}
});
});
observer.observe(document.getElementById('nested'));
requestAnimationFrame(() => {
requestAnimationFrame(() => {
println('flip #container to visible');
document.getElementById('container').style.display = 'block';
});
});
});
</script>