Commit eadef3f6 authored by Kevin Ellis's avatar Kevin Ellis Committed by Commit Bot

Web-animation: Force synchronous resolution of finished state in Animation::Update

Per spec, a microtask checkpoint should fire after the updates.
Currently, the microtask checkpoint is firing later in the document
lifecycle. For now, we need to force the update to finish synchronously
in order to prevent potential rendering glitches due to a late finish.

Bug: 1029695, 1029567
Change-Id: I1f6a67a81c2a068ba98e4464e2072963ec324b13
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1946528
Commit-Queue: Kevin Ellis <kevers@chromium.org>
Reviewed-by: default avatarMajid Valipour <majidvp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720568}
parent 08f81e48
...@@ -1719,8 +1719,13 @@ bool Animation::Update(TimingUpdateReason reason) { ...@@ -1719,8 +1719,13 @@ bool Animation::Update(TimingUpdateReason reason) {
} }
if (reason == kTimingUpdateForAnimationFrame) { if (reason == kTimingUpdateForAnimationFrame) {
if (idle || CalculateAnimationPlayState() == kFinished) if (idle || CalculateAnimationPlayState() == kFinished) {
// TODO(crbug.com/1029348): Per spec, we should have a microtask
// checkpoint right after the update cycle. Once this is fixed we should
// no longer need to force a synchronous resolution here.
AsyncFinishMicrotask();
finished_ = true; finished_ = true;
}
} }
DCHECK(!outdated_); DCHECK(!outdated_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment