LibWeb: Avoid repainting for unchanged animations

Animation updates need a rendering opportunity so current time can
advance and effects can update computed properties. They should not mark
the document as needing paint before any animated value changed.

Request a frame for pending animation style updates. The existing
AnimationUpdateContext invalidation will decide whether layout or paint
work is needed. This avoids presenting unchanged frames for infinite
animations on pages like x.com.
This commit is contained in:
Andreas Kling 2026-05-16 21:40:39 +02:00 committed by Andreas Kling
parent 28e648714d
commit d312c4f427

View file

@ -2064,7 +2064,12 @@ void Document::set_needs_animated_style_update()
return;
m_needs_animated_style_update = true;
set_needs_repaint(InvalidateDisplayList::No);
auto navigable = this->navigable();
if (navigable && navigable->has_inclusive_ancestor_with_visibility_hidden())
return;
page().client().request_frame();
}
void Document::update_paint_and_hit_testing_properties_if_needed()