mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
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.
This commit is contained in:
committed by
Alexander Kalenik
parent
ea8a6b43f7
commit
3e1d718b7f
Notes:
github-actions[bot]
2025-04-14 15:10:55 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/3e1d718b7ff Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4343
@@ -0,0 +1,24 @@
|
||||
<!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>
|
||||
Reference in New Issue
Block a user