mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Change animation to schedule repaint only when necessary
Animation should trigger repaint only if it's required by animated style update.
This commit is contained in:
parent
d94906fa1a
commit
a5e4a51b52
Notes:
github-actions[bot]
2025-02-05 13:44:48 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: a5e4a51b52
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3447
3 changed files with 3 additions and 7 deletions
|
@ -1331,9 +1331,6 @@ void Animation::invalidate_effect()
|
|||
|
||||
if (auto* target = m_effect->target(); target) {
|
||||
target->document().set_needs_animated_style_update();
|
||||
if (target->paintable()) {
|
||||
target->paintable()->set_needs_display();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -961,8 +961,10 @@ void KeyframeEffect::update_computed_properties()
|
|||
document.set_needs_layout();
|
||||
if (invalidation.rebuild_layout_tree)
|
||||
document.invalidate_layout_tree();
|
||||
if (invalidation.repaint)
|
||||
if (invalidation.repaint) {
|
||||
document.set_needs_display();
|
||||
document.set_needs_to_resolve_paint_only_properties();
|
||||
}
|
||||
if (invalidation.rebuild_stacking_context_tree)
|
||||
document.invalidate_stacking_context_tree();
|
||||
}
|
||||
|
|
|
@ -2646,9 +2646,6 @@ void Document::dispatch_events_for_animation_if_necessary(GC::Ref<Animations::An
|
|||
if (!target)
|
||||
return;
|
||||
|
||||
if (target->paintable())
|
||||
target->paintable()->set_needs_display();
|
||||
|
||||
auto previous_phase = effect->previous_phase();
|
||||
auto current_phase = effect->phase();
|
||||
auto current_iteration = effect->current_iteration().value_or(0.0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue