mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Allow anonymous layout boxes to keep their intrinsic size cache
Instead of indiscriminately clearing the cache for all anonymous boxes, we now only clear it for those that were generated by a non-anonymous box in need of layout update. This increases the cache hit rate and allows us to avoid more work.
This commit is contained in:
parent
3ca38505fa
commit
fa9c463ffd
Notes:
github-actions[bot]
2025-04-20 22:32:08 +00:00
Author: https://github.com/awesomekling
Commit: fa9c463ffd
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4411
3 changed files with 15 additions and 1 deletions
|
@ -1332,7 +1332,7 @@ void Document::update_layout(UpdateLayoutReason reason)
|
|||
if (auto dom_node = child.dom_node(); dom_node && dom_node->is_element()) {
|
||||
child.set_has_size_containment(as<Element>(*dom_node).has_size_containment());
|
||||
}
|
||||
if (child.needs_layout_update() || child.is_anonymous()) {
|
||||
if (child.needs_layout_update()) {
|
||||
child.reset_cached_intrinsic_sizes();
|
||||
}
|
||||
child.clear_contained_abspos_children();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue