Skip to content

Commit

Permalink
Prevent transitioncancel from firing after transtionend
Browse files Browse the repository at this point in the history
Per spec (https://drafts.csswg.org/css-transitions-2/#event-dispatch)
a transitioncancel should be fired on the following phase change

 not idle and not after --> idle

Previously we were only test for not idle --> idle, meaning that a
finished transition could erroneously trip a transitioncancel.

Bug: 979556
Change-Id: Iecd6c8d2a7ca4564925910f092fca4c78b6d79da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2348416
Commit-Queue: Kevin Ellis <[email protected]>
Reviewed-by: Xida Chen <[email protected]>
Cr-Commit-Position: refs/heads/master@{#796973}
  • Loading branch information
Kevin Ellis authored and chromium-wpt-export-bot committed Aug 11, 2020
1 parent b5bae34 commit 6bf0749
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions css/css-transitions/event-dispatch.tentative.html
Original file line number Diff line number Diff line change
Expand Up @@ -414,4 +414,22 @@
await waitForAnimationFrames(2);
}, 'Cancel the transition after clearing the target effect');

promise_test(async t => {
const { transition, watcher, div } = setupTransition(t, 'margin-left 100s');

// Seek to After phase.
transition.finish();
const events = await watcher.wait_for(
['transitionrun', 'transitionstart', 'transitionend'],
{
record: 'all',
}
);

transition.cancel();

// Then wait a couple of frames and check that no event was dispatched
await waitForAnimationFrames(2);
}, 'Cancel the transition after it finishes');

</script>

0 comments on commit 6bf0749

Please sign in to comment.