Bug 1046055 part 1 - Remove nsPresContext parameter from nsLayoutUtils::HasCurrentAnimations; r=dbaron
authorBrian Birtles <birtles@gmail.com>
Thu, 02 Oct 2014 15:14:13 +0900
changeset 208346 723e749323c64d9aa7ee4ffeb51314da2b7e8d45
parent 208345 41476731392e5071854bd36eb52faa7a40e8fde7
child 208347 37090bda656483e2e7163403b3d67b2051431311
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersdbaron
bugs1046055
milestone35.0a1
Bug 1046055 part 1 - Remove nsPresContext parameter from nsLayoutUtils::HasCurrentAnimations; r=dbaron
layout/base/nsLayoutUtils.cpp
layout/base/nsLayoutUtils.h
layout/xul/nsMenuPopupFrame.cpp
layout/xul/nsXULPopupManager.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -389,18 +389,17 @@ nsLayoutUtils::HasAnimations(nsIContent*
   return GetAnimationsOrTransitions(aContent, nsGkAtoms::animationsProperty,
                                     aProperty) ||
          GetAnimationsOrTransitions(aContent, nsGkAtoms::transitionsProperty,
                                     aProperty);
 }
 
 bool
 nsLayoutUtils::HasCurrentAnimations(nsIContent* aContent,
-                                    nsIAtom* aAnimationProperty,
-                                    nsPresContext* aPresContext)
+                                    nsIAtom* aAnimationProperty)
 {
   if (!aContent->MayHaveAnimations())
     return false;
 
   AnimationPlayerCollection* collection =
     static_cast<AnimationPlayerCollection*>(
       aContent->GetProperty(aAnimationProperty));
   return (collection && collection->HasCurrentAnimations());
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -1879,18 +1879,17 @@ public:
   static bool HasAnimations(nsIContent* aContent, nsCSSProperty aProperty);
 
   /**
    * Returns true if the content node has any current animations or transitions.
    * A current animation is any animation that has not yet finished playing
    * including paused animations.
    */
   static bool HasCurrentAnimations(nsIContent* aContent,
-                                   nsIAtom* aAnimationProperty,
-                                   nsPresContext* aPresContext);
+                                   nsIAtom* aAnimationProperty);
 
   /**
    * Checks if off-main-thread animations are enabled.
    */
   static bool AreAsyncAnimationsEnabled();
 
   /**
    * Checks if we should warn about animations that can't be async
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -504,17 +504,18 @@ nsMenuPopupFrame::LayoutPopup(nsBoxLayou
   if (mIsOpenChanged) {
     mIsOpenChanged = false;
 
 #ifndef MOZ_WIDGET_GTK
     // If the animate attribute is set to open, check for a transition and wait
     // for it to finish before firing the popupshown event.
     if (mContent->AttrValueIs(kNameSpaceID_None, nsGkAtoms::animate,
                               nsGkAtoms::open, eCaseMatters) &&
-        nsLayoutUtils::HasCurrentAnimations(mContent, nsGkAtoms::transitionsProperty, pc)) {
+        nsLayoutUtils::HasCurrentAnimations(mContent,
+                                            nsGkAtoms::transitionsProperty)) {
       mPopupShownDispatcher = new nsXULPopupShownEvent(mContent, pc);
       mContent->AddSystemEventListener(NS_LITERAL_STRING("transitionend"),
                                        mPopupShownDispatcher, false, false);
       return;
     }
 #endif
 
     // If there are no transitions, fire the popupshown event right away.
--- a/layout/xul/nsXULPopupManager.cpp
+++ b/layout/xul/nsXULPopupManager.cpp
@@ -1416,17 +1416,18 @@ nsXULPopupManager::FirePopupHidingEvent(
             (!animate.EqualsLiteral("cancel") || aIsCancel)) {
           presShell->FlushPendingNotifications(Flush_Layout);
 
           // Get the frame again in case the flush caused it to go away
           popupFrame = do_QueryFrame(aPopup->GetPrimaryFrame());
           if (!popupFrame)
             return;
 
-          if (nsLayoutUtils::HasCurrentAnimations(aPopup, nsGkAtoms::transitionsProperty, aPresContext)) {
+          if (nsLayoutUtils::HasCurrentAnimations(aPopup,
+                nsGkAtoms::transitionsProperty)) {
             nsRefPtr<TransitionEnder> ender = new TransitionEnder(aPopup, aDeselectMenu);
             aPopup->AddSystemEventListener(NS_LITERAL_STRING("transitionend"),
                                            ender, false, false);
             return;
           }
         }
       }
 #endif