mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +00: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:
parent
d856858015
commit
275985ff3d
Notes:
github-actions[bot]
2025-03-26 00:18:54 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 275985ff3d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4091
Reviewed-by: https://github.com/gmta ✅
3 changed files with 18 additions and 1 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue