Bug 207355

Summary: Web animations transition through PlayState::Finished when starting
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: AnimationsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: dino, graouts, simon.fraser
Priority: P2    
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Hover the box none

Description Simon Fraser (smfr) 2020-02-06 14:33:42 PST
Created attachment 389998 [details]
Hover the box

Put a breakpoint on the line after:

 if (currentFinishedState && !m_finishedPromise->isFulfilled()) {

in WebAnimation::updateFinishedState(). Hover the box in the attached test case. You hit the breakpoint when the animation starts. Weird.
Comment 1 Simon Fraser (smfr) 2020-02-06 14:35:18 PST
This is evaluating to true:

    if (animationCurrentTime && ((effectivePlaybackRate() > 0 && (*animationCurrentTime + timeEpsilon) >= effectEndTime()) || (effectivePlaybackRate() < 0 && (*animationCurrentTime - timeEpsilon) <= 0_s)))
Comment 2 Simon Fraser (smfr) 2020-02-06 14:36:19 PST
effectivePlaybackRate() is 1
effectEndTime() is 0
animationCurrentTime is 0
Comment 3 Antoine Quint 2023-05-10 12:01:43 PDT
This reproduces still with ToT. Not sure this is actually indicative of a bug, but it does seem odd.