Bug 290993

Summary: [web-animations] start time of animations created during a page rendering update should match that update's timeline time
Product: WebKit Reporter: Antoine Quint <graouts>
Component: AnimationsAssignee: Antoine Quint <graouts>
Status: RESOLVED FIXED    
Severity: Normal CC: graouts, rackler, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=291974
https://bugs.webkit.org/show_bug.cgi?id=292032
https://github.com/web-platform-tests/wpt/pull/53971
https://bugs.webkit.org/show_bug.cgi?id=299823
Bug Depends on: 290772, 290995    
Bug Blocks:    

Antoine Quint
Reported 2025-04-03 06:27:16 PDT
Safari differs from Chrome and Firefox when setting the start time of animations created during a page rendering update. In Safari, we mark any animation that is pending as ready when we run the "update animations and send events" step, which means that any animation pending at this point will share the same start time and will also have a current time of 0 when the ready promise is resolved. In Chrome and Firefox, animations created during a page rendering update will have their start time set to the timeline time of that same update, even though their ready promise may be resolved at a later time, for instance during the next page rendering update. This means that the current time of animations will likely not be 0 when the ready promise is resolved. This is particularly visible for CSS-originated animations which may be created during a page rendering update as styles are recalculated and layout is updated a few steps after animations are updated. As such, Safari typically is one rendering frame behind Chrome and Firefox when dealing with CSS Transitions and CSS Animations. This behavior is not actually a spec violation since the start time and time where the ready promise is resolved is left as implementation-dependent. However, this is proving to be a web compatibility issue since we found that captions may flicker on YouTube for instance, and this is due to the behavior described above. In fact, for CSS Transitions, we introduced some ad-hoc current time computation code in 226359@main and 226577@main to deal with some compatibility issues. We should adopt the same behavior as Chrome and Firefox here.
Attachments
Antoine Quint
Comment 1 2025-04-03 06:27:31 PDT
Antoine Quint
Comment 2 2025-04-04 01:11:41 PDT
EWS
Comment 3 2025-04-23 23:52:09 PDT
Committed 294049@main (483c60c629b8): <https://commits.webkit.org/294049@main> Reviewed commits have been landed. Closing PR #43626 and removing active labels.
Antoine Quint
Comment 4 2025-04-28 07:51:38 PDT
*** Bug 287833 has been marked as a duplicate of this bug. ***
Ahmad Saleem
Comment 5 2025-07-24 18:43:16 PDT
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/53971
Note You need to log in before you can comment on or make changes to this bug.