Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6d8c2b54d9cb3d30bbda66c5e99a72509fdc0e86
      
https://github.com/WebKit/WebKit/commit/6d8c2b54d9cb3d30bbda66c5e99a72509fdc0e86
  Author: Antoine Quint <[email protected]>
  Date:   2025-11-15 (Sat, 15 Nov 2025)

  Changed paths:
    M Source/WebCore/animation/KeyframeEffectStack.cpp
    M Source/WebCore/animation/KeyframeEffectStack.h
    M Source/WebCore/style/Styleable.cpp

  Log Message:
  -----------
  [web-animations] make `KeyframeEffectStack::sortedEffects()` return a const 
reference
https://bugs.webkit.org/show_bug.cgi?id=302566

Reviewed by Alan Baradlay.

`KeyframeEffectStack` offers a single way to iterate over its effects, its 
`sortedEffects()`
method. However, this method returns a copy of the effects, always, but most 
call sites can
use a const reference of the effects. So we modify the return value to be a 
const reference
and make an explicit copy when it's required in `applyKeyframeEffects()`.

Additionally, since `ensureEffectsAreSorted()` was only used within 
`sortedEffects()`, we
remove it and integrate it within its single caller.

* Source/WebCore/animation/KeyframeEffectStack.cpp:
(WebCore::KeyframeEffectStack::sortedEffects):
(WebCore::KeyframeEffectStack::applyKeyframeEffects):
(WebCore::KeyframeEffectStack::ensureEffectsAreSorted): Deleted.
* Source/WebCore/animation/KeyframeEffectStack.h:
* Source/WebCore/style/Styleable.cpp:
(WebCore::keyframeEffectForElementAndProperty):

Canonical link: https://commits.webkit.org/303073@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to