New issue
Advanced search Search tips

Issue 771977 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 772407



Sign in to add a comment

Web Animations: onfinish and finished event/promise resolved in wrong order

Project Member Reported by smcgruer@chromium.org, Oct 5 2017

Issue description

We currently fail the following test because the onfinish event fires before the finished promise resolves:

external/wpt/web-animations/interfaces/Animation/onfinish.html
  - onfinish event is fired when the currentTime < 0 and the playbackRate < 0

I am not 100% on this, but from the spec (https://w3c.github.io/web-animations/#update-an-animations-finished-state) it appears like one should resolve the promise first (which is what the test expects):

"The procedure to update an animation’s finished state for animation ... is as follows:
...
5. If current finished state is true and the current finished promise is not yet resolved, perform the following steps:

  1. Let finish notification steps refer to the following procedure:

    1. If animation’s play state is not equal to finished, abort these steps.
    2. Resolve animation’s current finished promise object with animation.
    3. Queue a task to fire a finish event at animation. The task source for this task is the DOM manipulation task source.

  2. If synchronously notify is true, cancel any queued microtask to run the finish notification steps for this animation, and run the finish notification steps immediately.

  3. Otherwise, if synchronously notify is false, queue a microtask to run finish notification steps for animation unless there is already a microtask queued to run those steps for animation.
"

Whether 'synchronously notify' is true or false, it appears that the promise should resolve before the event. Our code does not currently do this:

[97710:97744:1005/095145.898140:10879385613997:INFO:Animation.cpp(963)] Enqueueing pending_finished_event_
[97710:97744:1005/095145.898223:10879385614077:INFO:Animation.cpp(1145)] Resolving finished promise (maybe async)
[97710:97744:1005/095145.898246:10879385614099:INFO:Animation.cpp(1239)] Animation::ResolvePromiseMaybeAsync, resolve promise without posting
[97710:97744:1005/095145.898298:10879385614152:INFO:ScriptedAnimationController.cpp(116)] Dispatching "finish" to "AnimationPlayer"
[97710:97710:1005/095145.942713:10879385658570:INFO:CONSOLE(24)] "animation.onfinish fired", source: file:///usr/local/google/home/smcgruer/chromium/src/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/onfinish.html (24)
[97710:97710:1005/095145.942888:10879385658741:INFO:CONSOLE(19)] "animation.finished fired", source: file:///usr/local/google/home/smcgruer/chromium/src/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/onfinish.html (19)

It is interesting to me that it *looks* from the C++ side like we are resolving the promise first before dispatching finish, but the javascript definitely sees them the other way around.
 

Comment 1 by shend@chromium.org, Oct 5 2017

Labels: Hotlist-Interop Update-Quarterly
Blocking: 772407
Project Member

Comment 3 by bugdroid1@chromium.org, Oct 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c48db31689105ce81dcbe640416e45860299c248

commit c48db31689105ce81dcbe640416e45860299c248
Author: Stephen McGruer <smcgruer@chromium.org>
Date: Thu Oct 12 20:34:35 2017

Update crbug links for some failing WPT web-animations tests

Bug:  600248 , 771722, 771751, 771977,  771985 ,  772014 , 772048, 772060, 772076 
Change-Id: Ie08474f751fd45484627c8a52d84db13ca6b39ac
Reviewed-on: https://chromium-review.googlesource.com/702536
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Reviewed-by: Robert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508447}
[modify] https://crrev.com/c48db31689105ce81dcbe640416e45860299c248/third_party/WebKit/LayoutTests/TestExpectations

Cc: smcgruer@chromium.org
Owner: ----
Status: Available (was: Assigned)
Not planning to work on this in the near future, dropping to Available.

Sign in to add a comment