Bug 1341985 - GetAnimationCollection() takes const Element*. r?birtles draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Fri, 10 Mar 2017 11:53:19 +0900
changeset 496381 22b8e9381ee35c954cf7b7927050abfb93fa92f4
parent 496380 7a1204c2e3dc16d8c6b9f90ef84446b70766c951
child 496382 4e5ef6f2d5dbdb66f62e2d5aabc98e6b9b651629
push id48582
push userhikezoe@mozilla.com
push dateFri, 10 Mar 2017 03:13:33 +0000
reviewersbirtles
bugs1341985
milestone55.0a1
Bug 1341985 - GetAnimationCollection() takes const Element*. r?birtles MozReview-Commit-ID: BPVROi9Ewzc
dom/base/nsINode.h
layout/style/AnimationCollection.cpp
layout/style/AnimationCollection.h
--- a/dom/base/nsINode.h
+++ b/dom/base/nsINode.h
@@ -1634,17 +1634,17 @@ public:
   bool MayHaveDOMMutationObserver()
     { return GetBoolFlag(NodeMayHaveDOMMutationObserver); }
   void SetMayHaveDOMMutationObserver()
     { SetBoolFlag(NodeMayHaveDOMMutationObserver, true); }
   bool HasListenerManager() { return HasFlag(NODE_HAS_LISTENERMANAGER); }
   bool HasPointerLock() const { return GetBoolFlag(ElementHasPointerLock); }
   void SetPointerLock() { SetBoolFlag(ElementHasPointerLock); }
   void ClearPointerLock() { ClearBoolFlag(ElementHasPointerLock); }
-  bool MayHaveAnimations() { return GetBoolFlag(ElementHasAnimations); }
+  bool MayHaveAnimations() const { return GetBoolFlag(ElementHasAnimations); }
   void SetMayHaveAnimations() { SetBoolFlag(ElementHasAnimations); }
   void SetHasValidDir() { SetBoolFlag(NodeHasValidDirAttribute); }
   void ClearHasValidDir() { ClearBoolFlag(NodeHasValidDirAttribute); }
   bool HasValidDir() const { return GetBoolFlag(NodeHasValidDirAttribute); }
   void SetHasFixedDir() {
     MOZ_ASSERT(NodeType() != nsIDOMNode::TEXT_NODE,
                "SetHasFixedDir on text node");
     SetBoolFlag(NodeHasFixedDir);
--- a/layout/style/AnimationCollection.cpp
+++ b/layout/style/AnimationCollection.cpp
@@ -35,17 +35,17 @@ AnimationCollection<AnimationType>::Prop
     }
   }
   delete collection;
 }
 
 template <class AnimationType>
 /* static */ AnimationCollection<AnimationType>*
 AnimationCollection<AnimationType>::GetAnimationCollection(
-  dom::Element *aElement,
+  const dom::Element *aElement,
   CSSPseudoElementType aPseudoType)
 {
   if (!aElement->MayHaveAnimations()) {
     // Early return for the most common case.
     return nullptr;
   }
 
   nsIAtom* propName = GetPropertyAtomForPseudoType(aPseudoType);
--- a/layout/style/AnimationCollection.h
+++ b/layout/style/AnimationCollection.h
@@ -62,17 +62,17 @@ public:
   }
 
   static void PropertyDtor(void *aObject, nsIAtom *aPropertyName,
                            void *aPropertyValue, void *aData);
 
   // Get the collection of animations for the given |aElement| and
   // |aPseudoType|.
   static AnimationCollection<AnimationType>*
-    GetAnimationCollection(dom::Element* aElement,
+    GetAnimationCollection(const dom::Element* aElement,
                            CSSPseudoElementType aPseudoType);
 
   // Given the frame |aFrame| with possibly animated content, finds its
   // associated collection of animations. If |aFrame| is a generated content
   // frame, this function may examine the parent frame to search for such
   // animations.
   static AnimationCollection<AnimationType>* GetAnimationCollection(
     const nsIFrame* aFrame);