From 685ae236c8f4fec1b399cf050c3707b8c4288401 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Tue, 15 May 2018 14:06:42 +0200 Subject: [PATCH] Use a temporary in Animation::Tick() --- dom/animation/Animation.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dom/animation/Animation.cpp b/dom/animation/Animation.cpp index bd318f79e3..f4d29376c4 100644 --- a/dom/animation/Animation.cpp +++ b/dom/animation/Animation.cpp @@ -589,8 +589,10 @@ Animation::Tick() // during the *previous* tick of the refresh driver, it can still be // ahead of the *current* timeline time when we are using the // vsync timer so we need to clamp it to the timeline time. - mPendingReadyTime.SetValue(std::min(mTimeline->GetCurrentTime().Value(), - mPendingReadyTime.Value())); + TimeDuration currentTime = mTimeline->GetCurrentTime().Value(); + if (currentTime < mPendingReadyTime.Value()) { + mPendingReadyTime.SetValue(currentTime); + } FinishPendingAt(mPendingReadyTime.Value()); mPendingReadyTime.SetNull(); }