diff --git a/dom/animation/AnimationUtils.h b/dom/animation/AnimationUtils.h index 3a81f92c3f1f..c6d2a1eb1b6c 100644 --- a/dom/animation/AnimationUtils.h +++ b/dom/animation/AnimationUtils.h @@ -32,8 +32,12 @@ public: dom::Nullable result; if (!aTime.IsNull()) { + // 0 is an inappropriate mixin for this this area; however CSS Animations needs to + // have it's Time Reduction Logic refactored, so it's currently only clamping for + // RFP mode. RFP mode gives a much lower time precision, so we accept the security + // leak here for now result.SetValue( - nsRFPService::ReduceTimePrecisionAsMSecs(aTime.Value().ToMilliseconds(), TimerPrecisionType::RFPOnly) + nsRFPService::ReduceTimePrecisionAsMSecs(aTime.Value().ToMilliseconds(), 0, TimerPrecisionType::RFPOnly) ); } diff --git a/layout/style/nsAnimationManager.cpp b/layout/style/nsAnimationManager.cpp old mode 100644 new mode 100755 index 689954978abc..a0bfa48f5d4f --- a/layout/style/nsAnimationManager.cpp +++ b/layout/style/nsAnimationManager.cpp @@ -246,7 +246,12 @@ CSSAnimation::QueueEvents(const StickyTimeDuration& aActiveTime) const TimeStamp& aTimeStamp) { double elapsedTime = aElapsedTime.ToSeconds(); if (aMessage == eAnimationCancel) { - elapsedTime = nsRFPService::ReduceTimePrecisionAsSecs(elapsedTime); + // 0 is an inappropriate value for this callsite. What we need to do is + // use a single random value for all increasing times reportable. + // That is to say, whenever elapsedTime goes negative (because an + // animation restarts, something rewinds the animation, or otherwise) + // a new random value for the mix-in must be generated. + elapsedTime = nsRFPService::ReduceTimePrecisionAsSecs(elapsedTime, 0, TimerPrecisionType::RFPOnly); } events.AppendElement(AnimationEventInfo(mAnimationName, mOwningElement.Target(), diff --git a/layout/style/nsTransitionManager.cpp b/layout/style/nsTransitionManager.cpp old mode 100644 new mode 100755 index 9b2179ae4725..bf6f108dd76a --- a/layout/style/nsTransitionManager.cpp +++ b/layout/style/nsTransitionManager.cpp @@ -267,7 +267,12 @@ CSSTransition::QueueEvents(const StickyTimeDuration& aActiveTime) const TimeStamp& aTimeStamp) { double elapsedTime = aElapsedTime.ToSeconds(); if (aMessage == eTransitionCancel) { - elapsedTime = nsRFPService::ReduceTimePrecisionAsSecs(elapsedTime); + // 0 is an inappropriate value for this callsite. What we need to do is + // use a single random value for all increasing times reportable. + // That is to say, whenever elapsedTime goes negative (because an + // animation restarts, something rewinds the animation, or otherwise) + // a new random value for the mix-in must be generated. + elapsedTime = nsRFPService::ReduceTimePrecisionAsSecs(elapsedTime, 0, TimerPrecisionType::RFPOnly); } events.AppendElement(AnimationEventInfo(TransitionProperty(), mOwningElement.Target(),