Skip to content

Conversation

@chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Jan 19, 2026

This is a follow-up to https://crrev.com/c/7123703 , but it was blocked
on other problems, which got fixed by https://crrev.com/c/7239030 . We
can now get anchor animations that don't change any styles right away
(i.e. no visual updates until further into the animation) to trigger
relayout of anchor-positioned elements when needed.

If the very first animation frame actually has style changes that affect
layout (e.g. transforms that affect an anchor), we still haven't moved
the work off the main thread, and we'll therefore lay out, and by doing
that, HasRunningAnchorTransformAnimation() in PhysicalFragment will
return true, which in turn will make sure that the animation keeps
running on the main thread. This was already working.

On the other hand, if the first frame of an animation doesn't change
style that affects layout, the animation would be moved to the
compositor thread, and we'd never hear from it again, not even when any
style changes actually occur later on. To fix this, detect that a
transform-related animation wants to run on the compositor, mark for
layout, so that the physical fragments get updated for
HasRunningAnchorTransformAnimation(), so that we'll be able to keep the
animation on the main thread

Note: The test included would only fail with run_wpt_tests, not
run_web_tests.

Bug: 382294252
Change-Id: I193c354f0e28b4b908d75ce1b200c2c8142be43c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7451459
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1571069}

This is a follow-up to https://crrev.com/c/7123703 , but it was blocked
on other problems, which got fixed by https://crrev.com/c/7239030 . We
can now get anchor animations that don't change any styles right away
(i.e. no visual updates until further into the animation) to trigger
relayout of anchor-positioned elements when needed.

If the very first animation frame actually has style changes that affect
layout (e.g. transforms that affect an anchor), we still haven't moved
the work off the main thread, and we'll therefore lay out, and by doing
that, HasRunningAnchorTransformAnimation() in PhysicalFragment will
return true, which in turn will make sure that the animation keeps
running on the main thread. This was already working.

On the other hand, if the first frame of an animation *doesn't* change
style that affects layout, the animation would be moved to the
compositor thread, and we'd never hear from it again, not even when any
style changes actually occur later on. To fix this, detect that a
transform-related animation wants to run on the compositor, mark for
layout, so that the physical fragments get updated for
HasRunningAnchorTransformAnimation(), so that we'll be able to keep the
animation on the main thread

Note: The test included would only fail with run_wpt_tests, not
run_web_tests.

Bug: 382294252
Change-Id: I193c354f0e28b4b908d75ce1b200c2c8142be43c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7451459
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1571069}
Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot merged commit ce54b18 into master Jan 19, 2026
19 checks passed
@chromium-wpt-export-bot chromium-wpt-export-bot deleted the chromium-export-cl-7451459 branch January 19, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants