[animation-trigger] Avoid uncancelable side-effect in ResolveStyle [chromium/src : main]

1 view
Skip to first unread message

Anders Hartvoll Ruud (Gerrit)

unread,
Dec 15, 2025, 9:49:39 AM (5 days ago) Dec 15
to David Awogbemila, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from David Awogbemila

Anders Hartvoll Ruud added 5 comments

Commit Message
Line 11, Patchset 4 (Latest):we shouldn't introduced uncancelable side-effects in ResolveStyle.
Anders Hartvoll Ruud . unresolved

nit: introduce

File third_party/blink/renderer/core/css/post_style_update_scope.h
Line 76, Patchset 4 (Latest): // Elements which declare named animation triggers, i.e. timeline-trigger.
HeapHashSet<Member<Element>> elements_with_pending_trigger_updates_;
Anders Hartvoll Ruud . unresolved

Why not add a bool on `CSSAnimationUpdate` (`needs_trigger_update`, or something) instead? All other pending updates are described there.

You could then apply the trigger updates during `MaybeApplyPendingUpdate` as normal?

File third_party/blink/renderer/core/css/resolver/style_resolver.cc
Line 3662, Patchset 4 (Latest):void StyleResolver::ApplyTriggerData(StyleResolverState& state) {
Anders Hartvoll Ruud . unresolved

Why does this not happen in `StyleResolver::ApplyAnimatedStyle`? Every other `CSSAnimationData::CalculateFooUpdate` already happens there.

Line 3663, Patchset 4 (Latest): const ComputedStyle* old_style = state.GetElement().GetComputedStyle();
Anders Hartvoll Ruud . unresolved

This is not the correct old style. (Use `state.OldStyle()`.)

Line 3669, Patchset 4 (Latest): PostStyleUpdateScope::CurrentAnimationData()->SetPendingTriggerUpdate(
state.GetElement(), state.AnimationUpdate());
Anders Hartvoll Ruud . unresolved

It's unfortunate to add a second place where this update object it set. The existing call to `SetAnimationUpdateIfNeeded` should be enough? The `CSSAnimationUpdate` we set here will also be overwritten by `SetAnimationUpdateIfNeeded`.

Open in Gerrit

Related details

Attention is currently required from:
  • David Awogbemila
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: I3f7b0aead991e8456b11a389dc6626a6577981bf
Gerrit-Change-Number: 7255899
Gerrit-PatchSet: 4
Gerrit-Owner: David Awogbemila <awogb...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: David Awogbemila <awogb...@chromium.org>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-Attention: David Awogbemila <awogb...@chromium.org>
Gerrit-Comment-Date: Mon, 15 Dec 2025 14:49:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

David Awogbemila (Gerrit)

unread,
Dec 17, 2025, 11:44:16 AM (3 days ago) Dec 17
to Anders Hartvoll Ruud, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Anders Hartvoll Ruud

David Awogbemila added 3 comments

Patchset-level comments
File-level comment, Patchset 5 (Latest):
David Awogbemila . resolved

Haven't made any changes. Looking to explore partial re-purposing of `CSSAnimationUpdate`.

Commit Message
Line 11, Patchset 4:we shouldn't introduced uncancelable side-effects in ResolveStyle.
Anders Hartvoll Ruud . resolved

nit: introduce

David Awogbemila

Done

File third_party/blink/renderer/core/css/post_style_update_scope.h
Line 76, Patchset 4: // Elements which declare named animation triggers, i.e. timeline-trigger.
HeapHashSet<Member<Element>> elements_with_pending_trigger_updates_;
Anders Hartvoll Ruud . unresolved

Why not add a bool on `CSSAnimationUpdate` (`needs_trigger_update`, or something) instead? All other pending updates are described there.

You could then apply the trigger updates during `MaybeApplyPendingUpdate` as normal?

David Awogbemila

I can look into this. I got the sense that `CSSAnimationUpdate` was trying to track changes to the `animation` property whereas the element declaring `timeline-trigger` might have no animation at all. Still I it might be possible to use `CSSAnimationUpdate` in a way that makes sense so I'll explore that.

(I guess this is relevant to your other comments)

Open in Gerrit

Related details

Attention is currently required from:
  • Anders Hartvoll Ruud
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: I3f7b0aead991e8456b11a389dc6626a6577981bf
Gerrit-Change-Number: 7255899
Gerrit-PatchSet: 5
Gerrit-Owner: David Awogbemila <awogb...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: David Awogbemila <awogb...@chromium.org>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Comment-Date: Wed, 17 Dec 2025 16:44:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Anders Hartvoll Ruud <and...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Anders Hartvoll Ruud (Gerrit)

unread,
Dec 17, 2025, 1:16:53 PM (3 days ago) Dec 17
to David Awogbemila, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from David Awogbemila

Anders Hartvoll Ruud added 1 comment

File third_party/blink/renderer/core/css/post_style_update_scope.h
Line 76, Patchset 4: // Elements which declare named animation triggers, i.e. timeline-trigger.
HeapHashSet<Member<Element>> elements_with_pending_trigger_updates_;
Anders Hartvoll Ruud . unresolved

Why not add a bool on `CSSAnimationUpdate` (`needs_trigger_update`, or something) instead? All other pending updates are described there.

You could then apply the trigger updates during `MaybeApplyPendingUpdate` as normal?

David Awogbemila

I can look into this. I got the sense that `CSSAnimationUpdate` was trying to track changes to the `animation` property whereas the element declaring `timeline-trigger` might have no animation at all. Still I it might be possible to use `CSSAnimationUpdate` in a way that makes sense so I'll explore that.

(I guess this is relevant to your other comments)

Anders Hartvoll Ruud

Right. At least it's current (pre-trigger) purposes is to capture any change to the "stateful animations machinery" that results from a style resolution. That could be transitions, animations, or timelines.

Open in Gerrit

Related details

Attention is currently required from:
  • David Awogbemila
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: I3f7b0aead991e8456b11a389dc6626a6577981bf
Gerrit-Change-Number: 7255899
Gerrit-PatchSet: 5
Gerrit-Owner: David Awogbemila <awogb...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: David Awogbemila <awogb...@chromium.org>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-Attention: David Awogbemila <awogb...@chromium.org>
Gerrit-Comment-Date: Wed, 17 Dec 2025 18:16:34 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: David Awogbemila <awogb...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

AI Code Reviewer (Gerrit)

unread,
Dec 18, 2025, 3:34:57 PM (2 days ago) Dec 18
to David Awogbemila, AyeAye, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, blink-revie...@chromium.org, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, zol...@webkit.org

AI Code Reviewer added 1 comment

File third_party/blink/renderer/core/layout/naming_scope.h
Line 42, Patchset 1 (Latest): const ScopedCSSName* GetScopedName() const { return name_.Get(); }
AI Code Reviewer . unresolved

nit: Blink Style Guide: Naming - Precede setters with the word “Set”; use bare words for getters. Please rename 'GetScopedName' to 'ScopedName' (or 'ScopedCSSName') to follow the bare word convention for getters, as it does not conflict with the type name.

To keep this interaction as brief and non-intrusive as possible, please consider responding with one of following options:
**Done** | **OK But Won't Fix**: reason | **Later**: b/<bug_id> | **Invalid:** reason


_This comment was generated by [Experimental Blink C++ Code Review Agent](http://go/blink-c++-code-review-agent)._
_AI reviews can sometimes be inaccurate; We appreciate your 🙏 feedback 🙏 to help us improve._
_[File a bug](http://go/blink-c++-code-review-agent-feedback) | [Provide feedback on chat](https://chat.google.com/room/AAQA0zhQHe0?cls=4) | [Opt-out](https://ganpati2.corp.google.com/group/peep-genai-blink-agent-optout.prod)_

Open in Gerrit

Related details

Attention set is empty
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: Id63cac016684e26df2e91876c28d281f5edcd836
Gerrit-Change-Number: 7275449
Gerrit-PatchSet: 1
Gerrit-Owner: David Awogbemila <awogb...@chromium.org>
Gerrit-Reviewer: David Awogbemila <awogb...@chromium.org>
Gerrit-CC: AI Code Reviewer <peep-gen...@system.gserviceaccount.com>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-Comment-Date: Thu, 18 Dec 2025 20:34:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

David Awogbemila (Gerrit)

unread,
Dec 18, 2025, 8:55:53 PM (2 days ago) Dec 18
to AI Code Reviewer, AyeAye, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, blink-revie...@chromium.org, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, zol...@webkit.org

David Awogbemila abandoned this change

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • 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: abandon
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id63cac016684e26df2e91876c28d281f5edcd836
Gerrit-Change-Number: 7275449
Gerrit-PatchSet: 3
satisfied_requirement
unsatisfied_requirement
open
diffy

David Awogbemila (Gerrit)

unread,
Dec 18, 2025, 10:00:45 PM (2 days ago) Dec 18
to Anders Hartvoll Ruud, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Anders Hartvoll Ruud

David Awogbemila added 4 comments

File third_party/blink/renderer/core/css/post_style_update_scope.h
Line 76, Patchset 4: // Elements which declare named animation triggers, i.e. timeline-trigger.
HeapHashSet<Member<Element>> elements_with_pending_trigger_updates_;
Anders Hartvoll Ruud . resolved

Why not add a bool on `CSSAnimationUpdate` (`needs_trigger_update`, or something) instead? All other pending updates are described there.

You could then apply the trigger updates during `MaybeApplyPendingUpdate` as normal?

David Awogbemila

I can look into this. I got the sense that `CSSAnimationUpdate` was trying to track changes to the `animation` property whereas the element declaring `timeline-trigger` might have no animation at all. Still I it might be possible to use `CSSAnimationUpdate` in a way that makes sense so I'll explore that.

(I guess this is relevant to your other comments)

Anders Hartvoll Ruud

Right. At least it's current (pre-trigger) purposes is to capture any change to the "stateful animations machinery" that results from a style resolution. That could be transitions, animations, or timelines.

David Awogbemila

Done

File third_party/blink/renderer/core/css/resolver/style_resolver.cc
Line 3662, Patchset 4:void StyleResolver::ApplyTriggerData(StyleResolverState& state) {
Anders Hartvoll Ruud . resolved

Why does this not happen in `StyleResolver::ApplyAnimatedStyle`? Every other `CSSAnimationData::CalculateFooUpdate` already happens there.

David Awogbemila

Done

Line 3663, Patchset 4: const ComputedStyle* old_style = state.GetElement().GetComputedStyle();
Anders Hartvoll Ruud . resolved

This is not the correct old style. (Use `state.OldStyle()`.)

David Awogbemila

Acknowledged

Line 3669, Patchset 4: PostStyleUpdateScope::CurrentAnimationData()->SetPendingTriggerUpdate(
state.GetElement(), state.AnimationUpdate());
Anders Hartvoll Ruud . resolved

It's unfortunate to add a second place where this update object it set. The existing call to `SetAnimationUpdateIfNeeded` should be enough? The `CSSAnimationUpdate` we set here will also be overwritten by `SetAnimationUpdateIfNeeded`.

David Awogbemila

Acknowledged

Open in Gerrit

Related details

Attention is currently required from:
  • Anders Hartvoll Ruud
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: I3f7b0aead991e8456b11a389dc6626a6577981bf
Gerrit-Change-Number: 7255899
Gerrit-PatchSet: 6
Gerrit-Owner: David Awogbemila <awogb...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: David Awogbemila <awogb...@chromium.org>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Comment-Date: Fri, 19 Dec 2025 03:00:35 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Anders Hartvoll Ruud (Gerrit)

unread,
Dec 19, 2025, 7:53:16 AM (21 hours ago) Dec 19
to David Awogbemila, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from David Awogbemila

Anders Hartvoll Ruud voted and added 1 comment

Votes added by Anders Hartvoll Ruud

Code-Review+1

1 comment

Commit Message
Line 15, Patchset 6 (Latest):place to apply style changes.
Anders Hartvoll Ruud . unresolved

That's true, but it's not a good place to _calculate_ those changes. We'll ultimately need to split up the "calculate what to do" part of `UpdateNamedTriggers` and the "apply what we previously calculated" part of `UpdateNamedTriggers`, perform the former during `ResolveStyle`, and perform the latter during `MaybeApplyPendingUpdate`.

So the question is: Is this CL valuable as a step towards that? I would only land this if the answer to that question is "yes". Otherwise, we can probably live with the side-effects for a bit?

Open in Gerrit

Related details

Attention is currently required from:
  • David Awogbemila
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement 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: I3f7b0aead991e8456b11a389dc6626a6577981bf
Gerrit-Change-Number: 7255899
Gerrit-PatchSet: 6
Gerrit-Owner: David Awogbemila <awogb...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: David Awogbemila <awogb...@chromium.org>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-Attention: David Awogbemila <awogb...@chromium.org>
Gerrit-Comment-Date: Fri, 19 Dec 2025 12:52:58 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

David Awogbemila (Gerrit)

unread,
Dec 19, 2025, 11:53:11 AM (17 hours ago) Dec 19
to Anders Hartvoll Ruud, Chromium LUCI CQ, Menard, Alexis, chromium...@chromium.org, Olga Gerchikov, apavlo...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-re...@chromium.org, blink-revi...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, zol...@webkit.org
Attention needed from Anders Hartvoll Ruud

David Awogbemila voted and added 1 comment

Votes added by David Awogbemila

Commit-Queue+1

1 comment

Commit Message
Line 15, Patchset 6:place to apply style changes.
Anders Hartvoll Ruud . unresolved

That's true, but it's not a good place to _calculate_ those changes. We'll ultimately need to split up the "calculate what to do" part of `UpdateNamedTriggers` and the "apply what we previously calculated" part of `UpdateNamedTriggers`, perform the former during `ResolveStyle`, and perform the latter during `MaybeApplyPendingUpdate`.

So the question is: Is this CL valuable as a step towards that? I would only land this if the answer to that question is "yes". Otherwise, we can probably live with the side-effects for a bit?

David Awogbemila

Yeah I believe it is a step towards that. I've now incorporated some of the [changes](https://chromium-review.googlesource.com/c/chromium/src/+/7255899/6..7) (between ps6 & 7) that I had initially deferred to crrev.com/c/7237813. This makes it easier to see that `UpdateNamedTriggers` now does less work.

Open in Gerrit

Related details

Attention is currently required from:
  • Anders Hartvoll Ruud
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: I3f7b0aead991e8456b11a389dc6626a6577981bf
Gerrit-Change-Number: 7255899
Gerrit-PatchSet: 7
Gerrit-Owner: David Awogbemila <awogb...@chromium.org>
Gerrit-Reviewer: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Reviewer: David Awogbemila <awogb...@chromium.org>
Gerrit-CC: Menard, Alexis <alexis...@intel.com>
Gerrit-CC: Olga Gerchikov <gerc...@microsoft.com>
Gerrit-Attention: Anders Hartvoll Ruud <and...@chromium.org>
Gerrit-Comment-Date: Fri, 19 Dec 2025 16:53:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages