mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Ignore non-box element while collecting abspos nodes for layout
All abspos boxes are expected to be blockified, so we are certain that we can ignore non-box elements when collecting abspos nodes for layout. Fixes a crash caused by an attempt to cast a BreakNode to a Box while performing abspos layout.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
d856858015
commit
275985ff3d
Notes:
github-actions[bot]
2025-03-26 00:18:54 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/275985ff3d2 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4091 Reviewed-by: https://github.com/gmta ✅
@@ -1329,7 +1329,7 @@ void Document::update_layout(UpdateLayoutReason reason)
|
||||
});
|
||||
|
||||
// Assign each box that establishes a formatting context a list of absolutely positioned children it should take care of during layout
|
||||
m_layout_root->for_each_in_inclusive_subtree([&](auto& child) {
|
||||
m_layout_root->for_each_in_inclusive_subtree_of_type<Layout::Box>([&](auto& child) {
|
||||
if (!child.is_absolutely_positioned())
|
||||
return TraversalDecision::Continue;
|
||||
if (auto* containing_block = child.containing_block()) {
|
||||
|
||||
Reference in New Issue
Block a user