Bug 1260651 part.41 Rename mozilla::dom::AutoReplaceContainerSelNotify to mozilla::AutoReplaceContainerSelNotify r?mccr8 draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 24 Jun 2016 15:14:16 +0900
changeset 385731 c4b5d7931f9ecacbe973f26e567f1ad1c793ce4d
parent 385730 99018adff8e5a515a67c25af65be182cc817376b
child 385732 f51ec81bc7d05d43ac84d41794560eac4de93748
push id22582
push usermasayuki@d-toybox.com
push dateSat, 09 Jul 2016 03:13:39 +0000
reviewersmccr8
bugs1260651
milestone50.0a1
Bug 1260651 part.41 Rename mozilla::dom::AutoReplaceContainerSelNotify to mozilla::AutoReplaceContainerSelNotify r?mccr8 MozReview-Commit-ID: 2EB2yQOpjO9
editor/libeditor/SelectionState.h
--- a/editor/libeditor/SelectionState.h
+++ b/editor/libeditor/SelectionState.h
@@ -223,47 +223,45 @@ public:
       *mNode = mRangeItem->startNode;
     } else {
       *mDOMNode = GetAsDOMNode(mRangeItem->startNode);
     }
     *mOffset = mRangeItem->startOffset;
   }
 };
 
-/******************************************************************************
- * another helper class for SelectionState.  stack based class for doing
+/**
+ * Another helper class for SelectionState.  Stack based class for doing
  * Will/DidReplaceContainer()
  */
 
-namespace dom {
-class MOZ_STACK_CLASS AutoReplaceContainerSelNotify
+class MOZ_STACK_CLASS AutoReplaceContainerSelNotify final
 {
-  private:
-    RangeUpdater& mRU;
-    Element* mOriginalElement;
-    Element* mNewElement;
+private:
+  RangeUpdater& mRangeUpdater;
+  dom::Element* mOriginalElement;
+  dom::Element* mNewElement;
 
-  public:
-    AutoReplaceContainerSelNotify(RangeUpdater& aRangeUpdater,
-                                  Element* aOriginalElement,
-                                  Element* aNewElement)
-      : mRU(aRangeUpdater)
-      , mOriginalElement(aOriginalElement)
-      , mNewElement(aNewElement)
-    {
-      mRU.WillReplaceContainer();
-    }
+public:
+  AutoReplaceContainerSelNotify(RangeUpdater& aRangeUpdater,
+                                dom::Element* aOriginalElement,
+                                dom::Element* aNewElement)
+    : mRangeUpdater(aRangeUpdater)
+    , mOriginalElement(aOriginalElement)
+    , mNewElement(aNewElement)
+  {
+    mRangeUpdater.WillReplaceContainer();
+  }
 
-    ~AutoReplaceContainerSelNotify()
-    {
-      mRU.DidReplaceContainer(mOriginalElement, mNewElement);
-    }
+  ~AutoReplaceContainerSelNotify()
+  {
+    mRangeUpdater.DidReplaceContainer(mOriginalElement, mNewElement);
+  }
 };
 
-} // namespace dom
 } // namespace mozilla
 
 
 /***************************************************************************
  * another helper class for SelectionState.  stack based class for doing
  * Will/DidRemoveContainer()
  */