Bug 1403500, part 4 - Document and do some renaming for SVGAnimationElement's TargetReference. r=longsonr draft
authorJonathan Watt <jwatt@jwatt.org>
Wed, 04 Oct 2017 00:08:57 +0100
changeset 674536 a6a7345edd13ddde01410981f85ef7ee8eaeb027
parent 674535 b5557e396748adb9b70e77098dd7f84590fc2726
child 674537 e9e842a2ae5b9200904efaa3c1d7c8d73294b36e
push id82877
push userjwatt@jwatt.org
push dateTue, 03 Oct 2017 23:10:08 +0000
reviewerslongsonr
bugs1403500
milestone58.0a1
Bug 1403500, part 4 - Document and do some renaming for SVGAnimationElement's TargetReference. r=longsonr MozReview-Commit-ID: Hph6ap4CSXR
dom/svg/SVGAnimationElement.h
--- 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