Implement iterationComposite for CSS animations [chromium/src : main]

113 views
Skip to first unread message

Felipe Erias (Gerrit)

unread,
Oct 24, 2025, 3:28:15 AMOct 24
to Robert Flack, Kevin Ellis, Alan Cutter, Stephen McGruer, David Awogbemila, Chromium Metrics Reviews, chromium...@chromium.org, Chromium LUCI CQ, Alexis Menard, Kentaro Hara, Raphael Kubo da Costa, Olga Gerchikov, AyeAye, asvitkine...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-revie...@chromium.org, jmedle...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
Attention needed from Alan Cutter, David Awogbemila, Kevin Ellis, Robert Flack and Stephen McGruer

Felipe Erias added 1 comment

Patchset-level comments
File-level comment, Patchset 11 (Latest):
Felipe Erias . resolved

Hello,

This CL is an initial implementation of the iterationComposite property from Web Animations Level 2, which controls how animation values accumulate across multiple iterations.

https://drafts.csswg.org/web-animations-2/#iteration-composite-operation

I hope that the CL description provides a good starting point, but please don't hesitate to ask me to clarify any point. I have already updated the existing WPT and unit tests, and I am currently working to add additional unit tests for this feature.

Thank you for your review.

Best regards,
Felipe


https://issues.chromium.org/issues/41133485

https://chromestatus.com/feature/5198590821662720

Open in Gerrit

Related details

Attention is currently required from:
  • Alan Cutter
  • David Awogbemila
  • Kevin Ellis
  • Robert Flack
  • Stephen McGruer
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I65ccf6fd646243012ca64b5c8207246a215d1d7b
Gerrit-Change-Number: 7047878
Gerrit-PatchSet: 11
Gerrit-Owner: Felipe Erias <felip...@igalia.com>
Gerrit-Reviewer: Alan Cutter <alanc...@google.com>
Gerrit-Reviewer: David Awogbemila <awogb...@chromium.org>
Gerrit-Reviewer: Felipe Erias <felip...@igalia.com>
Gerrit-Reviewer: Kevin Ellis <kev...@chromium.org>
Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
Gerrit-Reviewer: Stephen McGruer <smcg...@chromium.org>
Gerrit-CC: Alexis Menard <alexis...@intel.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Kevin Ellis <kev...@chromium.org>
Gerrit-Attention: David Awogbemila <awogb...@chromium.org>
Gerrit-Attention: Stephen McGruer <smcg...@chromium.org>
Gerrit-Attention: Robert Flack <fla...@chromium.org>
Gerrit-Attention: Alan Cutter <alanc...@google.com>
Gerrit-Comment-Date: Fri, 24 Oct 2025 07:27:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Alan Cutter (Gerrit)

unread,
Oct 28, 2025, 12:50:56 AMOct 28
to Felipe Erias, Robert Flack, Kevin Ellis, David Awogbemila, Chromium Metrics Reviews, chromium...@chromium.org, Chromium LUCI CQ, Alexis Menard, Kentaro Hara, Raphael Kubo da Costa, Olga Gerchikov, AyeAye, asvitkine...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-revie...@chromium.org, jmedle...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
Attention needed from David Awogbemila, Felipe Erias, Kevin Ellis and Robert Flack

Alan Cutter added 1 comment

File third_party/blink/renderer/core/animation/invalidatable_interpolation.cc
Line 259, Patchset 11 (Latest):bool InvalidatableInterpolation::ApplyIterationAccumulation() const {
Alan Cutter . unresolved

Should we be using this return value?

Open in Gerrit

Related details

Attention is currently required from:
  • David Awogbemila
  • Felipe Erias
  • Kevin Ellis
  • Robert Flack
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I65ccf6fd646243012ca64b5c8207246a215d1d7b
    Gerrit-Change-Number: 7047878
    Gerrit-PatchSet: 11
    Gerrit-Owner: Felipe Erias <felip...@igalia.com>
    Gerrit-Reviewer: Alan Cutter <alanc...@google.com>
    Gerrit-Reviewer: David Awogbemila <awogb...@chromium.org>
    Gerrit-Reviewer: Felipe Erias <felip...@igalia.com>
    Gerrit-Reviewer: Kevin Ellis <kev...@chromium.org>
    Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
    Gerrit-CC: Alexis Menard <alexis...@intel.com>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Kevin Ellis <kev...@chromium.org>
    Gerrit-Attention: David Awogbemila <awogb...@chromium.org>
    Gerrit-Attention: Felipe Erias <felip...@igalia.com>
    Gerrit-Attention: Robert Flack <fla...@chromium.org>
    Gerrit-Comment-Date: Tue, 28 Oct 2025 04:50:21 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alan Cutter (Gerrit)

    unread,
    Oct 28, 2025, 12:55:10 AMOct 28
    to Felipe Erias, Robert Flack, Kevin Ellis, David Awogbemila, Chromium Metrics Reviews, chromium...@chromium.org, Chromium LUCI CQ, Alexis Menard, Kentaro Hara, Raphael Kubo da Costa, Olga Gerchikov, AyeAye, asvitkine...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-revie...@chromium.org, jmedle...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from David Awogbemila, Felipe Erias, Kevin Ellis and Robert Flack

    Alan Cutter added 2 comments

    Patchset-level comments
    Alan Cutter . resolved

    I don't count myself as an owner of this code anymore but this looks pretty good to me!

    File third_party/blink/web_tests/external/wpt/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation-expected.txt
    Line 3, Patchset 11 (Latest): assert_equals: Animated filter list at 50s of the third iteration expected "contrast(4) brightness(4)" but got "contrast(2) brightness(2)"
    Alan Cutter . unresolved

    What's going wrong for this test?

    Gerrit-Comment-Date: Tue, 28 Oct 2025 04:54:46 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Felipe Erias (Gerrit)

    unread,
    Oct 29, 2025, 8:42:59 AMOct 29
    to Kevin Ellis, Alan Cutter, David Awogbemila, Chromium Metrics Reviews, chromium...@chromium.org, Chromium LUCI CQ, Menard, Alexis, Kentaro Hara, Raphael Kubo da Costa, Olga Gerchikov, AyeAye, asvitkine...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-revie...@chromium.org, jmedle...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Alan Cutter, David Awogbemila and Kevin Ellis

    Felipe Erias added 1 comment

    File third_party/blink/renderer/core/animation/invalidatable_interpolation.cc
    Line 259, Patchset 11:bool InvalidatableInterpolation::ApplyIterationAccumulation() const {
    Alan Cutter . resolved

    Should we be using this return value?

    Felipe Erias

    Thank you for your review.

    Good point. That return value is unused and not particularly informative (it would be false in most cases, for different reasons) so I have removed it:

    `void InvalidatableInterpolation::ApplyIterationAccumulation() const`

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alan Cutter
    • David Awogbemila
    • Kevin Ellis
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I65ccf6fd646243012ca64b5c8207246a215d1d7b
    Gerrit-Change-Number: 7047878
    Gerrit-PatchSet: 12
    Gerrit-Owner: Felipe Erias <felip...@igalia.com>
    Gerrit-Reviewer: Alan Cutter <alanc...@google.com>
    Gerrit-Reviewer: David Awogbemila <awogb...@chromium.org>
    Gerrit-Reviewer: Felipe Erias <felip...@igalia.com>
    Gerrit-Reviewer: Kevin Ellis <kev...@chromium.org>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Kevin Ellis <kev...@chromium.org>
    Gerrit-Attention: David Awogbemila <awogb...@chromium.org>
    Gerrit-Attention: Alan Cutter <alanc...@google.com>
    Gerrit-Comment-Date: Wed, 29 Oct 2025 12:42:42 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Alan Cutter <alanc...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Alan Cutter (Gerrit)

    unread,
    Nov 4, 2025, 11:35:23 PMNov 4
    to Felipe Erias, Kevin Ellis, David Awogbemila, Chromium Metrics Reviews, chromium...@chromium.org, Chromium LUCI CQ, Menard, Alexis, Kentaro Hara, Raphael Kubo da Costa, Olga Gerchikov, AyeAye, asvitkine...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-revie...@chromium.org, jmedle...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from David Awogbemila, Felipe Erias and Kevin Ellis

    Alan Cutter added 1 comment

    Patchset-level comments
    File-level comment, Patchset 12 (Latest):
    Alan Cutter . resolved

    @kev...@chromium.org would you be okay with being primary reviewer for this CL?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • David Awogbemila
    • Felipe Erias
    • Kevin Ellis
    Gerrit-Attention: Felipe Erias <felip...@igalia.com>
    Gerrit-Comment-Date: Wed, 05 Nov 2025 04:35:00 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Kevin Ellis (Gerrit)

    unread,
    Nov 5, 2025, 9:19:05 AMNov 5
    to Felipe Erias, Alan Cutter, David Awogbemila, Chromium Metrics Reviews, chromium...@chromium.org, Chromium LUCI CQ, Menard, Alexis, Kentaro Hara, Raphael Kubo da Costa, Olga Gerchikov, AyeAye, asvitkine...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-revie...@chromium.org, jmedle...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from David Awogbemila and Felipe Erias

    Kevin Ellis added 7 comments

    File third_party/blink/renderer/core/animation/interpolable_filter.cc
    Line 300, Patchset 12 (Latest): // TODO: "grayscale", "invert" and "sepia should use a an initial value of 0.
    Kevin Ellis . unresolved
    File third_party/blink/renderer/core/animation/interpolable_value_test.cc
    Line 41, Patchset 12 (Latest): i->Interpolate(0, progress, EffectModel::kIterationCompositeReplace);
    Kevin Ellis . unresolved

    Optional nit: though preexisting "i" is an awful variable name for anything other than a loop index. Since we are here, how about we give the variable a better name.

    File third_party/blink/renderer/core/animation/interpolation_effect_test.cc
    Line 138, Patchset 12 (Latest): 0, 2, EffectModel::kIterationCompositeReplace,
    Kevin Ellis . unresolved

    Suggest we add a unit test for kIterationCompositeAccumulate.

    File third_party/blink/renderer/core/animation/invalidatable_interpolation.cc
    Line 268, Patchset 12 (Latest):
    Kevin Ellis . unresolved

    As a sanity check we DCHECK that the feature is enabled after the early return above.

    Line 281, Patchset 12 (Latest): // TODO Assumes that the property is additive (accumulation is addition).
    Kevin Ellis . unresolved

    What is to be done here? Helpful if we can flush out the remaining details. Transform accumulation won't be additive. Are there other cases?

    File third_party/blink/renderer/core/animation/keyframe_effect_model.cc
    Line 661, Patchset 12 (Latest):void KeyframeEffectModelBase::PropertySpecificKeyframeGroup::CheckIfStatic() {
    Kevin Ellis . unresolved

    This static check should indicate that the result is not static if using itertationComposite accumulate. Some background on the static optimization:

    Without static optimization:

    element.animate({ background: ['red', 'green'], ...);

    animates on the main thread as background-color is currently the only longhand property for background that is supported on the compositor. In this case, we are also animating background-position-x background-image, ... even though the value is not changing over the course of the animation. With static optimization, these constant valued properties are dropped from consideration when making the compositing decision. With iteration-composite accumulate, these properties are no longer constant valued as they would instead result in a staircase effect, jumping at each iteration boundary.

    At some point, we can likely extend to support non-replace, but for now, I don't think the added effort is justified, especially given that iterationComposite accumulate is not supported on the compositor. We still need to tweak to CheckIfStatic even though we won't be compositing since a static property does not tick on every frame on either main or the compositor. The idea is that you just need to pop the effect onto the stack at the start of the active phase and remove it at the end of the active phase. With accumulate, we need to tick every iteration (we do this anyways), but also handle the discontinuity where due to floating point quantization, we could end up on the wrong side of the step discontinuity without some fuzzy handling. We have this handling in place for step timing functions, but introduces a bit of extra bookkeeping that is likely not justified at this stage.

    A change is landing shortly to this method to mark properties as provisionally static when there are neutral keyframes. This will place you in a merge conflict, but should be simple enough the handle.

    File third_party/blink/renderer/core/animation/transition_interpolation.cc
    Line 17, Patchset 12 (Latest): EffectModel::IterationCompositeOperation iteration_composite) {
    Kevin Ellis . unresolved

    New parameters are not used. Add a TODO.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • David Awogbemila
    • Felipe Erias
    Gerrit-Attention: David Awogbemila <awogb...@chromium.org>
    Gerrit-Attention: Felipe Erias <felip...@igalia.com>
    Gerrit-Comment-Date: Wed, 05 Nov 2025 14:18:58 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Kevin Ellis (Gerrit)

    unread,
    Nov 6, 2025, 2:55:00 PMNov 6
    to Felipe Erias, Alan Cutter, David Awogbemila, Chromium Metrics Reviews, chromium...@chromium.org, Chromium LUCI CQ, Menard, Alexis, Kentaro Hara, Raphael Kubo da Costa, Olga Gerchikov, AyeAye, asvitkine...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-revie...@chromium.org, jmedle...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Alan Cutter, David Awogbemila and Felipe Erias

    Kevin Ellis added 1 comment

    Patchset-level comments
    Alan Cutter . resolved

    @kev...@chromium.org would you be okay with being primary reviewer for this CL?

    Kevin Ellis

    Sure thing!

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alan Cutter
    • David Awogbemila
    • Felipe Erias
    Gerrit-Attention: Alan Cutter <alanc...@google.com>
    Gerrit-Attention: Felipe Erias <felip...@igalia.com>
    Gerrit-Comment-Date: Thu, 06 Nov 2025 19:54:54 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Alan Cutter <alanc...@google.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Felipe Erias (Gerrit)

    unread,
    Nov 19, 2025, 5:14:32 AM (5 days ago) Nov 19
    to David Awogbemila, Alan Cutter, Kevin Ellis, Chromium Metrics Reviews, chromium...@chromium.org, Chromium LUCI CQ, Menard, Alexis, Kentaro Hara, Raphael Kubo da Costa, Olga Gerchikov, AyeAye, asvitkine...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-revie...@chromium.org, jmedle...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Alan Cutter and Kevin Ellis

    Felipe Erias added 8 comments

    Patchset-level comments
    File-level comment, Patchset 15 (Latest):
    Felipe Erias . resolved

    Thank you very much for your feedback. I have rebased the CL and implemented the suggested changes.

    File third_party/blink/renderer/core/animation/interpolable_filter.cc
    Line 300, Patchset 12: // TODO: "grayscale", "invert" and "sepia should use a an initial value of 0.
    Kevin Ellis . unresolved

    TODO(crbug.com/.....);

    Felipe Erias

    The new method `Scale()` uses the correct default value for interpolation.

    This bug still affects the existing `Add()` method, used by `animation-composition: accumulate`, so I have opened crbug.com/461845655

    File third_party/blink/renderer/core/animation/interpolable_value_test.cc
    Line 41, Patchset 12: i->Interpolate(0, progress, EffectModel::kIterationCompositeReplace);
    Kevin Ellis . resolved

    Optional nit: though preexisting "i" is an awful variable name for anything other than a loop index. Since we are here, how about we give the variable a better name.

    Felipe Erias

    Replaced with `interpolation`.

    File third_party/blink/renderer/core/animation/interpolation_effect_test.cc
    Line 138, Patchset 12: 0, 2, EffectModel::kIterationCompositeReplace,
    Kevin Ellis . unresolved

    Suggest we add a unit test for kIterationCompositeAccumulate.

    Felipe Erias

    I have added unit tests for this feature.

    In doing so, I found out that this implementation is incorrect when we use multiple keyframes. The reason is that three or more keyframes cause the interpolation to be split into separate segments.

    With `iterationComposite:accumulate`, each segment should be added the end keyframe of the previous iteration of the overall animation, but currently there isn't a simple way to get that information. I am still working on it.


    ```css
    @keyframes zIndexTest {
    0% { z-index: 0; }
    50% { z-index: 50; }
    100% { z-index: 100; }
    }
    .element {
    animation-name: zIndexTest;
    animation-duration: 1s;
    animation-iteration-count: 2;
    animation-iteration-composite: accumulate;
    }

    // value at t=1250ms should be 125
    ```

    File third_party/blink/renderer/core/animation/invalidatable_interpolation.cc
    Line 268, Patchset 12:
    Kevin Ellis . resolved

    As a sanity check we DCHECK that the feature is enabled after the early return above.

    Felipe Erias

    Done

    Line 281, Patchset 12: // TODO Assumes that the property is additive (accumulation is addition).
    Kevin Ellis . unresolved

    What is to be done here? Helpful if we can flush out the remaining details. Transform accumulation won't be additive. Are there other cases?

    Felipe Erias

    I've removed the `TODO` because it can be misleading. This code does not really "assume" anything but simply delegates to the subclass of `InterpolableValue` which will carry out the appropriate logic,

    File third_party/blink/renderer/core/animation/keyframe_effect_model.cc
    Line 661, Patchset 12:void KeyframeEffectModelBase::PropertySpecificKeyframeGroup::CheckIfStatic() {
    Kevin Ellis . unresolved

    This static check should indicate that the result is not static if using itertationComposite accumulate. Some background on the static optimization:

    Without static optimization:

    element.animate({ background: ['red', 'green'], ...);

    animates on the main thread as background-color is currently the only longhand property for background that is supported on the compositor. In this case, we are also animating background-position-x background-image, ... even though the value is not changing over the course of the animation. With static optimization, these constant valued properties are dropped from consideration when making the compositing decision. With iteration-composite accumulate, these properties are no longer constant valued as they would instead result in a staircase effect, jumping at each iteration boundary.

    At some point, we can likely extend to support non-replace, but for now, I don't think the added effort is justified, especially given that iterationComposite accumulate is not supported on the compositor. We still need to tweak to CheckIfStatic even though we won't be compositing since a static property does not tick on every frame on either main or the compositor. The idea is that you just need to pop the effect onto the stack at the start of the active phase and remove it at the end of the active phase. With accumulate, we need to tick every iteration (we do this anyways), but also handle the discontinuity where due to floating point quantization, we could end up on the wrong side of the step discontinuity without some fuzzy handling. We have this handling in place for step timing functions, but introduces a bit of extra bookkeeping that is likely not justified at this stage.

    A change is landing shortly to this method to mark properties as provisionally static when there are neutral keyframes. This will place you in a merge conflict, but should be simple enough the handle.

    Felipe Erias

    Thank you for the explanation.

    Since this code is in an internal class, I have changed the signature of the method so it can take `iterationComposite` into account:

    ```
    void CheckIfStatic(IterationCompositeOperation iteration_composite);
    ```

    File third_party/blink/renderer/core/animation/transition_interpolation.cc
    Line 17, Patchset 12: EffectModel::IterationCompositeOperation iteration_composite) {
    Kevin Ellis . unresolved

    New parameters are not used. Add a TODO.

    Felipe Erias

    I've added a "note" instead, since this is an intentional decision and not something that needs to be fixed later.

    ```
    // Note: iteration_composite is unused since transitions don't iterate.
    // This parameter exists to conform with the interface in Interpolation.
    ```

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Alan Cutter
    • Kevin Ellis
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I65ccf6fd646243012ca64b5c8207246a215d1d7b
    Gerrit-Change-Number: 7047878
    Gerrit-PatchSet: 15
    Gerrit-Owner: Felipe Erias <felip...@igalia.com>
    Gerrit-Reviewer: Felipe Erias <felip...@igalia.com>
    Gerrit-Reviewer: Kevin Ellis <kev...@chromium.org>
    Gerrit-CC: Alan Cutter <alanc...@google.com>
    Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
    Gerrit-CC: David Awogbemila <awogb...@chromium.org>
    Gerrit-CC: Kentaro Hara <har...@chromium.org>
    Gerrit-CC: Menard, Alexis <alexis...@intel.com>
    Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
    Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
    Gerrit-Attention: Kevin Ellis <kev...@chromium.org>
    Gerrit-Attention: Alan Cutter <alanc...@google.com>
    Gerrit-Comment-Date: Wed, 19 Nov 2025 10:13:56 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Kevin Ellis <kev...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Kevin Ellis (Gerrit)

    unread,
    Nov 20, 2025, 11:26:59 AM (3 days ago) Nov 20
    to Felipe Erias, David Awogbemila, Alan Cutter, Chromium Metrics Reviews, chromium...@chromium.org, Chromium LUCI CQ, Menard, Alexis, Kentaro Hara, Raphael Kubo da Costa, Olga Gerchikov, AyeAye, asvitkine...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-revie...@chromium.org, jmedle...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Felipe Erias

    Kevin Ellis added 6 comments

    File third_party/blink/renderer/core/animation/interpolable_filter.cc
    Line 300, Patchset 12: // TODO: "grayscale", "invert" and "sepia should use a an initial value of 0.
    Kevin Ellis . resolved

    TODO(crbug.com/.....);

    Felipe Erias

    The new method `Scale()` uses the correct default value for interpolation.

    This bug still affects the existing `Add()` method, used by `animation-composition: accumulate`, so I have opened crbug.com/461845655

    Kevin Ellis

    Acknowledged

    File third_party/blink/renderer/core/animation/interpolation_effect_test.cc
    Line 138, Patchset 12: 0, 2, EffectModel::kIterationCompositeReplace,
    Kevin Ellis . unresolved

    Suggest we add a unit test for kIterationCompositeAccumulate.

    Felipe Erias

    I have added unit tests for this feature.

    In doing so, I found out that this implementation is incorrect when we use multiple keyframes. The reason is that three or more keyframes cause the interpolation to be split into separate segments.

    With `iterationComposite:accumulate`, each segment should be added the end keyframe of the previous iteration of the overall animation, but currently there isn't a simple way to get that information. I am still working on it.


    ```css
    @keyframes zIndexTest {
    0% { z-index: 0; }
    50% { z-index: 50; }
    100% { z-index: 100; }
    }
    .element {
    animation-name: zIndexTest;
    animation-duration: 1s;
    animation-iteration-count: 2;
    animation-iteration-composite: accumulate;
    }

    // value at t=1250ms should be 125
    ```

    Kevin Ellis

    OK. How about we mark the CL as WIP until the issue is addressed.

    File third_party/blink/renderer/core/animation/invalidatable_interpolation.cc
    Line 281, Patchset 12: // TODO Assumes that the property is additive (accumulation is addition).
    Kevin Ellis . resolved

    What is to be done here? Helpful if we can flush out the remaining details. Transform accumulation won't be additive. Are there other cases?

    Felipe Erias

    I've removed the `TODO` because it can be misleading. This code does not really "assume" anything but simply delegates to the subclass of `InterpolableValue` which will carry out the appropriate logic,

    Kevin Ellis

    Acknowledged

    File third_party/blink/renderer/core/animation/keyframe_effect_model.cc
    Line 504, Patchset 15 (Latest): entry.value->CheckIfStatic(iteration_composite_);
    Kevin Ellis . unresolved

    No need to pass in a data member as an argument since CheckIfStatic is not a static method.

    Line 745, Patchset 15 (Latest): if (iteration_composite ==
    Kevin Ellis . unresolved

    iteration_composite_ and drop the parameter.

    File third_party/blink/renderer/core/animation/transition_interpolation.cc
    Line 17, Patchset 12: EffectModel::IterationCompositeOperation iteration_composite) {
    Kevin Ellis . resolved

    New parameters are not used. Add a TODO.

    Felipe Erias

    I've added a "note" instead, since this is an intentional decision and not something that needs to be fixed later.

    ```
    // Note: iteration_composite is unused since transitions don't iterate.
    // This parameter exists to conform with the interface in Interpolation.
    ```

    Kevin Ellis

    Acknowledged

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Felipe Erias
    Gerrit-Attention: Felipe Erias <felip...@igalia.com>
    Gerrit-Comment-Date: Thu, 20 Nov 2025 16:26:54 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Kevin Ellis <kev...@chromium.org>
    Comment-In-Reply-To: Felipe Erias <felip...@igalia.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Felipe Erias (Gerrit)

    unread,
    Nov 21, 2025, 6:51:22 AM (2 days ago) Nov 21
    to David Awogbemila, Alan Cutter, Kevin Ellis, Chromium Metrics Reviews, chromium...@chromium.org, Chromium LUCI CQ, Menard, Alexis, Kentaro Hara, Raphael Kubo da Costa, Olga Gerchikov, AyeAye, asvitkine...@chromium.org, android-web...@chromium.org, ashleynewson+w...@chromium.org, kinuko...@chromium.org, blink-revie...@chromium.org, jmedle...@chromium.org, blink-revie...@chromium.org, blink-revie...@chromium.org, blink-...@chromium.org
    Attention needed from Kevin Ellis

    Felipe Erias added 4 comments

    Patchset-level comments
    Felipe Erias . resolved

    Thank you for your review. as mentioned below, I will mark the CL as WIP while I implement the missing functionality.

    File third_party/blink/renderer/core/animation/interpolation_effect_test.cc
    Line 138, Patchset 12: 0, 2, EffectModel::kIterationCompositeReplace,
    Kevin Ellis . unresolved

    Suggest we add a unit test for kIterationCompositeAccumulate.

    Felipe Erias

    I have added unit tests for this feature.

    In doing so, I found out that this implementation is incorrect when we use multiple keyframes. The reason is that three or more keyframes cause the interpolation to be split into separate segments.

    With `iterationComposite:accumulate`, each segment should be added the end keyframe of the previous iteration of the overall animation, but currently there isn't a simple way to get that information. I am still working on it.


    ```css
    @keyframes zIndexTest {
    0% { z-index: 0; }
    50% { z-index: 50; }
    100% { z-index: 100; }
    }
    .element {
    animation-name: zIndexTest;
    animation-duration: 1s;
    animation-iteration-count: 2;
    animation-iteration-composite: accumulate;
    }

    // value at t=1250ms should be 125
    ```

    Kevin Ellis

    OK. How about we mark the CL as WIP until the issue is addressed.

    Felipe Erias

    Yes, I will do so.

    Do you have any thoughts or suggestions regarding the best approach to add support for multiple keyframes?

    File third_party/blink/renderer/core/animation/keyframe_effect_model.cc
    Line 504, Patchset 15 (Latest): entry.value->CheckIfStatic(iteration_composite_);
    Kevin Ellis . unresolved

    No need to pass in a data member as an argument since CheckIfStatic is not a static method.

    Felipe Erias

    The problem is that `PropertySpecificKeyframeGroup` can not access non-static members of its outer class.

    This means that there isn't a straightforward way to reach `iteration_composite_` or `IterationComposite()` from within `CheckIfStatic()`.

    As fas as I can see, currently our main options are:

    • `PropertySpecificKeyframeGroup` keeps a pointer to its `KeyframeEffectModelBase` owner and calls `owner_->IterationComposite()` when needed
    • `CheckIfStatic()` receives `iteration_composite` as a parameter
    Line 745, Patchset 15 (Latest): if (iteration_composite ==
    Kevin Ellis . unresolved

    iteration_composite_ and drop the parameter.

    Felipe Erias
    ```cpp
    if (iteration_composite_ ==
    IterationCompositeOperation::kIterationCompositeAccumulate) {
    ```

    fails to compile with

    Use of non-static data member 'iteration_composite_' of 'KeyframeEffectModelBase' from nested type 'PropertySpecificKeyframeGroup'clang(nested_non_static_member_use)

    See above.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Kevin Ellis
    Gerrit-Attention: Kevin Ellis <kev...@chromium.org>
    Gerrit-Comment-Date: Fri, 21 Nov 2025 11:50:44 +0000
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages