Bug 1415780 - Undef GetCurrentTime in the template function that uses Animation::GetCurrentTime. r? draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Sat, 27 Jan 2018 21:17:26 +0900
changeset 748017 ac437e98691b9c120269b45512ae5ac915cad997
parent 748015 232dbd5acc3f2be2be59eddb3e7ef1d00d9111a0
child 748018 a0e5533273a3c240af9bc66833d4ee5eb6b59fc9
push id97048
push userhikezoe@mozilla.com
push dateSat, 27 Jan 2018 12:23:10 +0000
bugs1415780
milestone60.0a1
Bug 1415780 - Undef GetCurrentTime in the template function that uses Animation::GetCurrentTime. r? MozReview-Commit-ID: DaOZtYRx4Ud
layout/style/AnimationCommon.h
--- a/layout/style/AnimationCommon.h
+++ b/layout/style/AnimationCommon.h
@@ -298,16 +298,22 @@ ImplCycleCollectionTraverse(nsCycleColle
 // Return the TransitionPhase or AnimationPhase to use when the animation
 // doesn't have a target effect.
 template <typename PhaseType>
 PhaseType GetAnimationPhaseWithoutEffect(const dom::Animation& aAnimation)
 {
   MOZ_ASSERT(!aAnimation.GetEffect(),
              "Should only be called when we do not have an effect");
 
+// GetCurrentTime is defined in winbase.h as zero argument macro forwarding to
+// GetTickCount().
+#ifdef GetCurrentTime
+#undef GetCurrentTime
+#endif
+
   Nullable<TimeDuration> currentTime = aAnimation.GetCurrentTime();
   if (currentTime.IsNull()) {
     return PhaseType::Idle;
   }
 
   // If we don't have a target effect, the duration will be zero so the phase is
   // 'before' if the current time is less than zero.
   return currentTime.Value() < TimeDuration()