[animation-trigger] Don't update attachments if layout is needed #56989
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch address a few issues that affected the linked bug:
timeline-trigger, changes on a different element, we might fail to
queue the animation up for a trigger attachment update, because, as
far as it knows, the animating element's style didn't change.
layout update (due to a timeline-trigger change) but we then skip[1]
the layout update. Performing the trigger attachments updates in
this scenario causes us to attach animations to triggers based on
stale information.
To address 1., this patch has DocumentAnimations::triggered_animations_
consistently track animations whose styles declare trigger attachments
per the most recent style update.
To address 2., this patch avoids the trigger attachment update if we
know that we have a pending layout.
[1]
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/dom/document.cc;l=2627?q=document::updatestyleandlayouttree&ss=chromium%2Fchromium%2Fsrc
Bug: 467869217
Change-Id: I3c94efb90e7a9338afe2173f0aa57e81016ed8d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7265794
Reviewed-by: Anders Hartvoll Ruud <[email protected]>
Reviewed-by: David Awogbemila <[email protected]>
Commit-Queue: David Awogbemila <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1564397}