mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-09 02:21:53 +00:00
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.
24 lines
No EOL
766 B
HTML
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> |