LibWeb: Make transition order consider property name

class_specific_composite_order() also has no reason to return an
Optional<int>, since it can just return 0.
This commit is contained in:
Psychpsyo 2025-11-11 11:45:36 +01:00 committed by Jelle Raaijmakers
parent 1df94c4513
commit 2c4f2a3cb6
Notes: github-actions[bot] 2025-11-11 12:48:13 +00:00
8 changed files with 36 additions and 12 deletions

View file

@ -108,7 +108,7 @@ public:
void set_owning_element(GC::Ptr<DOM::Element> value) { m_owning_element = value; }
virtual AnimationClass animation_class() const { return AnimationClass::None; }
virtual Optional<int> class_specific_composite_order(GC::Ref<Animation>) const { return {}; }
virtual int class_specific_composite_order(GC::Ref<Animation>) const { return 0; }
unsigned int global_animation_list_order() const { return m_global_animation_list_order; }

View file

@ -647,8 +647,8 @@ int KeyframeEffect::composite_order(GC::Ref<KeyframeEffect> a, GC::Ref<KeyframeE
// 2. If A and B are still not sorted, sort by any class-specific composite order defined by the common class of
// A and Bs associated animations.
if (auto order = a_animation->class_specific_composite_order(*b_animation); order.has_value())
return order.value();
if (auto order = a_animation->class_specific_composite_order(*b_animation); order != 0)
return order;
// 3. If A and B are still not sorted, sort by the position of their associated animations in the global
// animation list.