Bug 1358965 - Drop unnecessary static_cast. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Tue, 25 Apr 2017 12:24:51 +0900
changeset 567481 807106fa937ad8144027582b46215ce471ffca1b
parent 567480 082427e7ab92dd088c93dca17c452b72c45f3c64
child 625666 34afab967b887547ac99809018dca6b8be953cc5
push id55591
push userhikezoe@mozilla.com
push dateTue, 25 Apr 2017 03:28:26 +0000
reviewersbirtles
bugs1358965
milestone55.0a1
Bug 1358965 - Drop unnecessary static_cast. r?birtles MozReview-Commit-ID: 1V1ISqv2uo1
layout/style/ServoBindings.cpp
layout/style/ServoBindings.h
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -452,62 +452,61 @@ Gecko_StyleAnimationsEquals(RawGeckoStyl
 }
 
 void
 Gecko_UpdateAnimations(RawGeckoElementBorrowed aElement,
                        nsIAtom* aPseudoTagOrNull,
                        ServoComputedValuesBorrowedOrNull aOldComputedValues,
                        ServoComputedValuesBorrowedOrNull aComputedValues,
                        ServoComputedValuesBorrowedOrNull aParentComputedValues,
-                       UpdateAnimationsTasks aTaskBits)
+                       UpdateAnimationsTasks aTasks)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(aElement);
   MOZ_ASSERT(!aPseudoTagOrNull ||
              aPseudoTagOrNull == nsCSSPseudoElements::before ||
              aPseudoTagOrNull == nsCSSPseudoElements::after);
 
   nsPresContext* presContext = nsContentUtils::GetContextForContent(aElement);
   if (!presContext) {
     return;
   }
 
-  UpdateAnimationsTasks tasks = static_cast<UpdateAnimationsTasks>(aTaskBits);
   if (presContext->IsDynamic() && aElement->IsInComposedDoc()) {
     const ServoComputedValuesWithParent servoValues =
       { aComputedValues, aParentComputedValues };
     CSSPseudoElementType pseudoType =
       nsCSSPseudoElements::GetPseudoType(aPseudoTagOrNull,
                                          CSSEnabledState::eForAllContent);
 
-    if (tasks & UpdateAnimationsTasks::CSSAnimations) {
+    if (aTasks & UpdateAnimationsTasks::CSSAnimations) {
       presContext->AnimationManager()->
         UpdateAnimations(const_cast<dom::Element*>(aElement), pseudoType,
                          servoValues);
     }
 
     // aComputedValues might be nullptr if the target element is now in a
     // display:none subtree. We still call Gecko_UpdateAnimations in this case
     // because we need to stop CSS animations in the display:none subtree.
     // However, we don't need to update transitions since they are stopped by
     // RestyleManager::AnimationsWithDestroyedFrame so we just return early
     // here.
     if (!aComputedValues) {
       return;
     }
 
-    if (tasks & UpdateAnimationsTasks::CSSTransitions) {
+    if (aTasks & UpdateAnimationsTasks::CSSTransitions) {
       MOZ_ASSERT(aOldComputedValues);
       const ServoComputedValuesWithParent oldServoValues =
         { aOldComputedValues, nullptr };
       presContext->TransitionManager()->
         UpdateTransitions(const_cast<dom::Element*>(aElement), pseudoType,
                           oldServoValues, servoValues);
     }
-    if (tasks & UpdateAnimationsTasks::EffectProperties) {
+    if (aTasks & UpdateAnimationsTasks::EffectProperties) {
       presContext->EffectCompositor()->UpdateEffectProperties(
         servoValues, const_cast<dom::Element*>(aElement), pseudoType);
     }
   }
 }
 
 bool
 Gecko_ElementHasAnimations(RawGeckoElementBorrowed aElement,
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -195,17 +195,17 @@ Gecko_GetAnimationRule(RawGeckoElementBo
                        RawServoAnimationValueMapBorrowed aAnimationValues);
 bool Gecko_StyleAnimationsEquals(RawGeckoStyleAnimationListBorrowed,
                                  RawGeckoStyleAnimationListBorrowed);
 void Gecko_UpdateAnimations(RawGeckoElementBorrowed aElement,
                             nsIAtom* aPseudoTagOrNull,
                             ServoComputedValuesBorrowedOrNull aOldComputedValues,
                             ServoComputedValuesBorrowedOrNull aComputedValues,
                             ServoComputedValuesBorrowedOrNull aParentComputedValues,
-                            mozilla::UpdateAnimationsTasks aTaskBits);
+                            mozilla::UpdateAnimationsTasks aTasks);
 bool Gecko_ElementHasAnimations(RawGeckoElementBorrowed aElement,
                                 nsIAtom* aPseudoTagOrNull);
 bool Gecko_ElementHasCSSAnimations(RawGeckoElementBorrowed aElement,
                                    nsIAtom* aPseudoTagOrNull);
 bool Gecko_ElementHasCSSTransitions(RawGeckoElementBorrowed aElement,
                                     nsIAtom* aPseudoTagOrNull);
 size_t Gecko_ElementTransitions_Length(RawGeckoElementBorrowed aElement,
                                        nsIAtom* aPseudoTagOrNull);