Bug 1260651 part.3 Rename DOMPoint to mozilla::EditorDOMPoint because same name class is used in other modules widely r=mccr8 draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 23 Jun 2016 17:13:03 +0900
changeset 385693 861094d965e80f7ac3033e2322c95bc8512472bd
parent 385692 cb7ec5b461d0432880beb4debeea253ac1a77d99
child 385694 4d862f60e594ffcd67d76b7562a8b917895b4fdb
push id22582
push usermasayuki@d-toybox.com
push dateSat, 09 Jul 2016 03:13:39 +0000
reviewersmccr8
bugs1260651
milestone50.0a1
Bug 1260651 part.3 Rename DOMPoint to mozilla::EditorDOMPoint because same name class is used in other modules widely r=mccr8 MozReview-Commit-ID: 9ZyVTv7veuK
editor/libeditor/EditorUtils.h
editor/libeditor/nsEditor.cpp
editor/libeditor/nsEditor.h
editor/libeditor/nsHTMLEditRules.cpp
editor/libeditor/nsHTMLEditRules.h
editor/libeditor/nsWSRunObject.cpp
editor/libeditor/nsWSRunObject.h
--- a/editor/libeditor/EditorUtils.h
+++ b/editor/libeditor/EditorUtils.h
@@ -230,49 +230,51 @@ class nsTrivialFunctor : public nsBoolDo
   public:
     // Used to build list of all nodes iterator covers
     virtual bool operator()(nsINode* aNode) const
     {
       return true;
     }
 };
 
+namespace mozilla {
 
 /******************************************************************************
  * general dom point utility struct
  *****************************************************************************/
-struct MOZ_STACK_CLASS DOMPoint
+struct MOZ_STACK_CLASS EditorDOMPoint final
 {
   nsCOMPtr<nsINode> node;
   int32_t offset;
 
-  DOMPoint() : node(nullptr), offset(-1) {}
-  DOMPoint(nsINode* aNode, int32_t aOffset)
+  EditorDOMPoint()
+    : node(nullptr)
+    , offset(-1)
+  {}
+  EditorDOMPoint(nsINode* aNode, int32_t aOffset)
     : node(aNode)
     , offset(aOffset)
   {}
-  DOMPoint(nsIDOMNode* aNode, int32_t aOffset)
+  EditorDOMPoint(nsIDOMNode* aNode, int32_t aOffset)
     : node(do_QueryInterface(aNode))
     , offset(aOffset)
   {}
 
   void SetPoint(nsINode* aNode, int32_t aOffset)
   {
     node = aNode;
     offset = aOffset;
   }
   void SetPoint(nsIDOMNode* aNode, int32_t aOffset)
   {
     node = do_QueryInterface(aNode);
     offset = aOffset;
   }
 };
 
-namespace mozilla {
-
 class EditorUtils final
 {
 public:
   static bool IsDescendantOf(nsINode* aNode, nsINode* aParent,
                              int32_t* aOffset = 0);
   static bool IsDescendantOf(nsIDOMNode* aNode, nsIDOMNode* aParent,
                              int32_t* aOffset = 0);
   static bool IsLeafNode(nsIDOMNode* aNode);
--- a/editor/libeditor/nsEditor.cpp
+++ b/editor/libeditor/nsEditor.cpp
@@ -3866,39 +3866,39 @@ nsEditor::SplitNodeDeep(nsIContent& aNod
   return offset;
 }
 
 
 /**
  * This joins two like nodes "deeply", joining children as appropriate.
  * Returns the point of the join, or (nullptr, -1) in case of error.
  */
-::DOMPoint
+EditorDOMPoint
 nsEditor::JoinNodeDeep(nsIContent& aLeftNode, nsIContent& aRightNode)
 {
   // While the rightmost children and their descendants of the left node match
   // the leftmost children and their descendants of the right node, join them
   // up.
 
   nsCOMPtr<nsIContent> leftNodeToJoin = &aLeftNode;
   nsCOMPtr<nsIContent> rightNodeToJoin = &aRightNode;
   nsCOMPtr<nsINode> parentNode = aRightNode.GetParentNode();
 
-  ::DOMPoint ret;
+  EditorDOMPoint ret;
 
   while (leftNodeToJoin && rightNodeToJoin && parentNode &&
          AreNodesSameType(leftNodeToJoin, rightNodeToJoin)) {
     uint32_t length = leftNodeToJoin->Length();
 
     ret.node = rightNodeToJoin;
     ret.offset = length;
 
     // Do the join
     nsresult res = JoinNodes(*leftNodeToJoin, *rightNodeToJoin);
-    NS_ENSURE_SUCCESS(res, ::DOMPoint());
+    NS_ENSURE_SUCCESS(res, EditorDOMPoint());
 
     if (parentNode->GetAsText()) {
       // We've joined all the way down to text nodes, we're done!
       return ret;
     }
 
     // Get new left and right nodes, and begin anew
     parentNode = rightNodeToJoin;
--- a/editor/libeditor/nsEditor.h
+++ b/editor/libeditor/nsEditor.h
@@ -47,21 +47,21 @@ class nsIInlineSpellChecker;
 class nsINode;
 class nsIPresShell;
 class nsISupports;
 class nsITransaction;
 class nsIWidget;
 class nsRange;
 class nsString;
 class nsTransactionManager;
-struct DOMPoint;
 
 namespace mozilla {
 class ErrorResult;
 class TextComposition;
+struct EditorDOMPoint;
 
 namespace dom {
 class ChangeAttributeTxn;
 class CreateElementTxn;
 class DataTransfer;
 class DeleteTextTxn;
 class Element;
 class EventTarget;
@@ -634,17 +634,18 @@ public:
 
   enum class EmptyContainers { no, yes };
   int32_t SplitNodeDeep(nsIContent& aNode, nsIContent& aSplitPointParent,
                         int32_t aSplitPointOffset,
                         EmptyContainers aEmptyContainers =
                           EmptyContainers::yes,
                         nsIContent** outLeftNode = nullptr,
                         nsIContent** outRightNode = nullptr);
-  ::DOMPoint JoinNodeDeep(nsIContent& aLeftNode, nsIContent& aRightNode);
+  mozilla::EditorDOMPoint JoinNodeDeep(nsIContent& aLeftNode,
+                                       nsIContent& aRightNode);
 
   nsresult GetString(const nsAString& name, nsAString& value);
 
   void BeginUpdateViewBatch(void);
   virtual nsresult EndUpdateViewBatch(void);
 
   bool GetShouldTxnSetSelection();
 
--- a/editor/libeditor/nsHTMLEditRules.cpp
+++ b/editor/libeditor/nsHTMLEditRules.cpp
@@ -2088,17 +2088,17 @@ nsHTMLEditRules::WillDeleteSelection(Sel
       nsCOMPtr<nsINode> stepbrother;
       if (sibling) {
         NS_ENSURE_STATE(mHTMLEditor);
         stepbrother = mHTMLEditor->GetNextHTMLSibling(sibling);
       }
       // Are they both text nodes?  If so, join them!
       if (startNode == stepbrother && startNode->GetAsText() &&
           sibling->GetAsText()) {
-        ::DOMPoint pt = JoinNodesSmart(*sibling, *startNode->AsContent());
+        EditorDOMPoint pt = JoinNodesSmart(*sibling, *startNode->AsContent());
         NS_ENSURE_STATE(pt.node);
         // Fix up selection
         res = aSelection->Collapse(pt.node, pt.offset);
         NS_ENSURE_SUCCESS(res, res);
       }
       res = InsertBRIfNeeded(aSelection);
       NS_ENSURE_SUCCESS(res, res);
       return NS_OK;
@@ -2156,17 +2156,17 @@ nsHTMLEditRules::WillDeleteSelection(Sel
       if (leftNode && rightNode &&
           InDifferentTableElements(leftNode, rightNode)) {
         return NS_OK;
       }
 
       if (bDeletedBR) {
         // Put selection at edge of block and we are done.
         NS_ENSURE_STATE(leafNode);
-        ::DOMPoint newSel = GetGoodSelPointForNode(*leafNode, aAction);
+        EditorDOMPoint newSel = GetGoodSelPointForNode(*leafNode, aAction);
         NS_ENSURE_STATE(newSel.node);
         aSelection->Collapse(newSel.node, newSel.offset);
         return NS_OK;
       }
 
       // Else we are joining content to block
 
       nsCOMPtr<nsINode> selPointNode = startNode;
@@ -2318,32 +2318,34 @@ nsHTMLEditRules::WillDeleteSelection(Sel
                                        GetAsDOMNode(rightParent))) {
           if (leftParent->IsHTMLElement(nsGkAtoms::p)) {
             // First delete the selection
             NS_ENSURE_STATE(mHTMLEditor);
             res = mHTMLEditor->DeleteSelectionImpl(aAction, aStripWrappers);
             NS_ENSURE_SUCCESS(res, res);
             // Then join paragraphs, insert break
             NS_ENSURE_STATE(mHTMLEditor);
-            ::DOMPoint pt = mHTMLEditor->JoinNodeDeep(*leftParent, *rightParent);
+            EditorDOMPoint pt =
+              mHTMLEditor->JoinNodeDeep(*leftParent, *rightParent);
             NS_ENSURE_STATE(pt.node);
             // Fix up selection
             res = aSelection->Collapse(pt.node, pt.offset);
             NS_ENSURE_SUCCESS(res, res);
             return NS_OK;
           }
           if (nsHTMLEditUtils::IsListItem(leftParent) ||
               nsHTMLEditUtils::IsHeader(*leftParent)) {
             // First delete the selection
             NS_ENSURE_STATE(mHTMLEditor);
             res = mHTMLEditor->DeleteSelectionImpl(aAction, aStripWrappers);
             NS_ENSURE_SUCCESS(res, res);
             // Join blocks
             NS_ENSURE_STATE(mHTMLEditor);
-            ::DOMPoint pt = mHTMLEditor->JoinNodeDeep(*leftParent, *rightParent);
+            EditorDOMPoint pt =
+              mHTMLEditor->JoinNodeDeep(*leftParent, *rightParent);
             NS_ENSURE_STATE(pt.node);
             // Fix up selection
             res = aSelection->Collapse(pt.node, pt.offset);
             NS_ENSURE_SUCCESS(res, res);
             return NS_OK;
           }
         }
 
@@ -2515,30 +2517,30 @@ nsHTMLEditRules::InsertBRIfNeeded(Select
 
 /**
  *  GetGoodSelPointForNode: Finds where at a node you would want to set the
  *  selection if you were trying to have a caret next to it.
  *       nsINode& aNode                   the node
  *       nsIEditor::EDirection aAction    which edge to find: eNext indicates
  *                                        beginning, ePrevious ending
  */
-::DOMPoint
+EditorDOMPoint
 nsHTMLEditRules::GetGoodSelPointForNode(nsINode& aNode,
                                         nsIEditor::EDirection aAction)
 {
-  NS_ENSURE_TRUE(mHTMLEditor, ::DOMPoint());
+  NS_ENSURE_TRUE(mHTMLEditor, EditorDOMPoint());
   if (aNode.GetAsText() || mHTMLEditor->IsContainer(&aNode)) {
-    return ::DOMPoint(&aNode,
-                      aAction == nsIEditor::ePrevious ? aNode.Length() : 0);
-  }
-
-  ::DOMPoint ret;
+    return EditorDOMPoint(&aNode,
+                          aAction == nsIEditor::ePrevious ? aNode.Length() : 0);
+  }
+
+  EditorDOMPoint ret;
   ret.node = aNode.GetParentNode();
   ret.offset = ret.node ? ret.node->IndexOf(&aNode) : -1;
-  NS_ENSURE_TRUE(mHTMLEditor, ::DOMPoint());
+  NS_ENSURE_TRUE(mHTMLEditor, EditorDOMPoint());
   if ((!aNode.IsHTMLElement(nsGkAtoms::br) ||
        mHTMLEditor->IsVisBreak(&aNode)) &&
       aAction == nsIEditor::ePrevious) {
     ret.offset++;
   }
   return ret;
 }
 
@@ -2774,17 +2776,17 @@ nsHTMLEditRules::JoinBlocks(nsIContent& 
     res = nsWSRunObject::PrepareToJoinBlocks(mHTMLEditor, leftBlock, rightBlock);
     NS_ENSURE_SUCCESS(res, res);
     // Do br adjustment.
     nsCOMPtr<Element> brNode =
       CheckForInvisibleBR(*leftBlock, BRLocation::blockEnd);
     if (mergeLists || leftBlock->NodeInfo()->NameAtom() ==
                       rightBlock->NodeInfo()->NameAtom()) {
       // Nodes are same type.  merge them.
-      ::DOMPoint pt = JoinNodesSmart(*leftBlock, *rightBlock);
+      EditorDOMPoint pt = JoinNodesSmart(*leftBlock, *rightBlock);
       if (pt.node && mergeLists) {
         nsCOMPtr<Element> newBlock;
         res = ConvertListType(rightBlock, getter_AddRefs(newBlock),
                               existingList, nsGkAtoms::li);
       }
     } else {
       // Nodes are dissimilar types.
       res = MoveBlock(*leftBlock, *rightBlock, leftOffset, rightOffset);
@@ -2806,17 +2808,17 @@ nsHTMLEditRules::JoinBlocks(nsIContent& 
  * followed throughout.
  */
 nsresult
 nsHTMLEditRules::MoveBlock(Element& aLeftBlock, Element& aRightBlock,
                            int32_t aLeftOffset, int32_t aRightOffset)
 {
   nsTArray<OwningNonNull<nsINode>> arrayOfNodes;
   // GetNodesFromPoint is the workhorse that figures out what we wnat to move.
-  nsresult res = GetNodesFromPoint(::DOMPoint(&aRightBlock, aRightOffset),
+  nsresult res = GetNodesFromPoint(EditorDOMPoint(&aRightBlock, aRightOffset),
                                    EditAction::makeList, arrayOfNodes,
                                    TouchContent::yes);
   NS_ENSURE_SUCCESS(res, res);
   for (uint32_t i = 0; i < arrayOfNodes.Length(); i++) {
     // get the node to act on
     if (IsBlockNode(arrayOfNodes[i])) {
       // For block nodes, move their contents only, then delete block.
       res = MoveContents(*arrayOfNodes[i]->AsElement(), aLeftBlock,
@@ -6020,17 +6022,17 @@ nsHTMLEditRules::GetHighestInlineParent(
 }
 
 
 ///////////////////////////////////////////////////////////////////////////////
 // GetNodesFromPoint: Given a particular operation, construct a list of nodes
 //                    from a point that will be operated on.
 //
 nsresult
-nsHTMLEditRules::GetNodesFromPoint(::DOMPoint aPoint,
+nsHTMLEditRules::GetNodesFromPoint(EditorDOMPoint aPoint,
                                    EditAction aOperation,
                                    nsTArray<OwningNonNull<nsINode>>& outArrayOfNodes,
                                    TouchContent aTouchContent)
 {
   NS_ENSURE_STATE(aPoint.node);
   RefPtr<nsRange> range = new nsRange(aPoint.node);
   nsresult res = range->SetStart(aPoint.node, aPoint.offset);
   MOZ_ASSERT(NS_SUCCEEDED(res));
@@ -6905,65 +6907,65 @@ nsHTMLEditRules::SplitAsNeeded(nsIAtom& 
 
 /**
  * JoinNodesSmart: Join two nodes, doing whatever makes sense for their
  * children (which often means joining them, too).  aNodeLeft & aNodeRight must
  * be same type of node.
  *
  * Returns the point where they're merged, or (nullptr, -1) on failure.
  */
-::DOMPoint
+EditorDOMPoint
 nsHTMLEditRules::JoinNodesSmart(nsIContent& aNodeLeft, nsIContent& aNodeRight)
 {
   // Caller responsible for left and right node being the same type
   nsCOMPtr<nsINode> parent = aNodeLeft.GetParentNode();
-  NS_ENSURE_TRUE(parent, ::DOMPoint());
+  NS_ENSURE_TRUE(parent, EditorDOMPoint());
   int32_t parOffset = parent->IndexOf(&aNodeLeft);
   nsCOMPtr<nsINode> rightParent = aNodeRight.GetParentNode();
 
   // If they don't have the same parent, first move the right node to after the
   // left one
   nsresult res;
   if (parent != rightParent) {
-    NS_ENSURE_TRUE(mHTMLEditor, ::DOMPoint());
+    NS_ENSURE_TRUE(mHTMLEditor, EditorDOMPoint());
     res = mHTMLEditor->MoveNode(&aNodeRight, parent, parOffset);
-    NS_ENSURE_SUCCESS(res, ::DOMPoint());
-  }
-
-  ::DOMPoint ret(&aNodeRight, aNodeLeft.Length());
+    NS_ENSURE_SUCCESS(res, EditorDOMPoint());
+  }
+
+  EditorDOMPoint ret(&aNodeRight, aNodeLeft.Length());
 
   // Separate join rules for differing blocks
   if (nsHTMLEditUtils::IsList(&aNodeLeft) || aNodeLeft.GetAsText()) {
     // For lists, merge shallow (wouldn't want to combine list items)
     res = mHTMLEditor->JoinNodes(aNodeLeft, aNodeRight);
-    NS_ENSURE_SUCCESS(res, ::DOMPoint());
+    NS_ENSURE_SUCCESS(res, EditorDOMPoint());
     return ret;
   }
 
   // Remember the last left child, and first right child
-  NS_ENSURE_TRUE(mHTMLEditor, ::DOMPoint());
+  NS_ENSURE_TRUE(mHTMLEditor, EditorDOMPoint());
   nsCOMPtr<nsIContent> lastLeft = mHTMLEditor->GetLastEditableChild(aNodeLeft);
-  NS_ENSURE_TRUE(lastLeft, ::DOMPoint());
-
-  NS_ENSURE_TRUE(mHTMLEditor, ::DOMPoint());
+  NS_ENSURE_TRUE(lastLeft, EditorDOMPoint());
+
+  NS_ENSURE_TRUE(mHTMLEditor, EditorDOMPoint());
   nsCOMPtr<nsIContent> firstRight = mHTMLEditor->GetFirstEditableChild(aNodeRight);
-  NS_ENSURE_TRUE(firstRight, ::DOMPoint());
+  NS_ENSURE_TRUE(firstRight, EditorDOMPoint());
 
   // For list items, divs, etc., merge smart
-  NS_ENSURE_TRUE(mHTMLEditor, ::DOMPoint());
+  NS_ENSURE_TRUE(mHTMLEditor, EditorDOMPoint());
   res = mHTMLEditor->JoinNodes(aNodeLeft, aNodeRight);
-  NS_ENSURE_SUCCESS(res, ::DOMPoint());
+  NS_ENSURE_SUCCESS(res, EditorDOMPoint());
 
   if (lastLeft && firstRight && mHTMLEditor &&
       mHTMLEditor->AreNodesSameType(lastLeft, firstRight) &&
       (lastLeft->GetAsText() || !mHTMLEditor ||
        (lastLeft->IsElement() && firstRight->IsElement() &&
         mHTMLEditor->mHTMLCSSUtils->ElementsSameStyle(lastLeft->AsElement(),
                                                   firstRight->AsElement())))) {
-    NS_ENSURE_TRUE(mHTMLEditor, ::DOMPoint());
+    NS_ENSURE_TRUE(mHTMLEditor, EditorDOMPoint());
     return JoinNodesSmart(*lastLeft, *firstRight);
   }
   return ret;
 }
 
 
 Element*
 nsHTMLEditRules::GetTopEnclosingMailCite(nsINode& aNode)
--- a/editor/libeditor/nsHTMLEditRules.h
+++ b/editor/libeditor/nsHTMLEditRules.h
@@ -25,22 +25,22 @@ class nsIDOMDocument;
 class nsIDOMElement;
 class nsIDOMNode;
 class nsIEditor;
 class nsINode;
 class nsPlaintextEditor;
 class nsRange;
 class nsRulesInfo;
 namespace mozilla {
+struct EditorDOMPoint;
 namespace dom {
 class Element;
 class Selection;
 } // namespace dom
 } // namespace mozilla
-struct DOMPoint;
 
 struct StyleCache : public PropItem
 {
   bool mPresent;
 
   StyleCache() : PropItem(), mPresent(false) {
     MOZ_COUNT_CTOR(StyleCache);
   }
@@ -137,18 +137,18 @@ protected:
   nsresult WillDeleteSelection(Selection* aSelection,
                                nsIEditor::EDirection aAction,
                                nsIEditor::EStripWrappers aStripWrappers,
                                bool* aCancel, bool* aHandled);
   nsresult DidDeleteSelection(Selection* aSelection,
                               nsIEditor::EDirection aDir,
                               nsresult aResult);
   nsresult InsertBRIfNeeded(Selection* aSelection);
-  ::DOMPoint GetGoodSelPointForNode(nsINode& aNode,
-                                    nsIEditor::EDirection aAction);
+  mozilla::EditorDOMPoint GetGoodSelPointForNode(nsINode& aNode,
+                                                 nsIEditor::EDirection aAction);
   nsresult JoinBlocks(nsIContent& aLeftNode, nsIContent& aRightNode,
                       bool* aCanceled);
   nsresult MoveBlock(Element& aLeftBlock, Element& aRightBlock,
                      int32_t aLeftOffset, int32_t aRightOffset);
   nsresult MoveNodeSmart(nsIContent& aNode, Element& aDestElement,
                          int32_t* aOffset);
   nsresult MoveContents(Element& aElement, Element& aDestElement,
                         int32_t* aOffset);
@@ -250,17 +250,17 @@ protected:
   void PromoteRange(nsRange& aRange, EditAction inOperationType);
   enum class TouchContent { no, yes };
   nsresult GetNodesForOperation(nsTArray<RefPtr<nsRange>>& aArrayOfRanges,
                                 nsTArray<OwningNonNull<nsINode>>& aOutArrayOfNodes,
                                 EditAction aOperationType,
                                 TouchContent aTouchContent = TouchContent::yes);
   void GetChildNodesForOperation(nsINode& aNode,
       nsTArray<OwningNonNull<nsINode>>& outArrayOfNodes);
-  nsresult GetNodesFromPoint(::DOMPoint aPoint,
+  nsresult GetNodesFromPoint(mozilla::EditorDOMPoint aPoint,
                              EditAction aOperation,
                              nsTArray<OwningNonNull<nsINode>>& outArrayOfNodes,
                              TouchContent aTouchContent);
   nsresult GetNodesFromSelection(Selection& aSelection,
                                  EditAction aOperation,
                                  nsTArray<OwningNonNull<nsINode>>& outArrayOfNodes,
                                  TouchContent aTouchContent = TouchContent::yes);
   enum class EntireList { no, yes };
@@ -282,17 +282,18 @@ protected:
   nsresult ApplyBlockStyle(nsTArray<OwningNonNull<nsINode>>& aNodeArray,
                            nsIAtom& aBlockTag);
   nsresult MakeBlockquote(nsTArray<OwningNonNull<nsINode>>& aNodeArray);
   nsresult SplitAsNeeded(nsIAtom& aTag, OwningNonNull<nsINode>& inOutParent,
                          int32_t& inOutOffset);
   nsresult SplitAsNeeded(nsIAtom& aTag, nsCOMPtr<nsINode>& inOutParent,
                          int32_t& inOutOffset);
   nsresult AddTerminatingBR(nsIDOMNode *aBlock);
-  ::DOMPoint JoinNodesSmart(nsIContent& aNodeLeft, nsIContent& aNodeRight);
+  mozilla::EditorDOMPoint JoinNodesSmart(nsIContent& aNodeLeft,
+                                         nsIContent& aNodeRight);
   Element* GetTopEnclosingMailCite(nsINode& aNode);
   nsresult PopListItem(nsIDOMNode *aListItem, bool *aOutOfList);
   nsresult RemoveListStructure(Element& aList);
   nsresult CacheInlineStyles(nsIDOMNode *aNode);
   nsresult ReapplyCachedStyles();
   void ClearCachedStyles();
   void AdjustSpecialBreaks();
   nsresult AdjustWhitespace(Selection* aSelection);
--- a/editor/libeditor/nsWSRunObject.cpp
+++ b/editor/libeditor/nsWSRunObject.cpp
@@ -618,17 +618,17 @@ nsWSRunObject::GetWSBoundingParent()
 }
 
 nsresult
 nsWSRunObject::GetWSNodes()
 {
   // collect up an array of nodes that are contiguous with the insertion point
   // and which contain only whitespace.  Stop if you reach non-ws text or a new
   // block boundary.
-  ::DOMPoint start(mNode, mOffset), end(mNode, mOffset);
+  EditorDOMPoint start(mNode, mOffset), end(mNode, mOffset);
   nsCOMPtr<nsINode> wsBoundingParent = GetWSBoundingParent();
 
   // first look backwards to find preceding ws nodes
   if (RefPtr<Text> textNode = mNode->GetAsText()) {
     const nsTextFragment* textFrag = textNode->GetText();
 
     mNodeArray.InsertElementAt(0, textNode);
     if (mOffset) {
@@ -1039,17 +1039,17 @@ nsWSRunObject::GetPreviousWSNodeInner(ns
       return child;
     }
   }
   // Else return the node itself
   return priorNode;
 }
 
 nsIContent*
-nsWSRunObject::GetPreviousWSNode(::DOMPoint aPoint,
+nsWSRunObject::GetPreviousWSNode(EditorDOMPoint aPoint,
                                  nsINode* aBlockParent)
 {
   // Can't really recycle various getnext/prior routines because we
   // have special needs here.  Need to step into inline containers but
   // not block containers.
   MOZ_ASSERT(aPoint.node && aBlockParent);
 
   if (aPoint.node->NodeType() == nsIDOMNode::TEXT_NODE) {
@@ -1123,17 +1123,17 @@ nsWSRunObject::GetNextWSNodeInner(nsINod
       return child;
     }
   }
   // Else return the node itself
   return nextNode;
 }
 
 nsIContent*
-nsWSRunObject::GetNextWSNode(::DOMPoint aPoint, nsINode* aBlockParent)
+nsWSRunObject::GetNextWSNode(EditorDOMPoint aPoint, nsINode* aBlockParent)
 {
   // Can't really recycle various getnext/prior routines because we have
   // special needs here.  Need to step into inline containers but not block
   // containers.
   MOZ_ASSERT(aPoint.node && aBlockParent);
 
   if (aPoint.node->NodeType() == nsIDOMNode::TEXT_NODE) {
     return GetNextWSNodeInner(aPoint.node, aBlockParent);
--- a/editor/libeditor/nsWSRunObject.h
+++ b/editor/libeditor/nsWSRunObject.h
@@ -10,17 +10,19 @@
 #include "nsIEditor.h" // for EDirection
 #include "nsINode.h"
 #include "nscore.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/Text.h"
 
 class nsHTMLEditor;
 class nsIDOMNode;
-struct DOMPoint;
+namespace mozilla {
+struct EditorDOMPoint;
+} // namespace mozilla
 
 // class nsWSRunObject represents the entire whitespace situation
 // around a given point.  It collects up a list of nodes that contain
 // whitespace and categorizes in up to 3 different WSFragments (detailed
 // below).  Each WSFragment is a collection of whitespace that is
 // either all insignificant, or that is significant.  A WSFragment could
 // consist of insignificant whitespace because it is after a block
 // boundary or after a break.  Or it could be insignificant because it
@@ -307,19 +309,21 @@ class MOZ_STACK_CLASS nsWSRunObject
     nsINode* GetWSBoundingParent();
 
     nsresult GetWSNodes();
     void     GetRuns();
     void     ClearRuns();
     void     MakeSingleWSRun(WSType aType);
     nsIContent* GetPreviousWSNodeInner(nsINode* aStartNode,
                                        nsINode* aBlockParent);
-    nsIContent* GetPreviousWSNode(::DOMPoint aPoint, nsINode* aBlockParent);
+    nsIContent* GetPreviousWSNode(mozilla::EditorDOMPoint aPoint,
+                                  nsINode* aBlockParent);
     nsIContent* GetNextWSNodeInner(nsINode* aStartNode, nsINode* aBlockParent);
-    nsIContent* GetNextWSNode(::DOMPoint aPoint, nsINode* aBlockParent);
+    nsIContent* GetNextWSNode(mozilla::EditorDOMPoint aPoint,
+                              nsINode* aBlockParent);
     nsresult PrepareToDeleteRangePriv(nsWSRunObject* aEndObject);
     nsresult PrepareToSplitAcrossBlocksPriv();
     nsresult DeleteChars(nsINode* aStartNode, int32_t aStartOffset,
                          nsINode* aEndNode, int32_t aEndOffset,
                          AreaRestriction aAR = eAnywhere);
     WSPoint  GetCharAfter(nsINode* aNode, int32_t aOffset);
     WSPoint  GetCharBefore(nsINode* aNode, int32_t aOffset);
     WSPoint  GetCharAfter(const WSPoint& aPoint);