LibWeb: Avoid unnecessary sorting work when getting animations

This way, the list is not re-sorted on every recursive call.
This commit is contained in:
Psychpsyo 2025-11-20 16:18:15 +01:00 committed by Jelle Raaijmakers
parent 1abc91ccc6
commit 693dd7b6f6
Notes: github-actions[bot] 2025-11-26 21:20:28 +00:00
6 changed files with 26 additions and 11 deletions

View file

@ -23,6 +23,7 @@
#include <LibGfx/Font/Typeface.h>
#include <LibGfx/Font/WOFF/Loader.h>
#include <LibGfx/Font/WOFF2/Loader.h>
#include <LibWeb/Animations/Animatable.h>
#include <LibWeb/Animations/AnimationEffect.h>
#include <LibWeb/Animations/DocumentTimeline.h>
#include <LibWeb/Bindings/PrincipalHostDefined.h>
@ -2573,7 +2574,9 @@ GC::Ref<ComputedProperties> StyleComputer::compute_properties(DOM::AbstractEleme
// 5. Add or modify CSS-defined animations
process_animation_definitions(computed_style, abstract_element);
auto animations = abstract_element.element().get_animations_internal(Animations::GetAnimationsOptions { .subtree = false });
auto animations = abstract_element.element().get_animations_internal(
Animations::Animatable::GetAnimationsSorted::Yes,
Animations::GetAnimationsOptions { .subtree = false });
if (animations.is_exception()) {
dbgln("Error getting animations for element {}", abstract_element.debug_description());
} else {