Bug 1403500, part 4 - Document and do some renaming for SVGAnimationElement's TargetReference. r=longsonr
MozReview-Commit-ID: Hph6ap4CSXR
--- a/dom/svg/SVGAnimationElement.h
+++ b/dom/svg/SVGAnimationElement.h
@@ -94,36 +94,44 @@ public:
protected:
// nsSVGElement overrides
void UpdateHrefTarget(nsIContent* aNodeForContext,
const nsAString& aHrefStr);
void AnimationTargetChanged();
- class TargetReference : public mozilla::dom::IDTracker {
+ /**
+ * Helper that provides a reference to the element with the ID that is
+ * referenced by the animation element's 'href' attribuete, if any, and that
+ * will notify the animation element if the element that that ID identifies
+ * changes. (If the 'href' attribute is not specified, then the animation
+ * target is the parent element and this helper is not used.)
+ */
+ class HrefTargetTracker final : public IDTracker {
public:
- explicit TargetReference(SVGAnimationElement* aAnimationElement) :
- mAnimationElement(aAnimationElement) {}
+ explicit HrefTargetTracker(SVGAnimationElement* aAnimationElement)
+ : mAnimationElement(aAnimationElement)
+ {}
protected:
// We need to be notified when target changes, in order to request a
// sample (which will clear animation effects from old target and apply
// them to the new target) and update any event registrations.
virtual void ElementChanged(Element* aFrom, Element* aTo) override {
IDTracker::ElementChanged(aFrom, aTo);
mAnimationElement->AnimationTargetChanged();
}
// We need to override IsPersistent to get persistent tracking (beyond the
// first time the target changes)
virtual bool IsPersistent() override { return true; }
private:
SVGAnimationElement* const mAnimationElement;
};
- TargetReference mHrefTarget;
+ HrefTargetTracker mHrefTarget;
nsSMILTimedElement mTimedElement;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_SVGAnimationElement_h