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

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

  Log Message:
  -----------
  [threaded-animations] WPT test 
`scroll-animations/view-timelines/timeline-offset-in-keyframe.html` crashes 
with "Threaded Time-based Animations" enabled
https://bugs.webkit.org/show_bug.cgi?id=306652
rdar://169304641

Reviewed by Simon Fraser.

One of the subtests in the WPT test 
`scroll-animations/view-timelines/timeline-offset-in-keyframe.html`
sets up an animation as follows:

```
const anim = target.animate([
    { offset: "cover 0%", opacity: 0 },
    { offset: "cover 100%", opacity: 1 }
], {
    rangeStart: { rangeName: 'contain', offset: CSS.percent(0) },
    rangeEnd: { rangeName: 'contain', offset: CSS.percent(100) },
    duration: 10000, fill: 'both'
});
```

Notice the `offset` keys on the keyframes object using view progress timelines 
ranges [0]
which makes it so that the computed keyframes for this animation's effect will 
have unresolved
computed offsets if the timeline is not a view timeline, such as the default 
document timeline.

Running this test we would fail `ASSERT(!std::isnan(srcKeyframe.offset()))` in 
the `AcceleratedEffect`
constructor. Since an effect with a keyframe with an unresolved computed offset 
will not yield
interpolated values and thus, it makes no sense to accelerate it, so we update 
`KeyframeEffect::canBeAccelerated()`
to disable acceleration if any such keyframe exists. To aid that, we add a new 
`hasKeyframeWithUnresolvedComputedOffset()`
method on `BlendingKeyframes`.

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`.

[0] https://drafts.csswg.org/scroll-animations-1/#view-timelines-ranges

* Source/WebCore/animation/BlendingKeyframes.cpp:
(WebCore::BlendingKeyframes::hasKeyframeWithUnresolvedComputedOffset const):
* Source/WebCore/animation/BlendingKeyframes.h:
* Source/WebCore/animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::canBeAccelerated const):

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



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

Reply via email to