Bug 1297000 - Modify comparison of zero TimeDuration to use TimeDuration object rather than converting to milliseconds; r=birtles

MozReview-Commit-ID: DIccqtDb91u
This commit is contained in:
Yusuke Endho 2016-08-27 16:53:33 +09:00
Родитель 3a366477e0
Коммит 0f4c1508cb
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -390,7 +390,7 @@ Animation::PlayState() const
}
if ((mPlaybackRate > 0.0 && currentTime.Value() >= EffectEnd()) ||
(mPlaybackRate < 0.0 && currentTime.Value().ToMilliseconds() <= 0.0)) {
(mPlaybackRate < 0.0 && currentTime.Value() <= TimeDuration())) {
return AnimationPlayState::Finished;
}
@ -930,13 +930,13 @@ Animation::PlayNoUpdate(ErrorResult& aRv, LimitBehavior aLimitBehavior)
if (mPlaybackRate > 0.0 &&
(currentTime.IsNull() ||
(aLimitBehavior == LimitBehavior::AutoRewind &&
(currentTime.Value().ToMilliseconds() < 0.0 ||
(currentTime.Value() < TimeDuration() ||
currentTime.Value() >= EffectEnd())))) {
mHoldTime.SetValue(TimeDuration(0));
} else if (mPlaybackRate < 0.0 &&
(currentTime.IsNull() ||
(aLimitBehavior == LimitBehavior::AutoRewind &&
(currentTime.Value().ToMilliseconds() <= 0.0 ||
(currentTime.Value() <= TimeDuration() ||
currentTime.Value() > EffectEnd())))) {
if (EffectEnd() == TimeDuration::Forever()) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
@ -1136,7 +1136,7 @@ Animation::UpdateFinishedState(SeekFlag aSeekFlag,
}
} else if (mPlaybackRate < 0.0 &&
!currentTime.IsNull() &&
currentTime.Value().ToMilliseconds() <= 0.0) {
currentTime.Value() <= TimeDuration()) {
if (aSeekFlag == SeekFlag::DidSeek) {
mHoldTime = currentTime;
} else if (!mPreviousCurrentTime.IsNull()) {