Skip to content

Commit

Permalink
LibWeb: Skip keyframe animation update if target element isn't connected
Browse files Browse the repository at this point in the history
Makes some pages on Github faster as previously we had to update
animation for elements in not connected shadow trees.
  • Loading branch information
kalenikaliaksandr authored and awesomekling committed Jan 10, 2025
1 parent de062e4 commit d8b0b15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Libraries/LibWeb/Animations/KeyframeEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ static CSS::RequiredInvalidationAfterStyleChange compute_required_invalidation(H
void KeyframeEffect::update_computed_properties()
{
auto target = this->target();
if (!target)
if (!target || !target->is_connected())
return;

GC::Ptr<CSS::ComputedProperties> style = {};
Expand Down

0 comments on commit d8b0b15

Please sign in to comment.