mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00:00
LibWeb: Reset a vector of contained abspos before collecting them again
Fixes a bug when a vector with contained absolutely positioned boxes keeps growing, resulting in more duplicated work on each subsequent layout.
This commit is contained in:
parent
c2cf65adac
commit
6199870528
Notes:
github-actions[bot]
2024-09-13 14:49:41 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 6199870528
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1392
2 changed files with 5 additions and 0 deletions
|
@ -1132,6 +1132,10 @@ void Document::update_layout()
|
|||
}
|
||||
|
||||
// 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_of_type<Layout::Box>([&](auto& child) {
|
||||
child.clear_contained_abspos_children();
|
||||
return TraversalDecision::Continue;
|
||||
});
|
||||
m_layout_root->for_each_in_inclusive_subtree([&](auto& child) {
|
||||
if (!child.is_absolutely_positioned())
|
||||
return TraversalDecision::Continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue