Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9d5ef1cd542fc2edb1c5b31fc405470333a26416
      
https://github.com/WebKit/WebKit/commit/9d5ef1cd542fc2edb1c5b31fc405470333a26416
  Author: Antoine Quint <[email protected]>
  Date:   2026-01-28 (Wed, 28 Jan 2026)

  Changed paths:
    M Source/WebCore/animation/KeyframeEffect.cpp

  Log Message:
  -----------
  [threaded-animations] test 
`fast/animation/css-animation-resuming-when-visible-with-style-change2.html` 
fails with "Threaded Time-based Animations" enabled
https://bugs.webkit.org/show_bug.cgi?id=306432
rdar://169102755

Reviewed by Anne van Kesteren.

This test checks that while animations are suspended (simulating what would 
happen for instance
when page visibility would be set to hidden) the animations no longer affect 
their target's
computed style.

In the test, in the next run loop after calling `internals.suspendAnimations()` 
we query the
computed style of the single animation target and save it to compare it with 
the computed style
100ms later and check that it is unchanged. In this test, the animation targets 
the `opacity`
property which allows for acceleration. While the animation runs accelerated, 
the animation does
not get invalidated and its style do not get updated. This is by design so that 
the web process
can do minimal work if all it would have to do would be to run animations which 
are handled by
a separate process. If the computed style of an element targeted by such an 
animation is queried,
a dedicated code path is used to compute the live current time of the animation 
since the current
time associated with that element is going to be stale.

Now, when an animation is suspended, it no longer is accelerated since it's not 
expected to
continuously update. What happens in this state is that until animations are 
suspended, the animation
target's associated computed style is never updated. That is expected behavior. 
However, once we
suspend the animation, at which point the animation is no longer accelerated, 
that computed style
is now incorrect since we no longer hit the special accelerated animation code 
path when querying
the computed style.

We now ensure we call `KeyframeEffect:invalidate()` under 
`KeyframeEffect::animationSuspensionStateDidChange()`,
which is called when the effect's associated animation's suspended state 
changes. This ensures that the
target's associated computed style is correctly marked as dirty and will be 
recomputed when next queried.

Note that there is no test change in this patch since the flag is not yet 
enabled on bots. This
was caught in preparation of that running animation tests locally using
`--experimental-feature ThreadedTimeBasedAnimationsEnabled=true`.

* Source/WebCore/animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::animationSuspensionStateDidChange):

Canonical link: https://commits.webkit.org/306375@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to