Bug 1377989 - part8: Rename aStartParent and aStartNode related to nsRange to aStartContainer r=smaug
authorMasayuki Nakano <masayuki@d-toybox.com>
Tue, 11 Jul 2017 23:10:42 +0900
changeset 419376 56af7270cb559315fdc2517cd0d0e1ed11ea795e
parent 419375 c557e2f2142be10bbd73a3ffa7a9d5c63c41b471
child 419377 e7ed833f7da382c65600585af38c0c631168f50d
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1377989
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1377989 - part8: Rename aStartParent and aStartNode related to nsRange to aStartContainer r=smaug MozReview-Commit-ID: H3wzW7eaQBg
dom/base/nsContentIterator.cpp
dom/base/nsRange.cpp
dom/base/nsRange.h
editor/libeditor/EditorBase.cpp
editor/libeditor/EditorBase.h
editor/libeditor/HTMLEditor.h
editor/libeditor/HTMLEditorDataTransfer.cpp
editor/txtsvc/nsFilteredContentIterator.cpp
editor/txtsvc/nsTextServicesDocument.cpp
editor/txtsvc/nsTextServicesDocument.h
--- a/dom/base/nsContentIterator.cpp
+++ b/dom/base/nsContentIterator.cpp
@@ -40,35 +40,36 @@ NodeToParentOffset(nsINode* aNode, int32
 }
 
 ///////////////////////////////////////////////////////////////////////////
 // NodeIsInTraversalRange: returns true if content is visited during
 // the traversal of the range in the specified mode.
 //
 static bool
 NodeIsInTraversalRange(nsINode* aNode, bool aIsPreMode,
-                       nsINode* aStartNode, int32_t aStartOffset,
+                       nsINode* aStartContainer, int32_t aStartOffset,
                        nsINode* aEndNode, int32_t aEndOffset)
 {
-  if (NS_WARN_IF(!aStartNode) || NS_WARN_IF(!aEndNode) || NS_WARN_IF(!aNode)) {
+  if (NS_WARN_IF(!aStartContainer) || NS_WARN_IF(!aEndNode) ||
+      NS_WARN_IF(!aNode)) {
     return false;
   }
 
   // If a leaf node contains an end point of the traversal range, it is
   // always in the traversal range.
-  if (aNode == aStartNode || aNode == aEndNode) {
+  if (aNode == aStartContainer || aNode == aEndNode) {
     if (aNode->IsNodeOfType(nsINode::eDATA_NODE)) {
       return true; // text node or something
     }
     if (!aNode->HasChildren()) {
-      MOZ_ASSERT(aNode != aStartNode || !aStartOffset,
-        "aStartNode doesn't have children and not a data node, "
+      MOZ_ASSERT(aNode != aStartContainer || !aStartOffset,
+        "aStartContainer doesn't have children and not a data node, "
         "aStartOffset should be 0");
       MOZ_ASSERT(aNode != aEndNode || !aEndOffset,
-        "aStartNode doesn't have children and not a data node, "
+        "aStartContainer doesn't have children and not a data node, "
         "aStartOffset should be 0");
       return true;
     }
   }
 
   nsINode* parent = aNode->GetParentNode();
   if (!parent) {
     return false;
@@ -76,17 +77,17 @@ NodeIsInTraversalRange(nsINode* aNode, b
 
   int32_t indx = parent->IndexOf(aNode);
   NS_WARNING_ASSERTION(indx != -1, "bad indx");
 
   if (!aIsPreMode) {
     ++indx;
   }
 
-  return nsContentUtils::ComparePoints(aStartNode, aStartOffset,
+  return nsContentUtils::ComparePoints(aStartContainer, aStartOffset,
                                        parent, indx) <= 0 &&
          nsContentUtils::ComparePoints(aEndNode, aEndOffset,
                                        parent, indx) >= 0;
 }
 
 
 
 /*
--- a/dom/base/nsRange.cpp
+++ b/dom/base/nsRange.cpp
@@ -261,52 +261,52 @@ nsRange::nsRange(nsINode* aNode)
 #endif
 {
   MOZ_ASSERT(aNode, "range isn't in a document!");
   mOwner = aNode->OwnerDoc();
 }
 
 /* static */
 nsresult
-nsRange::CreateRange(nsINode* aStartParent, int32_t aStartOffset,
+nsRange::CreateRange(nsINode* aStartContainer, int32_t aStartOffset,
                      nsINode* aEndParent, int32_t aEndOffset,
                      nsRange** aRange)
 {
   MOZ_ASSERT(aRange);
   *aRange = nullptr;
 
-  RefPtr<nsRange> range = new nsRange(aStartParent);
-  nsresult rv = range->SetStartAndEnd(aStartParent, aStartOffset,
+  RefPtr<nsRange> range = new nsRange(aStartContainer);
+  nsresult rv = range->SetStartAndEnd(aStartContainer, aStartOffset,
                                       aEndParent, aEndOffset);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
   range.forget(aRange);
   return NS_OK;
 }
 
 /* static */
 nsresult
-nsRange::CreateRange(nsIDOMNode* aStartParent, int32_t aStartOffset,
+nsRange::CreateRange(nsIDOMNode* aStartContainer, int32_t aStartOffset,
                      nsIDOMNode* aEndParent, int32_t aEndOffset,
                      nsRange** aRange)
 {
-  nsCOMPtr<nsINode> startParent = do_QueryInterface(aStartParent);
+  nsCOMPtr<nsINode> startParent = do_QueryInterface(aStartContainer);
   nsCOMPtr<nsINode> endParent = do_QueryInterface(aEndParent);
   return CreateRange(startParent, aStartOffset, endParent, aEndOffset, aRange);
 }
 
 /* static */
 nsresult
-nsRange::CreateRange(nsIDOMNode* aStartParent, int32_t aStartOffset,
+nsRange::CreateRange(nsIDOMNode* aStartContainer, int32_t aStartOffset,
                      nsIDOMNode* aEndParent, int32_t aEndOffset,
                      nsIDOMRange** aRange)
 {
   RefPtr<nsRange> range;
-  nsresult rv = nsRange::CreateRange(aStartParent, aStartOffset, aEndParent,
+  nsresult rv = nsRange::CreateRange(aStartContainer, aStartOffset, aEndParent,
                                      aEndOffset, getter_AddRefs(range));
   range.forget(aRange);
   return rv;
 }
 
 /******************************************************
  * nsISupports
  ******************************************************/
@@ -1014,22 +1014,22 @@ nsRange::Reset()
   DoSetRange(nullptr, 0, nullptr, 0, nullptr);
 }
 
 /******************************************************
  * public functionality
  ******************************************************/
 
 NS_IMETHODIMP
-nsRange::GetStartContainer(nsIDOMNode** aStartParent)
+nsRange::GetStartContainer(nsIDOMNode** aStartContainer)
 {
   if (!mIsPositioned)
     return NS_ERROR_NOT_INITIALIZED;
 
-  return CallQueryInterface(mStartContainer, aStartParent);
+  return CallQueryInterface(mStartContainer, aStartContainer);
 }
 
 nsINode*
 nsRange::GetStartContainer(ErrorResult& aRv) const
 {
   if (!mIsPositioned) {
     aRv.Throw(NS_ERROR_NOT_INITIALIZED);
     return nullptr;
@@ -1382,41 +1382,41 @@ nsRange::SetEnd(nsINode* aContainer, int
   }
 
   DoSetRange(mStartContainer, mStartOffset, aContainer, aOffset, mRoot);
 
   return NS_OK;
 }
 
 nsresult
-nsRange::SetStartAndEnd(nsINode* aStartParent, int32_t aStartOffset,
+nsRange::SetStartAndEnd(nsINode* aStartContainer, int32_t aStartOffset,
                         nsINode* aEndParent, int32_t aEndOffset)
 {
-  if (NS_WARN_IF(!aStartParent) || NS_WARN_IF(!aEndParent)) {
+  if (NS_WARN_IF(!aStartContainer) || NS_WARN_IF(!aEndParent)) {
     return NS_ERROR_INVALID_ARG;
   }
 
-  nsINode* newStartRoot = IsValidBoundary(aStartParent);
+  nsINode* newStartRoot = IsValidBoundary(aStartContainer);
   if (!newStartRoot) {
     return NS_ERROR_DOM_INVALID_NODE_TYPE_ERR;
   }
-  if (!IsValidOffset(aStartParent, aStartOffset)) {
+  if (!IsValidOffset(aStartContainer, aStartOffset)) {
     return NS_ERROR_DOM_INDEX_SIZE_ERR;
   }
 
-  if (aStartParent == aEndParent) {
+  if (aStartContainer == aEndParent) {
     if (!IsValidOffset(aEndParent, aEndOffset)) {
       return NS_ERROR_DOM_INDEX_SIZE_ERR;
     }
     // If the end offset is less than the start offset, this should be
     // collapsed at the end offset.
     if (aStartOffset > aEndOffset) {
       DoSetRange(aEndParent, aEndOffset, aEndParent, aEndOffset, newStartRoot);
     } else {
-      DoSetRange(aStartParent, aStartOffset,
+      DoSetRange(aStartContainer, aStartOffset,
                  aEndParent, aEndOffset, newStartRoot);
     }
     return NS_OK;
   }
 
   nsINode* newEndRoot = IsValidBoundary(aEndParent);
   if (!newEndRoot) {
     return NS_ERROR_DOM_INVALID_NODE_TYPE_ERR;
@@ -1428,24 +1428,25 @@ nsRange::SetStartAndEnd(nsINode* aStartP
   // If they have different root, this should be collapsed at the end point.
   if (newStartRoot != newEndRoot) {
     DoSetRange(aEndParent, aEndOffset, aEndParent, aEndOffset, newEndRoot);
     return NS_OK;
   }
 
   // If the end point is before the start point, this should be collapsed at
   // the end point.
-  if (nsContentUtils::ComparePoints(aStartParent, aStartOffset,
+  if (nsContentUtils::ComparePoints(aStartContainer, aStartOffset,
                                     aEndParent, aEndOffset) == 1) {
     DoSetRange(aEndParent, aEndOffset, aEndParent, aEndOffset, newEndRoot);
     return NS_OK;
   }
 
   // Otherwise, set the range as specified.
-  DoSetRange(aStartParent, aStartOffset, aEndParent, aEndOffset, newStartRoot);
+  DoSetRange(aStartContainer, aStartOffset,
+             aEndParent, aEndOffset, newStartRoot);
   return NS_OK;
 }
 
 void
 nsRange::SetEndBeforeJS(nsINode& aNode, ErrorResult& aErr)
 {
   AutoCalledByJSRestore calledByJSRestorer(*this);
   mCalledByJS = true;
@@ -1938,34 +1939,34 @@ CollapseRangeAfterDelete(nsRange* aRange
   if (rv.Failed()) return rv.StealNSResult();
 
   return aRange->Collapse(false);
 }
 
 /**
  * Split a data node into two parts.
  *
- * @param aStartNode          The original node we are trying to split.
- * @param aStartIndex         The index at which to split.
+ * @param aStartContainer     The original node we are trying to split.
+ * @param aStartOffset        The offset at which to split.
  * @param aEndNode            The second node.
  * @param aCloneAfterOriginal Set false if the original node should be the
  *                            latter one after split.
  */
-static nsresult SplitDataNode(nsIDOMCharacterData* aStartNode,
-                              uint32_t aStartIndex,
+static nsresult SplitDataNode(nsIDOMCharacterData* aStartContainer,
+                              uint32_t aStartOffset,
                               nsIDOMCharacterData** aEndNode,
                               bool aCloneAfterOriginal = true)
 {
   nsresult rv;
-  nsCOMPtr<nsINode> node = do_QueryInterface(aStartNode);
+  nsCOMPtr<nsINode> node = do_QueryInterface(aStartContainer);
   NS_ENSURE_STATE(node && node->IsNodeOfType(nsINode::eDATA_NODE));
   nsGenericDOMDataNode* dataNode = static_cast<nsGenericDOMDataNode*>(node.get());
 
   nsCOMPtr<nsIContent> newData;
-  rv = dataNode->SplitData(aStartIndex, getter_AddRefs(newData),
+  rv = dataNode->SplitData(aStartOffset, getter_AddRefs(newData),
                            aCloneAfterOriginal);
   NS_ENSURE_SUCCESS(rv, rv);
   return CallQueryInterface(newData, aEndNode);
 }
 
 NS_IMETHODIMP
 PrependChild(nsINode* aContainer, nsINode* aChild)
 {
@@ -3090,45 +3091,46 @@ static nsresult GetPartialTextRect(nsLay
   }
   return NS_OK;
 }
 
 /* static */ void
 nsRange::CollectClientRectsAndText(nsLayoutUtils::RectCallback* aCollector,
                                    Sequence<nsString>* aTextList,
                                    nsRange* aRange,
-                                   nsINode* aStartParent, int32_t aStartOffset,
+                                   nsINode* aStartContainer,
+                                   int32_t aStartOffset,
                                    nsINode* aEndParent, int32_t aEndOffset,
                                    bool aClampToEdge, bool aFlushLayout)
 {
   // Hold strong pointers across the flush
-  nsCOMPtr<nsINode> startContainer = aStartParent;
+  nsCOMPtr<nsINode> startContainer = aStartContainer;
   nsCOMPtr<nsINode> endContainer = aEndParent;
 
   // Flush out layout so our frames are up to date.
-  if (!aStartParent->IsInUncomposedDoc()) {
+  if (!aStartContainer->IsInUncomposedDoc()) {
     return;
   }
 
   if (aFlushLayout) {
-    aStartParent->OwnerDoc()->FlushPendingNotifications(FlushType::Layout);
+    aStartContainer->OwnerDoc()->FlushPendingNotifications(FlushType::Layout);
     // Recheck whether we're still in the document
-    if (!aStartParent->IsInUncomposedDoc()) {
+    if (!aStartContainer->IsInUncomposedDoc()) {
       return;
     }
   }
 
   RangeSubtreeIterator iter;
 
   nsresult rv = iter.Init(aRange);
   if (NS_FAILED(rv)) return;
 
   if (iter.IsDone()) {
     // the range is collapsed, only continue if the cursor is in a text node
-    nsCOMPtr<nsIContent> content = do_QueryInterface(aStartParent);
+    nsCOMPtr<nsIContent> content = do_QueryInterface(aStartContainer);
     if (content && content->IsNodeOfType(nsINode::eTEXT)) {
       nsTextFrame* textFrame = GetTextFrameForContent(content, aFlushLayout);
       if (textFrame) {
         int32_t outOffset;
         nsIFrame* outFrame;
         textFrame->GetChildFrameContainingOffset(aStartOffset, false,
           &outOffset, &outFrame);
         if (outFrame) {
@@ -3613,32 +3615,32 @@ IsLastNonemptyRowGroupOfTable(nsIFrame* 
       }
     }
   }
   return true;
 }
 
 void
 nsRange::GetInnerTextNoFlush(DOMString& aValue, ErrorResult& aError,
-                             nsIContent* aStartParent, uint32_t aStartOffset,
+                             nsIContent* aStartContainer, uint32_t aStartOffset,
                              nsIContent* aEndParent, uint32_t aEndOffset)
 {
   InnerTextAccumulator result(aValue);
-  nsIContent* currentNode = aStartParent;
+  nsIContent* currentNode = aStartContainer;
   TreeTraversalState currentState = AFTER_NODE;
-  if (aStartParent->IsNodeOfType(nsINode::eTEXT)) {
-    auto t = static_cast<nsGenericDOMDataNode*>(aStartParent);
-    if (aStartParent == aEndParent) {
+  if (aStartContainer->IsNodeOfType(nsINode::eTEXT)) {
+    auto t = static_cast<nsGenericDOMDataNode*>(aStartContainer);
+    if (aStartContainer == aEndParent) {
       AppendTransformedText(result, t, aStartOffset, aEndOffset);
       return;
     }
     AppendTransformedText(result, t, aStartOffset, t->TextLength());
   } else {
-    if (uint32_t(aStartOffset) < aStartParent->GetChildCount()) {
-      currentNode = aStartParent->GetChildAt(aStartOffset);
+    if (uint32_t(aStartOffset) < aStartContainer->GetChildCount()) {
+      currentNode = aStartContainer->GetChildAt(aStartOffset);
       currentState = AT_NODE;
     }
   }
 
   nsIContent* endNode = aEndParent;
   TreeTraversalState endState = AFTER_NODE;
   if (aEndParent->IsNodeOfType(nsINode::eTEXT)) {
     endState = AT_NODE;
--- a/dom/base/nsRange.h
+++ b/dom/base/nsRange.h
@@ -42,23 +42,23 @@ class nsRange final : public nsIDOMRange
   typedef mozilla::dom::DOMRect DOMRect;
   typedef mozilla::dom::DOMRectList DOMRectList;
 
   virtual ~nsRange();
 
 public:
   explicit nsRange(nsINode* aNode);
 
-  static nsresult CreateRange(nsIDOMNode* aStartParent, int32_t aStartOffset,
+  static nsresult CreateRange(nsIDOMNode* aStartContainer, int32_t aStartOffset,
                               nsIDOMNode* aEndParent, int32_t aEndOffset,
                               nsRange** aRange);
-  static nsresult CreateRange(nsIDOMNode* aStartParent, int32_t aStartOffset,
+  static nsresult CreateRange(nsIDOMNode* aStartContainer, int32_t aStartOffset,
                               nsIDOMNode* aEndParent, int32_t aEndOffset,
                               nsIDOMRange** aRange);
-  static nsresult CreateRange(nsINode* aStartParent, int32_t aStartOffset,
+  static nsresult CreateRange(nsINode* aStartContainer, int32_t aStartOffset,
                               nsINode* aEndParent, int32_t aEndOffset,
                               nsRange** aRange);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsRange, nsIDOMRange)
 
   nsrefcnt GetRefCount() const
   {
@@ -155,17 +155,17 @@ public:
   /**
    * SetStartAndEnd() works similar to call both SetStart() and SetEnd().
    * Different from calls them separately, this does nothing if either
    * the start point or the end point is invalid point.
    * If the specified start point is after the end point, the range will be
    * collapsed at the end point.  Similarly, if they are in different root,
    * the range will be collapsed at the end point.
    */
-  nsresult SetStartAndEnd(nsINode* aStartParent, int32_t aStartOffset,
+  nsresult SetStartAndEnd(nsINode* aStartContainer, int32_t aStartOffset,
                           nsINode* aEndParent, int32_t aEndOffset);
 
   /**
    * CollapseTo() works similar to call both SetStart() and SetEnd() with
    * same node and offset.  This just calls SetStartAndParent() to set
    * collapsed range at aContainer and aOffset.
    */
   nsresult CollapseTo(nsINode* aContainer, int32_t aOffset)
@@ -265,17 +265,17 @@ public:
   void SetEndAfter(nsINode& aNode, ErrorResult& aErr);
   void SetEndBefore(nsINode& aNode, ErrorResult& aErr);
   void SetStart(nsINode& aNode, uint32_t aOffset, ErrorResult& aErr);
   void SetStartAfter(nsINode& aNode, ErrorResult& aErr);
   void SetStartBefore(nsINode& aNode, ErrorResult& aErr);
 
   static void GetInnerTextNoFlush(mozilla::dom::DOMString& aValue,
                                   mozilla::ErrorResult& aError,
-                                  nsIContent* aStartParent,
+                                  nsIContent* aStartContainer,
                                   uint32_t aStartOffset,
                                   nsIContent* aEndParent,
                                   uint32_t aEndOffset);
 
   nsINode* GetParentObject() const { return mOwner; }
   virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override final;
 
 private:
@@ -321,17 +321,18 @@ public:
 
   /**
    * This helper function gets rects and correlated text for the given range.
    * @param aTextList optional where nullptr = don't retrieve text
    */
   static void CollectClientRectsAndText(nsLayoutUtils::RectCallback* aCollector,
                                         mozilla::dom::Sequence<nsString>* aTextList,
                                         nsRange* aRange,
-                                        nsINode* aStartParent, int32_t aStartOffset,
+                                        nsINode* aStartContainer,
+                                        int32_t aStartOffset,
                                         nsINode* aEndParent, int32_t aEndOffset,
                                         bool aClampToEdge, bool aFlushLayout);
 
   /**
    * Scan this range for -moz-user-select:none nodes and split it up into
    * multiple ranges to exclude those nodes.  The resulting ranges are put
    * in aOutRanges.  If no -moz-user-select:none node is found in the range
    * then |this| is unmodified and is the only range in aOutRanges.
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -3807,36 +3807,36 @@ EditorBase::GetStartNodeAndOffset(Select
   } else {
     *outStartNode = nullptr;
   }
   return NS_OK;
 }
 
 nsresult
 EditorBase::GetStartNodeAndOffset(Selection* aSelection,
-                                  nsINode** aStartNode,
+                                  nsINode** aStartContainer,
                                   int32_t* aStartOffset)
 {
   MOZ_ASSERT(aSelection);
-  MOZ_ASSERT(aStartNode);
+  MOZ_ASSERT(aStartContainer);
   MOZ_ASSERT(aStartOffset);
 
-  *aStartNode = nullptr;
+  *aStartContainer = nullptr;
   *aStartOffset = 0;
 
   if (!aSelection->RangeCount()) {
     return NS_ERROR_FAILURE;
   }
 
   const nsRange* range = aSelection->GetRangeAt(0);
   NS_ENSURE_TRUE(range, NS_ERROR_FAILURE);
 
   NS_ENSURE_TRUE(range->IsPositioned(), NS_ERROR_FAILURE);
 
-  NS_IF_ADDREF(*aStartNode = range->GetStartContainer());
+  NS_IF_ADDREF(*aStartContainer = range->GetStartContainer());
   *aStartOffset = range->StartOffset();
   return NS_OK;
 }
 
 /**
  * GetEndNodeAndOffset() returns whatever the end parent & offset is of
  * the first range in the selection.
  */
@@ -4657,24 +4657,24 @@ EditorBase::CreateTxnForDeleteRange(nsRa
   if (NS_WARN_IF(!deleteNodeTransaction)) {
     return nullptr;
   }
   selectedNode.forget(aRemovingNode);
   return deleteNodeTransaction.forget();
 }
 
 nsresult
-EditorBase::CreateRange(nsIDOMNode* aStartParent,
+EditorBase::CreateRange(nsIDOMNode* aStartContainer,
                         int32_t aStartOffset,
                         nsIDOMNode* aEndParent,
                         int32_t aEndOffset,
                         nsRange** aRange)
 {
-  return nsRange::CreateRange(aStartParent, aStartOffset, aEndParent,
-                              aEndOffset, aRange);
+  return nsRange::CreateRange(aStartContainer, aStartOffset,
+                              aEndParent, aEndOffset, aRange);
 }
 
 nsresult
 EditorBase::AppendNodeToSelectionAsRange(nsIDOMNode* aNode)
 {
   NS_ENSURE_TRUE(aNode, NS_ERROR_NULL_POINTER);
   RefPtr<Selection> selection = GetSelection();
   NS_ENSURE_TRUE(selection, NS_ERROR_FAILURE);
@@ -4811,26 +4811,26 @@ EditorBase::HandleKeyPressEvent(WidgetKe
   return NS_OK;
 }
 
 nsresult
 EditorBase::HandleInlineSpellCheck(EditAction action,
                                    Selection* aSelection,
                                    nsIDOMNode* previousSelectedNode,
                                    int32_t previousSelectedOffset,
-                                   nsIDOMNode* aStartNode,
+                                   nsIDOMNode* aStartContainer,
                                    int32_t aStartOffset,
                                    nsIDOMNode* aEndNode,
                                    int32_t aEndOffset)
 {
   // Have to cast action here because this method is from an IDL
   return mInlineSpellChecker ? mInlineSpellChecker->SpellCheckAfterEditorChange(
                                  (int32_t)action, aSelection,
                                  previousSelectedNode, previousSelectedOffset,
-                                 aStartNode, aStartOffset, aEndNode,
+                                 aStartContainer, aStartOffset, aEndNode,
                                  aEndOffset)
                              : NS_OK;
 }
 
 already_AddRefed<nsIContent>
 EditorBase::FindSelectionRoot(nsINode* aNode)
 {
   nsCOMPtr<nsIContent> rootContent = GetRoot();
--- a/editor/libeditor/EditorBase.h
+++ b/editor/libeditor/EditorBase.h
@@ -801,17 +801,17 @@ public:
   static nsCOMPtr<nsIDOMNode> GetChildAt(nsIDOMNode* aParent, int32_t aOffset);
   static nsIContent* GetNodeAtRangeOffsetPoint(nsINode* aParentOrNode,
                                                int32_t aOffset);
 
   static nsresult GetStartNodeAndOffset(Selection* aSelection,
                                         nsIDOMNode** outStartNode,
                                         int32_t* outStartOffset);
   static nsresult GetStartNodeAndOffset(Selection* aSelection,
-                                        nsINode** aStartNode,
+                                        nsINode** aStartContainer,
                                         int32_t* aStartOffset);
   static nsresult GetEndNodeAndOffset(Selection* aSelection,
                                       nsIDOMNode** outEndNode,
                                       int32_t* outEndOffset);
   static nsresult GetEndNodeAndOffset(Selection* aSelection,
                                       nsINode** aEndNode,
                                       int32_t* aEndOffset);
 #if DEBUG_JOE
@@ -819,17 +819,17 @@ public:
 #endif
   Selection* GetSelection(SelectionType aSelectionType =
                                           SelectionType::eNormal);
 
   /**
    * Helpers to add a node to the selection.
    * Used by table cell selection methods.
    */
-  nsresult CreateRange(nsIDOMNode* aStartParent, int32_t aStartOffset,
+  nsresult CreateRange(nsIDOMNode* aStartContainer, int32_t aStartOffset,
                        nsIDOMNode* aEndParent, int32_t aEndOffset,
                        nsRange** aRange);
 
   /**
    * Creates a range with just the supplied node and appends that to the
    * selection.
    */
   nsresult AppendNodeToSelectionAsRange(nsIDOMNode *aNode);
@@ -860,17 +860,17 @@ public:
   bool GetShouldTxnSetSelection();
 
   virtual nsresult HandleKeyPressEvent(WidgetKeyboardEvent* aKeyboardEvent);
 
   nsresult HandleInlineSpellCheck(EditAction action,
                                   Selection* aSelection,
                                   nsIDOMNode* previousSelectedNode,
                                   int32_t previousSelectedOffset,
-                                  nsIDOMNode* aStartNode,
+                                  nsIDOMNode* aStartContainer,
                                   int32_t aStartOffset,
                                   nsIDOMNode* aEndNode,
                                   int32_t aEndOffset);
 
   virtual already_AddRefed<dom::EventTarget> GetDOMEventTarget() = 0;
 
   /**
    * Fast non-refcounting editor root element accessor
--- a/editor/libeditor/HTMLEditor.h
+++ b/editor/libeditor/HTMLEditor.h
@@ -643,17 +643,17 @@ protected:
                                       int32_t* outStartOffset,
                                       int32_t* outEndOffset,
                                       bool aTrustedInput);
   nsresult ParseFragment(const nsAString& aStr, nsIAtom* aContextLocalName,
                          nsIDocument* aTargetDoc,
                          dom::DocumentFragment** aFragment, bool aTrustedInput);
   void CreateListOfNodesToPaste(dom::DocumentFragment& aFragment,
                                 nsTArray<OwningNonNull<nsINode>>& outNodeList,
-                                nsINode* aStartNode,
+                                nsINode* aStartContainer,
                                 int32_t aStartOffset,
                                 nsINode* aEndNode,
                                 int32_t aEndOffset);
   nsresult CreateTagStack(nsTArray<nsString>& aTagStack,
                           nsIDOMNode* aNode);
   enum class StartOrEnd { start, end };
   void GetListAndTableParents(StartOrEnd aStartOrEnd,
                               nsTArray<OwningNonNull<nsINode>>& aNodeList,
--- a/editor/libeditor/HTMLEditorDataTransfer.cpp
+++ b/editor/libeditor/HTMLEditorDataTransfer.cpp
@@ -2222,32 +2222,32 @@ HTMLEditor::ParseFragment(const nsAStrin
   fragment.forget(aFragment);
   return rv;
 }
 
 void
 HTMLEditor::CreateListOfNodesToPaste(
               DocumentFragment& aFragment,
               nsTArray<OwningNonNull<nsINode>>& outNodeList,
-              nsINode* aStartNode,
+              nsINode* aStartContainer,
               int32_t aStartOffset,
               nsINode* aEndNode,
               int32_t aEndOffset)
 {
   // If no info was provided about the boundary between context and stream,
   // then assume all is stream.
-  if (!aStartNode) {
-    aStartNode = &aFragment;
+  if (!aStartContainer) {
+    aStartContainer = &aFragment;
     aStartOffset = 0;
     aEndNode = &aFragment;
     aEndOffset = aFragment.Length();
   }
 
   RefPtr<nsRange> docFragRange;
-  nsresult rv = nsRange::CreateRange(aStartNode, aStartOffset,
+  nsresult rv = nsRange::CreateRange(aStartContainer, aStartOffset,
                                      aEndNode, aEndOffset,
                                      getter_AddRefs(docFragRange));
   MOZ_ASSERT(NS_SUCCEEDED(rv));
   NS_ENSURE_SUCCESS(rv, );
 
   // Now use a subtree iterator over the range to create a list of nodes
   TrivialFunctor functor;
   DOMSubtreeIterator iter;
--- a/editor/txtsvc/nsFilteredContentIterator.cpp
+++ b/editor/txtsvc/nsFilteredContentIterator.cpp
@@ -205,33 +205,34 @@ ContentToParentOffset(nsIContent *aConte
 }
 
 ///////////////////////////////////////////////////////////////////////////
 // ContentIsInTraversalRange: returns true if content is visited during
 // the traversal of the range in the specified mode.
 //
 static bool
 ContentIsInTraversalRange(nsIContent *aContent,   bool aIsPreMode,
-                          nsIDOMNode *aStartNode, int32_t aStartOffset,
+                          nsIDOMNode *aStartContainer, int32_t aStartOffset,
                           nsIDOMNode *aEndNode,   int32_t aEndOffset)
 {
-  NS_ENSURE_TRUE(aStartNode && aEndNode && aContent, false);
+  NS_ENSURE_TRUE(aStartContainer && aEndNode && aContent, false);
 
   nsCOMPtr<nsIDOMNode> parentNode;
   int32_t indx = 0;
 
   ContentToParentOffset(aContent, getter_AddRefs(parentNode), &indx);
 
   NS_ENSURE_TRUE(parentNode, false);
 
   if (!aIsPreMode)
     ++indx;
 
-  int32_t startRes = nsContentUtils::ComparePoints(aStartNode, aStartOffset,
-                                                   parentNode, indx);
+  int32_t startRes =
+    nsContentUtils::ComparePoints(aStartContainer, aStartOffset,
+                                  parentNode, indx);
   int32_t endRes = nsContentUtils::ComparePoints(aEndNode, aEndOffset,
                                                  parentNode, indx);
   return (startRes <= 0) && (endRes >= 0);
 }
 
 static bool
 ContentIsInTraversalRange(nsRange* aRange, nsIDOMNode* aNextNode, bool aIsPreMode)
 {
--- a/editor/txtsvc/nsTextServicesDocument.cpp
+++ b/editor/txtsvc/nsTextServicesDocument.cpp
@@ -2801,46 +2801,51 @@ nsTextServicesDocument::SelectionIsColla
 bool
 nsTextServicesDocument::SelectionIsValid()
 {
   return(mSelStartIndex >= 0);
 }
 
 nsresult
 nsTextServicesDocument::GetRangeEndPoints(nsRange* aRange,
-                                          nsIDOMNode **aStartParent, int32_t *aStartOffset,
-                                          nsIDOMNode **aEndParent, int32_t *aEndOffset)
+                                          nsIDOMNode** aStartContainer,
+                                          int32_t* aStartOffset,
+                                          nsIDOMNode** aEndParent,
+                                          int32_t* aEndOffset)
 {
-  NS_ENSURE_TRUE(aRange && aStartParent && aStartOffset && aEndParent && aEndOffset, NS_ERROR_NULL_POINTER);
-
-  nsresult rv = aRange->GetStartContainer(aStartParent);
+  NS_ENSURE_TRUE(aRange && aStartContainer && aStartOffset &&
+                 aEndParent && aEndOffset, NS_ERROR_NULL_POINTER);
+
+  nsresult rv = aRange->GetStartContainer(aStartContainer);
 
   NS_ENSURE_SUCCESS(rv, rv);
 
-  NS_ENSURE_TRUE(aStartParent, NS_ERROR_FAILURE);
+  NS_ENSURE_TRUE(aStartContainer, NS_ERROR_FAILURE);
 
   rv = aRange->GetStartOffset(aStartOffset);
 
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = aRange->GetEndContainer(aEndParent);
 
   NS_ENSURE_SUCCESS(rv, rv);
 
   NS_ENSURE_TRUE(aEndParent, NS_ERROR_FAILURE);
 
   return aRange->GetEndOffset(aEndOffset);
 }
 
 nsresult
-nsTextServicesDocument::CreateRange(nsIDOMNode *aStartParent, int32_t aStartOffset,
-                                    nsIDOMNode *aEndParent, int32_t aEndOffset,
+nsTextServicesDocument::CreateRange(nsIDOMNode* aStartContainer,
+                                    int32_t aStartOffset,
+                                    nsIDOMNode* aEndParent,
+                                    int32_t aEndOffset,
                                     nsRange** aRange)
 {
-  return nsRange::CreateRange(aStartParent, aStartOffset, aEndParent,
+  return nsRange::CreateRange(aStartContainer, aStartOffset, aEndParent,
                               aEndOffset, aRange);
 }
 
 nsresult
 nsTextServicesDocument::FirstTextNode(nsIContentIterator *aIterator,
                                       TSDIteratorStatus *aIteratorStatus)
 {
   if (aIteratorStatus) {
--- a/editor/txtsvc/nsTextServicesDocument.h
+++ b/editor/txtsvc/nsTextServicesDocument.h
@@ -155,20 +155,22 @@ public:
   NS_IMETHOD WillInsertText(nsIDOMCharacterData *aTextNode, int32_t aOffset, const nsAString &aString) override;
   NS_IMETHOD DidInsertText(nsIDOMCharacterData *aTextNode, int32_t aOffset, const nsAString &aString, nsresult aResult) override;
   NS_IMETHOD WillDeleteText(nsIDOMCharacterData *aTextNode, int32_t aOffset, int32_t aLength) override;
   NS_IMETHOD DidDeleteText(nsIDOMCharacterData *aTextNode, int32_t aOffset, int32_t aLength, nsresult aResult) override;
   NS_IMETHOD WillDeleteSelection(nsISelection *aSelection) override;
   NS_IMETHOD DidDeleteSelection(nsISelection *aSelection) override;
 
   /* Helper functions */
-  static nsresult GetRangeEndPoints(nsRange* aRange, nsIDOMNode** aParent1,
-                                    int32_t* aOffset1, nsIDOMNode** aParent2,
+  static nsresult GetRangeEndPoints(nsRange* aRange,
+                                    nsIDOMNode** aStartContainer,
+                                    int32_t* aStartOffset,
+                                    nsIDOMNode** aParent2,
                                     int32_t* aOffset2);
-  static nsresult CreateRange(nsIDOMNode* aStartParent, int32_t aStartOffset,
+  static nsresult CreateRange(nsIDOMNode* aStartContainer, int32_t aStartOffset,
                               nsIDOMNode* aEndParent, int32_t aEndOffset,
                               nsRange** aRange);
 
 private:
   /* nsTextServicesDocument private methods. */
 
   nsresult CreateContentIterator(nsRange* aRange,
                                  nsIContentIterator** aIterator);