Bug 1341985 - GetAnimationCollection() takes const Element*. r?birtles
MozReview-Commit-ID: BPVROi9Ewzc
--- 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);