mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
When walking the flat tree in HTMLElement::offset_parent(), ancestors may not have layout nodes (e.g., they have display:none). This can happen when an element is slotted into a shadow root where the slot is inside a display:none container. Guard layout_node() accesses with null checks. If an ancestor has no layout node, it cannot be positioned or establish a containing block, so it cannot be the offset parent for those reasons.