Bug 1538796 - Part 3 - convert IPDL OptionalOpacity union to use native Maybe syntax; r=kats

Depends on D24748

Differential Revision: https://phabricator.services.mozilla.com/D24749
This commit is contained in:
Alex Gaynor
2019-03-25 19:29:46 +00:00
parent 02bb7b63b4
commit b8181f15ab
5 changed files with 15 additions and 25 deletions

View File

@@ -88,23 +88,21 @@ bool AnimationInfo::StartPendingAnimations(const TimeStamp& aReadyTime) {
// If the animation is doing an async update of its playback rate, then we
// want to match whatever its current time would be at *aReadyTime*.
if (!std::isnan(anim.previousPlaybackRate()) &&
anim.startTime().type() == MaybeTimeDuration::TTimeDuration &&
if (!std::isnan(anim.previousPlaybackRate()) && anim.startTime().isSome() &&
!anim.originTime().IsNull() && !anim.isNotPlaying()) {
TimeDuration readyTime = aReadyTime - anim.originTime();
anim.holdTime() = dom::Animation::CurrentTimeFromTimelineTime(
readyTime, anim.startTime().get_TimeDuration(),
anim.previousPlaybackRate());
readyTime, anim.startTime().ref(), anim.previousPlaybackRate());
// Make start time null so that we know to update it below.
anim.startTime() = null_t();
anim.startTime() = Nothing();
}
// If the animation is play-pending, resolve the start time.
if (anim.startTime().type() == MaybeTimeDuration::Tnull_t &&
!anim.originTime().IsNull() && !anim.isNotPlaying()) {
if (anim.startTime().isNothing() && !anim.originTime().IsNull() &&
!anim.isNotPlaying()) {
TimeDuration readyTime = aReadyTime - anim.originTime();
anim.startTime() = dom::Animation::StartTimeFromTimelineTime(
readyTime, anim.holdTime(), anim.playbackRate());
anim.startTime() = Some(dom::Animation::StartTimeFromTimelineTime(
readyTime, anim.holdTime(), anim.playbackRate()));
updated = true;
}
}