mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
LibWeb: Don't drop layout tree in CSS animation invalidation
It's possible to do a partial tree rebuild instead.
This commit is contained in:
parent
067d21b8a4
commit
268143681e
Notes:
github-actions[bot]
2025-03-08 23:07:20 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/268143681e4 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3863 Reviewed-by: https://github.com/awesomekling ✅
2 changed files with 9 additions and 3 deletions
|
@ -963,8 +963,15 @@ void KeyframeEffect::update_computed_properties()
|
|||
|
||||
if (invalidation.relayout)
|
||||
target->set_needs_layout_update(DOM::SetNeedsLayoutReason::KeyframeEffect);
|
||||
if (invalidation.rebuild_layout_tree)
|
||||
document.invalidate_layout_tree(DOM::InvalidateLayoutTreeReason::KeyframeEffect);
|
||||
if (invalidation.rebuild_layout_tree) {
|
||||
// We mark layout tree for rebuild starting from parent element to correctly invalidate
|
||||
// "display" property change to/from "contents" value.
|
||||
if (auto* parent_element = target->parent_element()) {
|
||||
parent_element->set_needs_layout_tree_update(true);
|
||||
} else {
|
||||
target->set_needs_layout_tree_update(true);
|
||||
}
|
||||
}
|
||||
if (invalidation.repaint) {
|
||||
document.set_needs_display();
|
||||
document.set_needs_to_resolve_paint_only_properties();
|
||||
|
|
|
@ -55,7 +55,6 @@ enum class QuirksMode {
|
|||
X(DocumentRequestAnElementToBeRemovedFromTheTopLayer) \
|
||||
X(HTMLInputElementSrcAttributeChange) \
|
||||
X(HTMLObjectElement) \
|
||||
X(KeyframeEffect) \
|
||||
X(SVGGraphicsElementTransformAttributeChange) \
|
||||
X(ShadowRootSetInnerHTML)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue