Move per-element image animation state to ElementAnimations [chromium/src : main]

0 views
Skip to first unread message

Seokho Song (Gerrit)

unread,
May 14, 2026, 3:24:34 AMMay 14
to Robert Flack, Florin Malita, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Olga Gerchikov, Stephen Chenney, Menard, Alexis, android-bu...@system.gserviceaccount.com, blink-re...@chromium.org, blink-revie...@chromium.org, drott+bl...@chromium.org, blink-re...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, fmalit...@chromium.org, blink-rev...@chromium.org
Attention needed from Florin Malita and Robert Flack

Seokho Song voted and added 4 comments

Votes added by Seokho Song

Commit-Queue+1

4 comments

Patchset-level comments
File-level comment, Patchset 23:
Robert Flack . unresolved

I'm not sure I understand all of indirection going on in this patch. I can see that when we have a value that is not normal, we need to track some information for that element - but the purpose of using ElementAnimations was to have element associated data - it seems like we're storing this data on the bitmap though with a possible risk of never erasing it.

Seokho Song

the informations are moved to ElementAnimation.

File third_party/blink/renderer/core/dom/element.cc
Line 5569, Patchset 23: if (RuntimeEnabledFeatures::CSSImageAnimationEnabled()) {
Robert Flack . resolved

These calls to clear don't need to be flag guarded since we would not add any image animations if the flag wasn't enabled so the clear would be a no-op.

Seokho Song

Done

File third_party/blink/renderer/platform/graphics/bitmap_image.cc
Line 423, Patchset 23: image_animation_map_.find(image_node_animation_info->node_id);
Robert Flack . unresolved

Why is image_animation_map_ a map of NodeId to ImageAnimationData on BitmapImage rather than storing ImageAnimationData on ElementAnimations? It seems like if we stored the animation data on ElementAnimations then there would be no risk of the data persisting when the element is detached or memory leaks by not removing entries.

Seokho Song

Ahh!! Yes. That's a good idea.
We don't need to store it in `bitmap_image`. We can do this by taking the paint id and sync sequence from the Painter.

Line 498, Patchset 23: image_animation_map_.erase(animation_data_it);
Robert Flack . unresolved

It seems like this is the only call to erase the image animation data state, but what happens if the node is detached from the dom or becomes display none, we would never call PaintImageForCurrentFrameWithInfo right?

Seokho Song

Yes. Here is some context:
1. The first issue was raised on [this CL](https://chromium-review.googlesource.com/c/chromium/src/+/7596743/comment/fae52653_f5d32ce5/) where we decided to defer the erase logic.
2. And the discussions continued across WIP CLs. CLs ([First](https://chromium-review.googlesource.com/c/chromium/src/+/7692355) -> [Second](https://chromium-review.googlesource.com/c/chromium/src/+/7727509)).

So the original plan was to remove the entry data (similar with the first one) after landing this CL.
However, since this CL now changed the approach to store the data in `ElementAnimation` rather than `bitmap_image`, a further patch is no longer needed.

Open in Gerrit

Related details

Attention is currently required from:
  • Florin Malita
  • 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: Iff5306cafb4a13ab46783fe29cd56838ee3789f0
Gerrit-Change-Number: 7771511
Gerrit-PatchSet: 30
Gerrit-Owner: Seokho Song <seo...@chromium.org>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Robert Flack <fla...@chromium.org>
Gerrit-Attention: Florin Malita <fma...@chromium.org>
Gerrit-Comment-Date: Thu, 14 May 2026 07:24:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Robert Flack <fla...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Robert Flack (Gerrit)

unread,
May 14, 2026, 4:48:14 PMMay 14
to Seokho Song, Florin Malita, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Olga Gerchikov, Stephen Chenney, Menard, Alexis, android-bu...@system.gserviceaccount.com, blink-re...@chromium.org, blink-revie...@chromium.org, drott+bl...@chromium.org, blink-re...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, fmalit...@chromium.org, blink-rev...@chromium.org
Attention needed from Florin Malita and Seokho Song

Robert Flack added 6 comments

File third_party/blink/renderer/core/animation/element_animations.h
Line 210, Patchset 30 (Latest): image_animation_data_;
Robert Flack . unresolved

Much like we have wrapped up the css_animations_ into a separate CssAnimations class, would you mind creating a css_image_animations_ to encapsulate additional data members and functionality? I'm recommending css be in the name since it's driven by a css property and has the same lifetime expectations as css animations.

You can directly expose the inner class similar to how we do for CssAnimations():
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/animation/element_animations.h;l=96 so that you don't need forwarding methods.

File third_party/blink/renderer/core/dom/element.cc
Line 4478, Patchset 30 (Latest): element_animations->ClearPreviousImageAnimation();
Robert Flack . unresolved

We should clear everything about the CssImageAnimations - i.e. the entire map - not just the previous value.

File third_party/blink/renderer/core/paint/image_painter.cc
Line 304, Patchset 30 (Latest): image_animation);
Robert Flack . unresolved

Rather than updating element animations here, i think it might be cleaner to provide The new CssImageAnimations class which could implement an interface in third_party/blink/renderer/platform/graphics/ that provides the necessary methods to check whether we have data for a given bitmap and allows updating that data.

This way we don't have to even construct ImageNodeAnimationInfo for the normal case, nor do we have to update it at a distance from where the logic to do the update is performed.

File third_party/blink/renderer/platform/graphics/bitmap_image.cc
Line 421, Patchset 30 (Latest): image_node_animation_info->previous_image_animation;
Robert Flack . unresolved

I don't understand why we need to use the previous image animation value. We should be storing in the ImageAnimationData what the previous sequence was.

It seems like this should be sufficient to determine what we need to do here, e.g. something like this:
```c++
switch (image_animation) {
kNormal:
// Set stored sequence id to 0.
kRunning:
// If !has_previous_animation_data, then set sequence id to
// image_node_animation_info->non_normal_sequence_id + 1
// Otherwise, it will continue to use the sequence that was set.
kPaused:
// If !has_previous_animation_data, or current sequence is 0,
// then set sequence id to
// image_node_animation_info->non_normal_sequence_id + 1
kStopped:
// Remove from map
}
```
Line 423, Patchset 30 (Latest): previous_image_animation.has_value();
Robert Flack . unresolved

Rather than using the previous image animation value, it seems like we should use whether there was an ImageAnimationData in the map on ElementAnimations.

Line 498, Patchset 23: image_animation_map_.erase(animation_data_it);
Robert Flack . unresolved

It seems like this is the only call to erase the image animation data state, but what happens if the node is detached from the dom or becomes display none, we would never call PaintImageForCurrentFrameWithInfo right?

Seokho Song

Yes. Here is some context:
1. The first issue was raised on [this CL](https://chromium-review.googlesource.com/c/chromium/src/+/7596743/comment/fae52653_f5d32ce5/) where we decided to defer the erase logic.
2. And the discussions continued across WIP CLs. CLs ([First](https://chromium-review.googlesource.com/c/chromium/src/+/7692355) -> [Second](https://chromium-review.googlesource.com/c/chromium/src/+/7727509)).

So the original plan was to remove the entry data (similar with the first one) after landing this CL.
However, since this CL now changed the approach to store the data in `ElementAnimation` rather than `bitmap_image`, a further patch is no longer needed.

Robert Flack

Thanks!

Open in Gerrit

Related details

Attention is currently required from:
  • Florin Malita
  • Seokho Song
Gerrit-Attention: Florin Malita <fma...@chromium.org>
Gerrit-Attention: Seokho Song <seo...@chromium.org>
Gerrit-Comment-Date: Thu, 14 May 2026 20:48:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Robert Flack <fla...@chromium.org>
Comment-In-Reply-To: Seokho Song <seo...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Seokho Song (Gerrit)

unread,
May 18, 2026, 11:15:13 PM (13 days ago) May 18
to Robert Flack, Florin Malita, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Olga Gerchikov, Stephen Chenney, Menard, Alexis, android-bu...@system.gserviceaccount.com, blink-re...@chromium.org, blink-revie...@chromium.org, drott+bl...@chromium.org, blink-re...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, fmalit...@chromium.org, blink-rev...@chromium.org
Attention needed from Florin Malita and Robert Flack

Seokho Song added 7 comments

Patchset-level comments
File-level comment, Patchset 36 (Latest):
Seokho Song . resolved

Thanks!

File third_party/blink/renderer/core/animation/element_animations.h
Line 210, Patchset 30: image_animation_data_;
Robert Flack . resolved

Much like we have wrapped up the css_animations_ into a separate CssAnimations class, would you mind creating a css_image_animations_ to encapsulate additional data members and functionality? I'm recommending css be in the name since it's driven by a css property and has the same lifetime expectations as css animations.

You can directly expose the inner class similar to how we do for CssAnimations():
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/animation/element_animations.h;l=96 so that you don't need forwarding methods.

Seokho Song

Done

File third_party/blink/renderer/core/dom/element.cc
Line 4478, Patchset 30: element_animations->ClearPreviousImageAnimation();
Robert Flack . resolved

We should clear everything about the CssImageAnimations - i.e. the entire map - not just the previous value.

Seokho Song

Done

File third_party/blink/renderer/core/paint/image_painter.cc
Line 304, Patchset 30: image_animation);
Robert Flack . unresolved

Rather than updating element animations here, i think it might be cleaner to provide The new CssImageAnimations class which could implement an interface in third_party/blink/renderer/platform/graphics/ that provides the necessary methods to check whether we have data for a given bitmap and allows updating that data.

This way we don't have to even construct ImageNodeAnimationInfo for the normal case, nor do we have to update it at a distance from where the logic to do the update is performed.

Seokho Song

... third_party/blink/renderer/platform/graphics/ that provides the necessary methods to check whether we have data for a given bitmap and allows updating that data.

Done. It's nice!


> This way we don't have to even construct ImageNodeAnimationInfo for the normal case, nor do we have to update it at a distance from where the logic to do the update is performed.

`previous_image_animation` in ImageNodeAnimationInfo should be provided to use on the next paint (please check other [comment](https://chromium-review.googlesource.com/c/chromium/src/+/7771511/comment/619cbdd7_61c9cfaf/)).

File third_party/blink/renderer/platform/graphics/bitmap_image.cc
Line 421, Patchset 30: image_node_animation_info->previous_image_animation;
Robert Flack . unresolved

I don't understand why we need to use the previous image animation value. We should be storing in the ImageAnimationData what the previous sequence was.

It seems like this should be sufficient to determine what we need to do here, e.g. something like this:
```c++
switch (image_animation) {
kNormal:
// Set stored sequence id to 0.
kRunning:
// If !has_previous_animation_data, then set sequence id to
// image_node_animation_info->non_normal_sequence_id + 1
// Otherwise, it will continue to use the sequence that was set.
kPaused:
// If !has_previous_animation_data, or current sequence is 0,
// then set sequence id to
// image_node_animation_info->non_normal_sequence_id + 1
kStopped:
// Remove from map
}
```
Seokho Song

Since the spec mentions that the timeline should start from the original one when it transitions to normal[1], there is no effect when it transitions from `normal` to `running`. The previous image animation is needed to determine whether we separate the timeline. (Currently, separation only happens when transitioning from 1) `paused` or 2) `stopped`.)

Additionally, for the `stopped` value, we need the `previous_image_animation` because the `kAnimationNone` does not update CC's entry for the image animation controller so we need to update the entry value on the next paint. Please check the details in [2].

[1] https://drafts.csswg.org/css-image-animation-1/#:~:text=If%20images%20are%20added%20to%20the%20element%20while%20the%20computed%20value%20is%20running%2C%20the%20timeline%20starts%20at%20the%20time%20of%20the%20least%20recent%20addition%20to%20the%20group.

[2] https://chromium-review.googlesource.com/c/chromium/src/+/7687054

Line 423, Patchset 30: previous_image_animation.has_value();
Robert Flack . unresolved

Rather than using the previous image animation value, it seems like we should use whether there was an ImageAnimationData in the map on ElementAnimations.

Seokho Song

Maybe related to [this comment](https://chromium-review.googlesource.com/c/chromium/src/+/7771511/comment/619cbdd7_61c9cfaf/). If we need to check the previous image animation, I suppose `has_previous_image_animation` feels more appropriate.

Line 498, Patchset 23: image_animation_map_.erase(animation_data_it);
Robert Flack . resolved

It seems like this is the only call to erase the image animation data state, but what happens if the node is detached from the dom or becomes display none, we would never call PaintImageForCurrentFrameWithInfo right?

Seokho Song

Yes. Here is some context:
1. The first issue was raised on [this CL](https://chromium-review.googlesource.com/c/chromium/src/+/7596743/comment/fae52653_f5d32ce5/) where we decided to defer the erase logic.
2. And the discussions continued across WIP CLs. CLs ([First](https://chromium-review.googlesource.com/c/chromium/src/+/7692355) -> [Second](https://chromium-review.googlesource.com/c/chromium/src/+/7727509)).

So the original plan was to remove the entry data (similar with the first one) after landing this CL.
However, since this CL now changed the approach to store the data in `ElementAnimation` rather than `bitmap_image`, a further patch is no longer needed.

Robert Flack

Thanks!

Seokho Song

Acknowledged

Open in Gerrit

Related details

Attention is currently required from:
  • Florin Malita
  • 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: Iff5306cafb4a13ab46783fe29cd56838ee3789f0
Gerrit-Change-Number: 7771511
Gerrit-PatchSet: 36
Gerrit-Owner: Seokho Song <seo...@chromium.org>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Robert Flack <fla...@chromium.org>
Gerrit-Attention: Florin Malita <fma...@chromium.org>
Gerrit-Comment-Date: Tue, 19 May 2026 03:14:52 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Robert Flack (Gerrit)

unread,
May 20, 2026, 10:10:56 AM (12 days ago) May 20
to Seokho Song, Florin Malita, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Olga Gerchikov, Stephen Chenney, Menard, Alexis, android-bu...@system.gserviceaccount.com, blink-re...@chromium.org, blink-revie...@chromium.org, drott+bl...@chromium.org, blink-re...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, fmalit...@chromium.org, blink-rev...@chromium.org
Attention needed from Florin Malita and Seokho Song

Robert Flack added 1 comment

File third_party/blink/renderer/platform/graphics/bitmap_image.cc
Line 421, Patchset 30: image_node_animation_info->previous_image_animation;
Robert Flack . unresolved

I don't understand why we need to use the previous image animation value. We should be storing in the ImageAnimationData what the previous sequence was.

It seems like this should be sufficient to determine what we need to do here, e.g. something like this:
```c++
switch (image_animation) {
kNormal:
// Set stored sequence id to 0.
kRunning:
// If !has_previous_animation_data, then set sequence id to
// image_node_animation_info->non_normal_sequence_id + 1
// Otherwise, it will continue to use the sequence that was set.
kPaused:
// If !has_previous_animation_data, or current sequence is 0,
// then set sequence id to
// image_node_animation_info->non_normal_sequence_id + 1
kStopped:
// Remove from map
}
```
Seokho Song

Since the spec mentions that the timeline should start from the original one when it transitions to normal[1], there is no effect when it transitions from `normal` to `running`. The previous image animation is needed to determine whether we separate the timeline. (Currently, separation only happens when transitioning from 1) `paused` or 2) `stopped`.)

Additionally, for the `stopped` value, we need the `previous_image_animation` because the `kAnimationNone` does not update CC's entry for the image animation controller so we need to update the entry value on the next paint. Please check the details in [2].

[1] https://drafts.csswg.org/css-image-animation-1/#:~:text=If%20images%20are%20added%20to%20the%20element%20while%20the%20computed%20value%20is%20running%2C%20the%20timeline%20starts%20at%20the%20time%20of%20the%20least%20recent%20addition%20to%20the%20group.

[2] https://chromium-review.googlesource.com/c/chromium/src/+/7687054

Robert Flack

Since the spec mentions that the timeline should start from the original one when it transitions to normal[1], there is no effect when it transitions from normal to running.

This is handled by preserving the 0 sequence id, no? I.e. if it starts as normal, it will get a sequence id of 0, then when we switch to running it will keep the sequence id of 0. Any new images however, should get a new sequence.

As an example, consider the following:
```js
elem.style.imageAnimation = 'normal';
elem.style.backgroundImage = 'a.gif';
setTimeout(() => {
elem.style.imageAnimation = 'running';
elem.style.imageAnimation = 'a.gif b.gif';
}, 1000);
```

When `b.gif` is added, it should *not* get the normal sequence id because it was not running previously. It should generate a new sequence. `a.gif` should continue animating with the normal sequence which it will do because we have tracked that in the map.

The previous image animation is needed to determine whether we separate the timeline.

We in fact do need to separate the timeline if any new image urls show up, but this is unrelated to the previous image animation value, and entirely determined by whether this url was already in the map.

Additionally, for the stopped value, we need the previous_image_animation because the kAnimationNone does not update CC's entry for the image animation controller so we need to update the entry value on the next paint.

This would also be handled by having stopped remove the entry from the map. This way when it goes back to running, we can see that it was not previously running on the normal sequence.

Open in Gerrit

Related details

Attention is currently required from:
  • Florin Malita
  • Seokho Song
Gerrit-Attention: Florin Malita <fma...@chromium.org>
Gerrit-Attention: Seokho Song <seo...@chromium.org>
Gerrit-Comment-Date: Wed, 20 May 2026 14:10:47 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Seokho Song (Gerrit)

unread,
May 21, 2026, 5:18:17 AM (11 days ago) May 21
to Robert Flack, Florin Malita, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Olga Gerchikov, Stephen Chenney, Menard, Alexis, android-bu...@system.gserviceaccount.com, blink-re...@chromium.org, blink-revie...@chromium.org, drott+bl...@chromium.org, blink-re...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, fmalit...@chromium.org, blink-rev...@chromium.org
Attention needed from Florin Malita and Robert Flack

Seokho Song added 3 comments

File third_party/blink/renderer/core/paint/image_painter.cc
Line 304, Patchset 30: image_animation);
Robert Flack . resolved

Rather than updating element animations here, i think it might be cleaner to provide The new CssImageAnimations class which could implement an interface in third_party/blink/renderer/platform/graphics/ that provides the necessary methods to check whether we have data for a given bitmap and allows updating that data.

This way we don't have to even construct ImageNodeAnimationInfo for the normal case, nor do we have to update it at a distance from where the logic to do the update is performed.

Seokho Song

... third_party/blink/renderer/platform/graphics/ that provides the necessary methods to check whether we have data for a given bitmap and allows updating that data.

Done. It's nice!


> This way we don't have to even construct ImageNodeAnimationInfo for the normal case, nor do we have to update it at a distance from where the logic to do the update is performed.

`previous_image_animation` in ImageNodeAnimationInfo should be provided to use on the next paint (please check other [comment](https://chromium-review.googlesource.com/c/chromium/src/+/7771511/comment/619cbdd7_61c9cfaf/)).

Seokho Song

Marked as resolved.

File third_party/blink/renderer/platform/graphics/bitmap_image.cc
Seokho Song

Ah.. I think now I got it! we can do with like state-machine. Uh, it feels quite complex. Added a comment and test suite suite too.

Thanks! PTAL.

Line 423, Patchset 30: previous_image_animation.has_value();
Robert Flack . resolved

Rather than using the previous image animation value, it seems like we should use whether there was an ImageAnimationData in the map on ElementAnimations.

Seokho Song

Maybe related to [this comment](https://chromium-review.googlesource.com/c/chromium/src/+/7771511/comment/619cbdd7_61c9cfaf/). If we need to check the previous image animation, I suppose `has_previous_image_animation` feels more appropriate.

Seokho Song

Marked as resolved.

Open in Gerrit

Related details

Attention is currently required from:
  • Florin Malita
  • 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: Iff5306cafb4a13ab46783fe29cd56838ee3789f0
Gerrit-Change-Number: 7771511
Gerrit-PatchSet: 38
Gerrit-Owner: Seokho Song <seo...@chromium.org>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Robert Flack <fla...@chromium.org>
Gerrit-Attention: Florin Malita <fma...@chromium.org>
Gerrit-Comment-Date: Thu, 21 May 2026 09:17:45 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Robert Flack (Gerrit)

unread,
May 25, 2026, 4:50:39 PM (6 days ago) May 25
to Seokho Song, Florin Malita, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Olga Gerchikov, Stephen Chenney, Menard, Alexis, android-bu...@system.gserviceaccount.com, blink-re...@chromium.org, blink-revie...@chromium.org, drott+bl...@chromium.org, blink-re...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, fmalit...@chromium.org, blink-rev...@chromium.org
Attention needed from Florin Malita and Seokho Song

Robert Flack added 11 comments

File third_party/blink/renderer/platform/graphics/bitmap_image.cc
Line 445, Patchset 38 (Latest): // └─────────────── kStopped (erase entry) ──────────┘
Robert Flack . resolved

This diagram is great! It makes it very clear what's happening.

Line 453, Patchset 38 (Latest): if (accessor && image_key &&
Robert Flack . unresolved

When would accessor or image_key be null?

File third_party/blink/renderer/platform/graphics/css_image_animation_accessor.h
Line 37, Patchset 38 (Latest): virtual void EraseImageAnimationData(ImageResourceContent*) = 0;
Robert Flack . unresolved

Please document these functions.

Line 34, Patchset 38 (Latest): ImageResourceContent*) const = 0;
Robert Flack . unresolved

Given we never expect to be modifying this, only replacing it, maybe we could return an optional<ImageAnimationData> instead? This would prevent the risk of using a dangling pointer if the map is modified.

Line 29, Patchset 38 (Latest):class PLATFORM_EXPORT CSSImageAnimationAccessor {
Robert Flack . unresolved

Let's rename this to something that conceptually represents the interface, i.e. this is ElementImageAnimationData. Also add a class comment explaining what it represents.

File third_party/blink/web_tests/external/wpt/css/css-image-animation/image-animation-display-none-reset.tentative-ref.html
Line 4, Patchset 38 (Latest):<img src="../../images/red.png">
Robert Flack . unresolved

Typically we use green as a success case. Can you modify the animation so that green is the expectation?

Also, does this need to be an image here? Can't we create a green div box instead?

File third_party/blink/web_tests/external/wpt/css/css-image-animation/image-animation-display-none-reset.tentative.html
Line 17, Patchset 38 (Latest): if (count < 2)
Robert Flack . unresolved

If both loads don't occur on the same frame the rest of the test will be broken, right?

Line 26, Patchset 38 (Latest): setTimeout(() => {
Robert Flack . unresolved

This seems extremely likely to be flaky. I think it would be better to have a raf loop and use the timestamp passed to raf to determine the time each time raf is called. It would also be good to set the image sources on raf #2, so that they aren't started during the initial load where because of everything else going on you are likely to be delayed.

Line 31, Patchset 38 (Latest): img2.style.imageAnimation = 'paused';
Robert Flack . unresolved

If img2 pauses at 100ms, wouldn't that put it in frame 2? If so, why is the expected result red?

Line 35, Patchset 38 (Latest): img2.style.color = 'blue';
Robert Flack . unresolved

What does the image style color have to do with the test result? The style color doesn't affect anything does it?

Line 48, Patchset 38 (Latest): getComputedStyle(img1).color;
Robert Flack . unresolved

What's being tested by calling getComputedStyle before setting color?

Open in Gerrit

Related details

Attention is currently required from:
  • Florin Malita
  • Seokho Song
Gerrit-Attention: Florin Malita <fma...@chromium.org>
Gerrit-Attention: Seokho Song <seo...@chromium.org>
Gerrit-Comment-Date: Mon, 25 May 2026 20:50:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Seokho Song (Gerrit)

unread,
May 26, 2026, 5:27:05 AM (6 days ago) May 26
to Robert Flack, Florin Malita, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Olga Gerchikov, Stephen Chenney, Menard, Alexis, android-bu...@system.gserviceaccount.com, blink-re...@chromium.org, blink-revie...@chromium.org, drott+bl...@chromium.org, blink-re...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, fmalit...@chromium.org, blink-rev...@chromium.org
Attention needed from Florin Malita and Robert Flack

Seokho Song added 11 comments

File third_party/blink/renderer/platform/graphics/bitmap_image.cc
Line 453, Patchset 38: if (accessor && image_key &&
Robert Flack . resolved

When would accessor or image_key be null?

Seokho Song

MM, yes It was guarded on `BitmapImage::Draw`. Used `DCHECK` instead. I found that there was a bug path for root element (#document) and fixed it.

File third_party/blink/renderer/platform/graphics/css_image_animation_accessor.h
Line 37, Patchset 38: virtual void EraseImageAnimationData(ImageResourceContent*) = 0;
Robert Flack . resolved

Please document these functions.

Seokho Song

Done

Line 34, Patchset 38: ImageResourceContent*) const = 0;
Robert Flack . resolved

Given we never expect to be modifying this, only replacing it, maybe we could return an optional<ImageAnimationData> instead? This would prevent the risk of using a dangling pointer if the map is modified.

Seokho Song

Done

Line 29, Patchset 38:class PLATFORM_EXPORT CSSImageAnimationAccessor {
Robert Flack . resolved

Let's rename this to something that conceptually represents the interface, i.e. this is ElementImageAnimationData. Also add a class comment explaining what it represents.

Seokho Song

Done

File third_party/blink/web_tests/external/wpt/css/css-image-animation/image-animation-display-none-reset.tentative-ref.html
Line 4, Patchset 38:<img src="../../images/red.png">
Robert Flack . unresolved

Typically we use green as a success case. Can you modify the animation so that green is the expectation?

Also, does this need to be an image here? Can't we create a green div box instead?

Seokho Song

Typically we use green as a success case. Can you modify the animation so that green is the expectation?

Yes, we can do that. If we change it to a match test, it would look like this:
```html
<img src="../../images/red.png">
<img src="../../images/green.png">
```

Also, does this need to be an image here? Can't we create a green div box instead?

That is possible but we need to define the dimension e.g.,

```html
<style>
div {
display: inline-block;
width: 100px;
height: 50px;
}
</style>
<div style="background: red;"></div>
<div style="background:lime"></div>
```

Would you prefer this approach? If so, I think we should separate this into a new CL, so we can update the existing tests at the same time.

File third_party/blink/web_tests/external/wpt/css/css-image-animation/image-animation-display-none-reset.tentative.html
Line 17, Patchset 38: if (count < 2)
Robert Flack . unresolved

If both loads don't occur on the same frame the rest of the test will be broken, right?

Seokho Song

the count < 2 gate only ensures both `onloads` have fired. If the load gap exceeds ~120ms, img1 has already left frame 2 by pause time and the test breaks.

Line 17, Patchset 38: if (count < 2)
Robert Flack . unresolved

If both loads don't occur on the same frame the rest of the test will be broken, right?

Seokho Song

the count < 2 gate only ensures both `onloads` have fired. If the load gap exceeds ~120ms, img1 has already left frame 2 by pause time and the test breaks.

Line 26, Patchset 38: setTimeout(() => {
Robert Flack . unresolved

This seems extremely likely to be flaky. I think it would be better to have a raf loop and use the timestamp passed to raf to determine the time each time raf is called. It would also be good to set the image sources on raf #2, so that they aren't started during the initial load where because of everything else going on you are likely to be delayed.

Seokho Song

So does that mean we should remove `setTimeout` and do something roughly like this:

```js
requestAnimationFrame(() => {
requestAnimationFrame((t0) => {
(function tick(now) {
if (now - t0 < 120) requestAnimationFrame(tick);
else { /* run test */ }
})(t0);
});
});

```

right?

Hmm, maybe it would be better to do this in a separated CL (since they are existing tests).

Line 31, Patchset 38: img2.style.imageAnimation = 'paused';
Robert Flack . unresolved

If img2 pauses at 100ms, wouldn't that put it in frame 2? If so, why is the expected result red?

Seokho Song

Because it is `mismatch` test. maybe better to use `match`?

Line 35, Patchset 38: img2.style.color = 'blue';
Robert Flack . unresolved

What does the image style color have to do with the test result? The style color doesn't affect anything does it?

Seokho Song

Now it doesn't have any effect. The previous patchset used a custom computed style and updated it during style recalc, which caused the failure. Would it be better to just remove them?

Line 48, Patchset 38: getComputedStyle(img1).color;
Robert Flack . unresolved

What's being tested by calling getComputedStyle before setting color?

Seokho Song

It was followed from [this](https://chromium-review.googlesource.com/c/chromium/src/+/7771511/comment/eb810678_18a0d7b0/).

I assume that would make style recalc.

Open in Gerrit

Related details

Attention is currently required from:
  • Florin Malita
  • 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: Iff5306cafb4a13ab46783fe29cd56838ee3789f0
Gerrit-Change-Number: 7771511
Gerrit-PatchSet: 41
Gerrit-Owner: Seokho Song <seo...@chromium.org>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Robert Flack <fla...@chromium.org>
Gerrit-Attention: Florin Malita <fma...@chromium.org>
Gerrit-Comment-Date: Tue, 26 May 2026 09:26:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Robert Flack <fla...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Robert Flack (Gerrit)

unread,
May 28, 2026, 2:51:08 PM (3 days ago) May 28
to Seokho Song, Florin Malita, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Olga Gerchikov, Stephen Chenney, Menard, Alexis, android-bu...@system.gserviceaccount.com, blink-re...@chromium.org, blink-revie...@chromium.org, drott+bl...@chromium.org, blink-re...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, fmalit...@chromium.org, blink-rev...@chromium.org
Attention needed from Florin Malita and Seokho Song

Robert Flack added 8 comments

File third_party/blink/renderer/core/animation/css/css_image_animations.cc
Line 56, Patchset 41 (Latest): } else if (auto* document = DynamicTo<Document>(node)) {
Robert Flack . unresolved

What's an example of when we invoke this? The image-animation property only applies to elements as far as I can tell from https://drafts.csswg.org/css-image-animation-1/#image-animation . I'm not even sure if the document node can render images. The documentElement is a real Element and will pass the above test.

File third_party/blink/renderer/platform/graphics/bitmap_image.cc
Line 421, Patchset 30: image_node_animation_info->previous_image_animation;
Robert Flack . resolved
Robert Flack

Acknowledged

Line 474, Patchset 41 (Latest): sync_animation_sequence_id = 1;
Robert Flack . unresolved

If we only use the values 0 or 1 can we convert this to an enum of Normal and Custom or something like that? I'm not sure I see where we ever use different values.

File third_party/blink/web_tests/external/wpt/css/css-image-animation/image-animation-display-none-reset.tentative-ref.html
Line 4, Patchset 38:<img src="../../images/red.png">
Robert Flack . unresolved

Typically we use green as a success case. Can you modify the animation so that green is the expectation?

Also, does this need to be an image here? Can't we create a green div box instead?

Seokho Song

Typically we use green as a success case. Can you modify the animation so that green is the expectation?

Yes, we can do that. If we change it to a match test, it would look like this:
```html
<img src="../../images/red.png">
<img src="../../images/green.png">
```

Also, does this need to be an image here? Can't we create a green div box instead?

That is possible but we need to define the dimension e.g.,

```html
<style>
div {
display: inline-block;
width: 100px;
height: 50px;
}
</style>
<div style="background: red;"></div>
<div style="background:lime"></div>
```

Would you prefer this approach? If so, I think we should separate this into a new CL, so we can update the existing tests at the same time.

Robert Flack

Yeah I'm okay with separating this into a new cl.

File third_party/blink/web_tests/external/wpt/css/css-image-animation/image-animation-display-none-reset.tentative.html
Line 26, Patchset 38: setTimeout(() => {
Robert Flack . unresolved

This seems extremely likely to be flaky. I think it would be better to have a raf loop and use the timestamp passed to raf to determine the time each time raf is called. It would also be good to set the image sources on raf #2, so that they aren't started during the initial load where because of everything else going on you are likely to be delayed.

Seokho Song

So does that mean we should remove `setTimeout` and do something roughly like this:

```js
requestAnimationFrame(() => {
requestAnimationFrame((t0) => {
(function tick(now) {
if (now - t0 < 120) requestAnimationFrame(tick);
else { /* run test */ }
})(t0);
});
});

```

right?

Hmm, maybe it would be better to do this in a separated CL (since they are existing tests).

Robert Flack

Yes exactly. raf has more consistent timing than setTimeout. I'm not sure how lenient the test expectations are to queuing delay - i.e. how slow can frame generation be before we will fail this test?

Line 31, Patchset 38: img2.style.imageAnimation = 'paused';
Robert Flack . unresolved

If img2 pauses at 100ms, wouldn't that put it in frame 2? If so, why is the expected result red?

Seokho Song

Because it is `mismatch` test. maybe better to use `match`?

Robert Flack

I see. It would be better to use a match test.

Line 35, Patchset 38: img2.style.color = 'blue';
Robert Flack . unresolved

What does the image style color have to do with the test result? The style color doesn't affect anything does it?

Seokho Song

Now it doesn't have any effect. The previous patchset used a custom computed style and updated it during style recalc, which caused the failure. Would it be better to just remove them?

Robert Flack

Ah perhaps we should just remove these, it is a bit confusing to have this as part of the tests.

Line 48, Patchset 38: getComputedStyle(img1).color;
Robert Flack . unresolved

What's being tested by calling getComputedStyle before setting color?

Seokho Song

It was followed from [this](https://chromium-review.googlesource.com/c/chromium/src/+/7771511/comment/eb810678_18a0d7b0/).

I assume that would make style recalc.

Robert Flack

I see, got it, so let's update the comment on line 47 to say "// Test that an intermediate style update does not interfere with updating the image animation."

Open in Gerrit

Related details

Attention is currently required from:
  • Florin Malita
  • Seokho Song
Gerrit-Attention: Florin Malita <fma...@chromium.org>
Gerrit-Attention: Seokho Song <seo...@chromium.org>
Gerrit-Comment-Date: Thu, 28 May 2026 18:50:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Robert Flack <fla...@chromium.org>
Comment-In-Reply-To: Seokho Song <seo...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Seokho Song (Gerrit)

unread,
May 29, 2026, 4:37:31 AM (3 days ago) May 29
to Robert Flack, Florin Malita, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Olga Gerchikov, Stephen Chenney, Menard, Alexis, android-bu...@system.gserviceaccount.com, cc-...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, drott+bl...@chromium.org, blink-re...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, fmalit...@chromium.org, blink-rev...@chromium.org
Attention needed from Florin Malita and Robert Flack

Seokho Song voted and added 7 comments

Votes added by Seokho Song

Commit-Queue+1

7 comments

File third_party/blink/renderer/core/animation/css/css_image_animations.cc
Line 56, Patchset 41: } else if (auto* document = DynamicTo<Document>(node)) {
Robert Flack . unresolved

What's an example of when we invoke this? The image-animation property only applies to elements as far as I can tell from https://drafts.csswg.org/css-image-animation-1/#image-animation . I'm not even sure if the document node can render images. The documentElement is a real Element and will pass the above test.

Seokho Song

It caused the test failures for the root e.g. [this one](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/web_tests/external/wpt/css/css-image-animation/image-animation-root-background-body-paused-no-propagation.html;l=1;drc=121e378ec1b1e354f2c1f913c326a5ab35b0e848).

The render path is the following and the `Document` node is passing:

`ViewPainter::PaintBoxDecorationBackground()` -> `ViewPainter::PaintRootElementGroup()` -> `FillLayer::IterateFillLayersInReverseOrder()` -> `BoxPainterBase::PaintFillLayer()` -> `PaintFillLayerBackground()` -> `CSSImageAnimations::CreateImageNodeAnimationInfo()`.

File third_party/blink/renderer/platform/graphics/bitmap_image.cc
Line 474, Patchset 41: sync_animation_sequence_id = 1;
Robert Flack . unresolved

If we only use the values 0 or 1 can we convert this to an enum of Normal and Custom or something like that? I'm not sure I see where we ever use different values.

Seokho Song

PTAL

File third_party/blink/web_tests/external/wpt/css/css-image-animation/image-animation-display-none-reset.tentative-ref.html
Line 4, Patchset 38:<img src="../../images/red.png">
Robert Flack . resolved

Typically we use green as a success case. Can you modify the animation so that green is the expectation?

Also, does this need to be an image here? Can't we create a green div box instead?

Seokho Song

Typically we use green as a success case. Can you modify the animation so that green is the expectation?

Yes, we can do that. If we change it to a match test, it would look like this:
```html
<img src="../../images/red.png">
<img src="../../images/green.png">
```

Also, does this need to be an image here? Can't we create a green div box instead?

That is possible but we need to define the dimension e.g.,

```html
<style>
div {
display: inline-block;
width: 100px;
height: 50px;
}
</style>
<div style="background: red;"></div>
<div style="background:lime"></div>
```

Would you prefer this approach? If so, I think we should separate this into a new CL, so we can update the existing tests at the same time.

Robert Flack

Yeah I'm okay with separating this into a new cl.

Seokho Song

Acknowledged

File third_party/blink/web_tests/external/wpt/css/css-image-animation/image-animation-display-none-reset.tentative.html
Line 26, Patchset 38: setTimeout(() => {
Robert Flack . unresolved

This seems extremely likely to be flaky. I think it would be better to have a raf loop and use the timestamp passed to raf to determine the time each time raf is called. It would also be good to set the image sources on raf #2, so that they aren't started during the initial load where because of everything else going on you are likely to be delayed.

Seokho Song

So does that mean we should remove `setTimeout` and do something roughly like this:

```js
requestAnimationFrame(() => {
requestAnimationFrame((t0) => {
(function tick(now) {
if (now - t0 < 120) requestAnimationFrame(tick);
else { /* run test */ }
})(t0);
});
});

```

right?

Hmm, maybe it would be better to do this in a separated CL (since they are existing tests).

Robert Flack

Yes exactly. raf has more consistent timing than setTimeout. I'm not sure how lenient the test expectations are to queuing delay - i.e. how slow can frame generation be before we will fail this test?

Seokho Song

Actually the flakiness made from the `takeScreenshot()` function. [Here](https://chromium-review.googlesource.com/c/chromium/src/+/7458159/comment/ee182295_e5638f1b/) some context.

 I'm not sure how lenient the test expectations are to queuing delay - i.e. how slow can frame generation be before we will fail this test?

Do you mean the test suite timeout?

It says `Regular timeout: 30000, slow test timeout: 150000`

Line 31, Patchset 38: img2.style.imageAnimation = 'paused';
Robert Flack . resolved

If img2 pauses at 100ms, wouldn't that put it in frame 2? If so, why is the expected result red?

Seokho Song

Because it is `mismatch` test. maybe better to use `match`?

Robert Flack

I see. It would be better to use a match test.

Seokho Song

Done

Line 35, Patchset 38: img2.style.color = 'blue';
Robert Flack . resolved

What does the image style color have to do with the test result? The style color doesn't affect anything does it?

Seokho Song

Now it doesn't have any effect. The previous patchset used a custom computed style and updated it during style recalc, which caused the failure. Would it be better to just remove them?

Robert Flack

Ah perhaps we should just remove these, it is a bit confusing to have this as part of the tests.

Seokho Song

Done

Line 48, Patchset 38: getComputedStyle(img1).color;
Robert Flack . resolved

What's being tested by calling getComputedStyle before setting color?

Seokho Song

It was followed from [this](https://chromium-review.googlesource.com/c/chromium/src/+/7771511/comment/eb810678_18a0d7b0/).

I assume that would make style recalc.

Robert Flack

I see, got it, so let's update the comment on line 47 to say "// Test that an intermediate style update does not interfere with updating the image animation."

Seokho Song

Resolved by removing

Open in Gerrit

Related details

Attention is currently required from:
  • Florin Malita
  • 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: Iff5306cafb4a13ab46783fe29cd56838ee3789f0
Gerrit-Change-Number: 7771511
Gerrit-PatchSet: 43
Gerrit-Owner: Seokho Song <seo...@chromium.org>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Robert Flack <fla...@chromium.org>
Gerrit-Attention: Florin Malita <fma...@chromium.org>
Gerrit-Comment-Date: Fri, 29 May 2026 08:37:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Robert Flack (Gerrit)

unread,
May 29, 2026, 2:31:20 PM (2 days ago) May 29
to Seokho Song, Florin Malita, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Olga Gerchikov, Stephen Chenney, Menard, Alexis, android-bu...@system.gserviceaccount.com, cc-...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, drott+bl...@chromium.org, blink-re...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, fmalit...@chromium.org, blink-rev...@chromium.org
Attention needed from Florin Malita and Seokho Song

Robert Flack added 2 comments

File third_party/blink/web_tests/external/wpt/css/css-image-animation/image-animation-display-none-reset.tentative.html
Line 17, Patchset 38: if (count < 2)
Robert Flack . unresolved

If both loads don't occur on the same frame the rest of the test will be broken, right?

Seokho Song

the count < 2 gate only ensures both `onloads` have fired. If the load gap exceeds ~120ms, img1 has already left frame 2 by pause time and the test breaks.

Robert Flack

I see that, but if img1 loaded and started running before img2 loaded, you would start the test with it already having made some progress. Perhaps it would be more robust if the tests had the animations in a paused state until both were loaded?

Line 26, Patchset 38: setTimeout(() => {
Robert Flack . unresolved

This seems extremely likely to be flaky. I think it would be better to have a raf loop and use the timestamp passed to raf to determine the time each time raf is called. It would also be good to set the image sources on raf #2, so that they aren't started during the initial load where because of everything else going on you are likely to be delayed.

Seokho Song

So does that mean we should remove `setTimeout` and do something roughly like this:

```js
requestAnimationFrame(() => {
requestAnimationFrame((t0) => {
(function tick(now) {
if (now - t0 < 120) requestAnimationFrame(tick);
else { /* run test */ }
})(t0);
});
});

```

right?

Hmm, maybe it would be better to do this in a separated CL (since they are existing tests).

Robert Flack

Yes exactly. raf has more consistent timing than setTimeout. I'm not sure how lenient the test expectations are to queuing delay - i.e. how slow can frame generation be before we will fail this test?

Seokho Song

Actually the flakiness made from the `takeScreenshot()` function. [Here](https://chromium-review.googlesource.com/c/chromium/src/+/7458159/comment/ee182295_e5638f1b/) some context.

 I'm not sure how lenient the test expectations are to queuing delay - i.e. how slow can frame generation be before we will fail this test?

Do you mean the test suite timeout?

It says `Regular timeout: 30000, slow test timeout: 150000`

Robert Flack

No what I mean is, if it takes more than 200ms before the script runs that pauses the image animation it would reach the blue frame right?

Also, how do you know that by the time the screenshot is taken that the animation would have reached the blue frame if it were not paused when only ~100ms are waited for?

Open in Gerrit

Related details

Attention is currently required from:
  • Florin Malita
  • Seokho Song
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: Iff5306cafb4a13ab46783fe29cd56838ee3789f0
Gerrit-Change-Number: 7771511
Gerrit-PatchSet: 45
Gerrit-Owner: Seokho Song <seo...@chromium.org>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Florin Malita <fma...@chromium.org>
Gerrit-Attention: Seokho Song <seo...@chromium.org>
Gerrit-Comment-Date: Fri, 29 May 2026 18:31:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Seokho Song (Gerrit)

unread,
May 31, 2026, 11:27:37 PM (1 hour ago) May 31
to Robert Flack, Florin Malita, Chromium LUCI CQ, chromium...@chromium.org, Dirk Schulze, Olga Gerchikov, Stephen Chenney, Menard, Alexis, android-bu...@system.gserviceaccount.com, cc-...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, drott+bl...@chromium.org, blink-re...@chromium.org, fserb...@chromium.org, kinuko...@chromium.org, blink-reviews-p...@chromium.org, blink-...@chromium.org, blink-revie...@chromium.org, blink-rev...@chromium.org, apavlo...@chromium.org, fmalit...@chromium.org, blink-rev...@chromium.org
Attention needed from Florin Malita and Robert Flack

Seokho Song added 2 comments

File third_party/blink/web_tests/external/wpt/css/css-image-animation/image-animation-display-none-reset.tentative.html
Line 17, Patchset 38: if (count < 2)
Robert Flack . resolved

If both loads don't occur on the same frame the rest of the test will be broken, right?

Seokho Song

the count < 2 gate only ensures both `onloads` have fired. If the load gap exceeds ~120ms, img1 has already left frame 2 by pause time and the test breaks.

Robert Flack

I see that, but if img1 loaded and started running before img2 loaded, you would start the test with it already having made some progress. Perhaps it would be more robust if the tests had the animations in a paused state until both were loaded?

Seokho Song

Yes. That would have a positive effect. not sure it creates critical effect or not.
Added 'paused' on test. Will change other tests in separated CL.

Seokho Song
 if it takes more than 200ms before the script runs that pauses the image animation it would reach the blue frame right?

In theory, yes. But it is now prevented change from [the comment](https://chromium-review.googlesource.com/c/chromium/src/+/7771511/comment/e36bcaa3_c6a4f1ab/).

Also, how do you know that by the time the screenshot is taken that the animation would have reached the blue frame if it were not paused when only ~100ms are waited for?

In this test suite, we paused the image animation before taking the screenshot (on L32 and L37) to prevent it from reaching the blue frame. Without this pause, it could cause the flakiness since the `takeScreenshot()` might not taken at the exact moment. I'm planning to change the other tests in a separated CL after the CLs are landed.

Open in Gerrit

Related details

Attention is currently required from:
  • Florin Malita
  • 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: Iff5306cafb4a13ab46783fe29cd56838ee3789f0
Gerrit-Change-Number: 7771511
Gerrit-PatchSet: 46
Gerrit-Owner: Seokho Song <seo...@chromium.org>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
Gerrit-Reviewer: Seokho Song <seo...@chromium.org>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-Attention: Robert Flack <fla...@chromium.org>
Gerrit-Attention: Florin Malita <fma...@chromium.org>
Gerrit-Comment-Date: Mon, 01 Jun 2026 03:27:11 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages