Fix DCHECK failure when playing after cancelling an animation.
The implementation of cancel was aligned with the web-animations spec in: https://chromium-review.googlesource.com/c/chromium/src/+/1824058 Resolving the ready promise after the reject and reset is not to spec [1]. After the above patch we no longer resolve the ready promise after a cancel, so it is possible to already have a pending promise when we enter the "pending" state. This introduced a DCHECK failure when transitioning from an idle state to a pending state. Per above this DCHECK is incorrect so we remove it. Previously, when an animation was cancelled, the destructor for PlayStateUpdateScope will not only reject and reset the ready promise, but it will then resolve this new promise. When transitioning from idle to pending, an additional reset is performed with a check that we do not already have a pending promise. Spec: https://drafts.csswg.org/web-animations/#canceling-an-animation-section Bug: 1012384 Change-Id: Id40fc094f599463a5e3ab67715edde02bbec6720 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1853164 Commit-Queue: Majid Valipour <majidvp@chromium.org> Reviewed-by:Majid Valipour <majidvp@chromium.org> Cr-Commit-Position: refs/heads/master@{#705094}
Showing
Please register or sign in to comment