Reset image animation on layout removal and avoid storing normal style [chromium/src : main]

0 views
Skip to first unread message

Seokho Song (Gerrit)

unread,
May 8, 2026, 3:08:07 AM (7 days ago) May 8
to Rune Lillesveen, 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 Rune Lillesveen

Seokho Song added 1 comment

Patchset-level comments
Open in Gerrit

Related details

Attention is currently required from:
  • Florin Malita
  • Rune Lillesveen
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: 20
Gerrit-Owner: Seokho Song <seo...@chromium.org>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Rune Lillesveen <fut...@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: Rune Lillesveen <fut...@chromium.org>
Gerrit-Attention: Florin Malita <fma...@chromium.org>
Gerrit-Comment-Date: Fri, 08 May 2026 07:07:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Rune Lillesveen (Gerrit)

unread,
May 8, 2026, 3:20:11 AM (7 days ago) May 8
to Seokho Song, Robert Flack, Rune Lillesveen, 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, Robert Flack and Seokho Song

Rune Lillesveen added 1 comment

Commit Message
Line 25, Patchset 12:`BitmapImage` via the `ImageNodeAnimationInfo` struct.
Rune Lillesveen . unresolved

It don't think it makes sense to track this on ComputedStyle. Also, you may have an arbitrary number of style change events between paints, so the old image animation may be lost.

Seokho Song

Also, you may have an arbitrary number of style change events between paints, so the old image animation may be lost.

Hmm, IIUC, does this mean the old style might not exist for various reasons other than DOM tree reattachment? If so, we can't use this approach here for [the same reason here](https://chromium-review.googlesource.com/c/chromium/src/+/7727509/comment/ebcaa4e3_53468901/)...

We might need to find the right place to store this information, perhaps in `ElementRareData` (similar to [this one](https://chromium-review.googlesource.com/c/chromium/src/+/7692355)) to explicitly track the previous style and reattachment.

WDYT @fma...@chromium.org?

Rune Lillesveen

Also, you may have an arbitrary number of style change events between paints, so the old image animation may be lost.

Hmm, IIUC, does this mean the old style might not exist for various reasons other than DOM tree reattachment?

There will be an old style, but there might be intermediate style changes which are never passed on to the paint code. I've suggested a way this can be observed in the test you're adding.

Seokho Song

Ah got it. Thanks! I've changed the approach to update/store previous image animation.

Rune Lillesveen

I've read the spec now, and I got the impression that these timelines are intended to behave like CSS/web animation timelines wrt when they are created and reset on display:none changes, for instance.

It might be a good idea for the spec to refer to the animation specs and timelines and have an animation timeline that runs all the animated images.

Then it would also be natural to run these timelines on ElementAnimations and let the rendering changes affect the timelines in the same way as for other animation timelines.

Disclaimer: I'm not an expert, and I've not been involved in the spec discussions here.

Adding flackr@ for input.

Open in Gerrit

Related details

Attention is currently required from:
  • Florin Malita
  • Robert Flack
  • 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: 20
Gerrit-Owner: Seokho Song <seo...@chromium.org>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
Gerrit-Reviewer: Rune Lillesveen <fut...@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-Attention: Seokho Song <seo...@chromium.org>
Gerrit-Comment-Date: Fri, 08 May 2026 07:19:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Rune Lillesveen <fut...@chromium.org>
Comment-In-Reply-To: Seokho Song <seo...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Robert Flack (Gerrit)

unread,
May 8, 2026, 4:06:22 PM (6 days ago) May 8
to Seokho Song, Rune Lillesveen, 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

Commit Message
Line 25, Patchset 12:`BitmapImage` via the `ImageNodeAnimationInfo` struct.
Rune Lillesveen . unresolved

It don't think it makes sense to track this on ComputedStyle. Also, you may have an arbitrary number of style change events between paints, so the old image animation may be lost.

Seokho Song

Also, you may have an arbitrary number of style change events between paints, so the old image animation may be lost.

Hmm, IIUC, does this mean the old style might not exist for various reasons other than DOM tree reattachment? If so, we can't use this approach here for [the same reason here](https://chromium-review.googlesource.com/c/chromium/src/+/7727509/comment/ebcaa4e3_53468901/)...

We might need to find the right place to store this information, perhaps in `ElementRareData` (similar to [this one](https://chromium-review.googlesource.com/c/chromium/src/+/7692355)) to explicitly track the previous style and reattachment.

WDYT @fma...@chromium.org?

Rune Lillesveen

Also, you may have an arbitrary number of style change events between paints, so the old image animation may be lost.

Hmm, IIUC, does this mean the old style might not exist for various reasons other than DOM tree reattachment?

There will be an old style, but there might be intermediate style changes which are never passed on to the paint code. I've suggested a way this can be observed in the test you're adding.

Seokho Song

Ah got it. Thanks! I've changed the approach to update/store previous image animation.

Rune Lillesveen

I've read the spec now, and I got the impression that these timelines are intended to behave like CSS/web animation timelines wrt when they are created and reset on display:none changes, for instance.

It might be a good idea for the spec to refer to the animation specs and timelines and have an animation timeline that runs all the animated images.

Then it would also be natural to run these timelines on ElementAnimations and let the rendering changes affect the timelines in the same way as for other animation timelines.

Disclaimer: I'm not an expert, and I've not been involved in the spec discussions here.

Adding flackr@ for input.

Robert Flack

I think it would make sense to move ImageAnimationData into ElementAnimations and share more of that code path.

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: Fri, 08 May 2026 20:06:17 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Seokho Song (Gerrit)

unread,
May 12, 2026, 4:19:24 AM (3 days ago) May 12
to Robert Flack, Rune Lillesveen, 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

Seokho Song voted and added 1 comment

Votes added by Seokho Song

Commit-Queue+1

1 comment

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

PTAL, Moved to ElementAnimation

Open in Gerrit

Related details

Attention is currently required from:
  • Florin Malita
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: 23
Gerrit-Owner: Seokho Song <seo...@chromium.org>
Gerrit-Reviewer: Florin Malita <fma...@chromium.org>
Gerrit-Reviewer: Robert Flack <fla...@chromium.org>
Gerrit-Reviewer: Rune Lillesveen <fut...@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-Comment-Date: Tue, 12 May 2026 08:19:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Rune Lillesveen (Gerrit)

unread,
May 12, 2026, 5:27:54 AM (3 days ago) May 12
to Seokho Song, 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, Rune Lillesveen
Attention needed from Florin Malita and Seokho Song

Rune Lillesveen added 1 comment

Patchset-level comments
Rune Lillesveen . resolved

Removing myself since the style approach is now gone.

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: 23
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: Tue, 12 May 2026 09:27:40 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Robert Flack (Gerrit)

unread,
May 13, 2026, 7:57:37 PM (2 days ago) May 13
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 4 comments

Patchset-level comments
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.

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

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.

File third_party/blink/renderer/platform/graphics/bitmap_image.cc
Line 423, Patchset 23 (Latest): 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.

Line 498, Patchset 23 (Latest): 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?

Gerrit-Comment-Date: Wed, 13 May 2026 23:57:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages