Bug 1425321 - Renaming nsINode::GetChildAt to GetChildAt_Deprecated, r=catalinb
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 03 Jan 2018 13:59:54 +0100
changeset 397585 9de67942469381c88c87f7422b6a7116b9f20a14
parent 397584 ba12a841ef9370953df6e282983b2dcda502c22e
child 397586 e6e3487083570a5c8f31343d672e6f3bb84374e8
push id98558
push useramarchesini@mozilla.com
push dateWed, 03 Jan 2018 13:01:47 +0000
treeherdermozilla-inbound@e6e348708357 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscatalinb
bugs1425321, 651120
milestone59.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 1425321 - Renaming nsINode::GetChildAt to GetChildAt_Deprecated, r=catalinb We want to deprecate nsINode::GetChildAt as the first step of removing DOM node child array storage. See bug 651120.
accessible/base/nsCoreUtils.cpp
accessible/generic/HyperTextAccessible.cpp
dom/base/Attr.cpp
dom/base/Attr.h
dom/base/FragmentOrElement.cpp
dom/base/FragmentOrElement.h
dom/base/RangeBoundary.h
dom/base/Selection.cpp
dom/base/nsContentAreaDragDrop.cpp
dom/base/nsContentIterator.cpp
dom/base/nsContentSink.cpp
dom/base/nsContentUtils.cpp
dom/base/nsDocument.cpp
dom/base/nsDocument.h
dom/base/nsDocumentEncoder.cpp
dom/base/nsFocusManager.cpp
dom/base/nsGenericDOMDataNode.cpp
dom/base/nsGenericDOMDataNode.h
dom/base/nsINode.cpp
dom/base/nsINode.h
dom/base/nsRange.cpp
dom/events/ContentEventHandler.cpp
dom/events/IMEContentObserver.cpp
dom/html/HTMLFieldSetElement.cpp
dom/html/HTMLPictureElement.cpp
dom/html/HTMLSelectElement.cpp
dom/html/nsHTMLContentSink.cpp
dom/xbl/XBLChildrenElement.cpp
dom/xbl/nsXBLPrototypeBinding.cpp
dom/xslt/xslt/txMozillaXMLOutput.cpp
dom/xul/templates/nsXULContentBuilder.cpp
editor/libeditor/EditorBase.cpp
editor/libeditor/EditorDOMPoint.h
editor/libeditor/HTMLEditorDataTransfer.cpp
extensions/spellcheck/src/mozInlineSpellWordUtil.cpp
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsPresContext.cpp
layout/forms/nsTextControlFrame.cpp
layout/generic/nsFrameSelection.cpp
layout/printing/nsPrintJob.cpp
layout/style/nsCSSRuleProcessor.cpp
layout/xul/nsListBoxBodyFrame.cpp
layout/xul/nsXULTooltipListener.cpp
layout/xul/tree/nsTreeColumns.cpp
layout/xul/tree/nsTreeContentView.cpp
layout/xul/tree/nsTreeUtils.cpp
toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
widget/cocoa/nsMenuBarX.mm
widget/cocoa/nsMenuItemX.mm
widget/cocoa/nsMenuX.mm
--- a/accessible/base/nsCoreUtils.cpp
+++ b/accessible/base/nsCoreUtils.cpp
@@ -221,17 +221,17 @@ nsCoreUtils::GetDOMNodeFromDOMPoint(nsIN
   if (aNode && aNode->IsElement()) {
     uint32_t childCount = aNode->GetChildCount();
     NS_ASSERTION(aOffset <= childCount, "Wrong offset of the DOM point!");
 
     // The offset can be after last child of container node that means DOM point
     // is placed immediately after the last child. In this case use the DOM node
     // from the given DOM point is used as result node.
     if (aOffset != childCount)
-      return aNode->GetChildAt(aOffset);
+      return aNode->GetChildAt_Deprecated(aOffset);
   }
 
   return aNode;
 }
 
 bool
 nsCoreUtils::IsAncestorOf(nsINode *aPossibleAncestorNode,
                           nsINode *aPossibleDescendantNode,
--- a/accessible/generic/HyperTextAccessible.cpp
+++ b/accessible/generic/HyperTextAccessible.cpp
@@ -237,17 +237,17 @@ HyperTextAccessible::DOMPointToOffset(ns
     // findNode could be null if aNodeOffset == # of child nodes, which means
     // one of two things:
     // 1) there are no children, and the passed-in node is not mContent -- use
     //    parentContent for the node to find
     // 2) there are no children and the passed-in node is mContent, which means
     //    we're an empty nsIAccessibleText
     // 3) there are children and we're at the end of the children
 
-    findNode = aNode->GetChildAt(aNodeOffset);
+    findNode = aNode->GetChildAt_Deprecated(aNodeOffset);
     if (!findNode) {
       if (aNodeOffset == 0) {
         if (aNode == GetNode()) {
           // Case #1: this accessible has no children and thus has empty text,
           // we can only be at hypertext offset 0.
           return 0;
         }
 
--- a/dom/base/Attr.cpp
+++ b/dom/base/Attr.cpp
@@ -303,17 +303,17 @@ Attr::IsNodeOfType(uint32_t aFlags) cons
 
 uint32_t
 Attr::GetChildCount() const
 {
   return 0;
 }
 
 nsIContent *
-Attr::GetChildAt(uint32_t aIndex) const
+Attr::GetChildAt_Deprecated(uint32_t aIndex) const
 {
   return nullptr;
 }
 
 int32_t
 Attr::IndexOf(const nsINode* aPossibleChild) const
 {
   return -1;
--- a/dom/base/Attr.h
+++ b/dom/base/Attr.h
@@ -60,17 +60,17 @@ public:
   // nsIAttribute interface
   void SetMap(nsDOMAttributeMap *aMap) override;
   Element* GetElement() const;
   nsresult SetOwnerDocument(nsIDocument* aDocument) override;
 
   // nsINode interface
   virtual bool IsNodeOfType(uint32_t aFlags) const override;
   virtual uint32_t GetChildCount() const override;
-  virtual nsIContent *GetChildAt(uint32_t aIndex) const override;
+  virtual nsIContent *GetChildAt_Deprecated(uint32_t aIndex) const override;
   virtual int32_t IndexOf(const nsINode* aPossibleChild) const override;
   virtual nsresult InsertChildAt(nsIContent* aKid, uint32_t aIndex,
                                  bool aNotify) override;
   virtual void RemoveChildAt(uint32_t aIndex, bool aNotify) override;
   virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
                          bool aPreallocateChildren) const override;
   virtual already_AddRefed<nsIURI> GetBaseURI(bool aTryUseXHRDocBaseURI = false) const override;
 
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -141,17 +141,17 @@ uint64_t nsMutationGuard::sGeneration = 
 nsIContent*
 nsIContent::FindFirstNonChromeOnlyAccessContent() const
 {
   // This handles also nested native anonymous content.
   for (const nsIContent *content = this; content;
        content = content->GetBindingParent()) {
     if (!content->ChromeOnlyAccess()) {
       // Oops, this function signature allows casting const to
-      // non-const.  (Then again, so does GetChildAt(0)->GetParent().)
+      // non-const.  (Then again, so does GetChildAt_Deprecated(0)->GetParent().)
       return const_cast<nsIContent*>(content);
     }
   }
   return nullptr;
 }
 
 // https://dom.spec.whatwg.org/#dom-slotable-assignedslot
 HTMLSlotElement*
@@ -540,17 +540,17 @@ nsAttrChildContentList::Item(uint32_t aI
 
   return CallQueryInterface(node, aReturn);
 }
 
 nsIContent*
 nsAttrChildContentList::Item(uint32_t aIndex)
 {
   if (mNode) {
-    return mNode->GetChildAt(aIndex);
+    return mNode->GetChildAt_Deprecated(aIndex);
   }
 
   return nullptr;
 }
 
 int32_t
 nsAttrChildContentList::IndexOf(nsIContent* aContent)
 {
@@ -1157,17 +1157,17 @@ FragmentOrElement::InsertChildAt(nsICont
 
   return doInsertChildAt(aKid, aIndex, aNotify, mAttrsAndChildren);
 }
 
 void
 FragmentOrElement::RemoveChildAt(uint32_t aIndex, bool aNotify)
 {
   nsCOMPtr<nsIContent> oldKid = mAttrsAndChildren.GetSafeChildAt(aIndex);
-  NS_ASSERTION(oldKid == GetChildAt(aIndex), "Unexpected child in RemoveChildAt");
+  NS_ASSERTION(oldKid == GetChildAt_Deprecated(aIndex), "Unexpected child in RemoveChildAt");
 
   if (oldKid) {
     doRemoveChildAt(aIndex, aNotify, oldKid, mAttrsAndChildren);
   }
 }
 
 void
 FragmentOrElement::GetTextContentInternal(nsAString& aTextContent,
@@ -2113,17 +2113,17 @@ FragmentOrElement::AppendTextTo(nsAStrin
 
 uint32_t
 FragmentOrElement::GetChildCount() const
 {
   return mAttrsAndChildren.ChildCount();
 }
 
 nsIContent *
-FragmentOrElement::GetChildAt(uint32_t aIndex) const
+FragmentOrElement::GetChildAt_Deprecated(uint32_t aIndex) const
 {
   return mAttrsAndChildren.GetSafeChildAt(aIndex);
 }
 
 int32_t
 FragmentOrElement::IndexOf(const nsINode* aPossibleChild) const
 {
   return mAttrsAndChildren.IndexOfChild(aPossibleChild);
--- a/dom/base/FragmentOrElement.h
+++ b/dom/base/FragmentOrElement.h
@@ -113,17 +113,17 @@ public:
   explicit FragmentOrElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   NS_DECL_ADDSIZEOFEXCLUDINGTHIS
 
   // nsINode interface methods
   virtual uint32_t GetChildCount() const override;
-  virtual nsIContent *GetChildAt(uint32_t aIndex) const override;
+  virtual nsIContent *GetChildAt_Deprecated(uint32_t aIndex) const override;
   virtual int32_t IndexOf(const nsINode* aPossibleChild) const override;
   virtual nsresult InsertChildAt(nsIContent* aKid, uint32_t aIndex,
                                  bool aNotify) override;
   virtual void RemoveChildAt(uint32_t aIndex, bool aNotify) override;
   virtual void GetTextContentInternal(nsAString& aTextContent,
                                       mozilla::OOMReporter& aError) override;
   virtual void SetTextContentInternal(const nsAString& aTextContent,
                                       nsIPrincipal* aSubjectPrincipal,
--- a/dom/base/RangeBoundary.h
+++ b/dom/base/RangeBoundary.h
@@ -72,17 +72,17 @@ public:
     , mRef(nullptr)
     , mOffset(mozilla::Some(aOffset))
   {
     if (mParent && mParent->IsContainerNode()) {
       // Find a reference node
       if (aOffset == static_cast<int32_t>(aContainer->GetChildCount())) {
         mRef = aContainer->GetLastChild();
       } else if (aOffset != 0) {
-        mRef = mParent->GetChildAt(aOffset - 1);
+        mRef = mParent->GetChildAt_Deprecated(aOffset - 1);
       }
 
       NS_WARNING_ASSERTION(mRef || aOffset == 0,
                            "Constructing RangeBoundary with invalid value");
     }
 
     NS_WARNING_ASSERTION(!mRef || mRef->GetParentNode() == mParent,
                          "Constructing RangeBoundary with invalid value");
@@ -120,17 +120,17 @@ public:
   {
     if (!mParent || !mParent->IsContainerNode()) {
       return nullptr;
     }
     if (!mRef) {
       MOZ_ASSERT(Offset() == 0, "invalid RangeBoundary");
       return mParent->GetFirstChild();
     }
-    MOZ_ASSERT(mParent->GetChildAt(Offset()) == mRef->GetNextSibling());
+    MOZ_ASSERT(mParent->GetChildAt_Deprecated(Offset()) == mRef->GetNextSibling());
     return mRef->GetNextSibling();
   }
 
   /**
    * GetNextSiblingOfChildOffset() returns next sibling of a child at offset.
    * If this refers after the last child or the container cannot have children,
    * this returns nullptr with warning.
    */
@@ -203,17 +203,17 @@ public:
     mParent = aContainer;
     if (mParent && mParent->IsContainerNode()) {
       // Find a reference node
       if (aOffset == static_cast<int32_t>(aContainer->GetChildCount())) {
         mRef = aContainer->GetLastChild();
       } else if (aOffset == 0) {
         mRef = nullptr;
       } else {
-        mRef = mParent->GetChildAt(aOffset - 1);
+        mRef = mParent->GetChildAt_Deprecated(aOffset - 1);
         MOZ_ASSERT(mRef);
       }
 
       NS_WARNING_ASSERTION(mRef || aOffset == 0,
                            "Setting RangeBoundary to invalid value");
     } else {
       mRef = nullptr;
     }
--- a/dom/base/Selection.cpp
+++ b/dom/base/Selection.cpp
@@ -598,17 +598,17 @@ Selection::GetTableCellLocationFromRange
 
   // Get the child content (the cell) pointed to by starting node of range
   // We do minimal checking since GetTableSelectionType assures
   //   us that this really is a table cell
   nsCOMPtr<nsIContent> content = do_QueryInterface(aRange->GetStartContainer());
   if (!content)
     return NS_ERROR_FAILURE;
 
-  nsCOMPtr<nsIContent> child = content->GetChildAt(aRange->StartOffset());
+  nsCOMPtr<nsIContent> child = content->GetChildAt_Deprecated(aRange->StartOffset());
   if (!child)
     return NS_ERROR_FAILURE;
 
   // GetCellLayout depends on current frame, we need flush frame to get
   // nsITableCellLayout
   nsCOMPtr<nsIPresShell> presShell = mFrameSelection->GetShell();
   if (presShell) {
     presShell->FlushPendingNotifications(FlushType::Frames);
@@ -705,17 +705,17 @@ Selection::GetTableSelectionType(nsIDOMR
   }
 
   if (startContent->IsHTMLElement(nsGkAtoms::tr))
   {
     *aTableSelectionType = nsISelectionPrivate::TABLESELECTION_CELL;
   }
   else //check to see if we are selecting a table or row (column and all cells not done yet)
   {
-    nsIContent *child = startNode->GetChildAt(startOffset);
+    nsIContent *child = startNode->GetChildAt_Deprecated(startOffset);
     if (!child)
       return NS_ERROR_FAILURE;
 
     if (child->IsHTMLElement(nsGkAtoms::table))
       *aTableSelectionType = nsISelectionPrivate::TABLESELECTION_TABLE;
     else if (child->IsHTMLElement(nsGkAtoms::tr))
       *aTableSelectionType = nsISelectionPrivate::TABLESELECTION_ROW;
   }
--- a/dom/base/nsContentAreaDragDrop.cpp
+++ b/dom/base/nsContentAreaDragDrop.cpp
@@ -863,17 +863,17 @@ DragDataProducer::GetDraggableSelectionD
           if (abs(anchorOffset - focusOffset) == 1) {
             nsCOMPtr<nsIContent> selStartContent =
               do_QueryInterface(selectionStart);
 
             if (selStartContent) {
               int32_t childOffset =
                 (anchorOffset < focusOffset) ? anchorOffset : focusOffset;
               nsIContent *childContent =
-                selStartContent->GetChildAt(childOffset);
+                selStartContent->GetChildAt_Deprecated(childOffset);
               // if we find an image, we'll fall into the node-dragging code,
               // rather the the selection-dragging code
               if (nsContentUtils::IsDraggableImage(childContent)) {
                 NS_ADDREF(*outImageOrLinkNode = childContent);
                 return NS_OK;
               }
             }
           }
--- a/dom/base/nsContentIterator.cpp
+++ b/dom/base/nsContentIterator.cpp
@@ -644,17 +644,17 @@ nsContentIterator::GetDeepLastChild(nsIC
   if (NS_WARN_IF(!aRoot)) {
     return nullptr;
   }
 
   nsIContent* node = aRoot;
   int32_t numChildren = node->GetChildCount();
 
   while (numChildren) {
-    nsIContent* child = node->GetChildAt(--numChildren);
+    nsIContent* child = node->GetChildAt_Deprecated(--numChildren);
 
     if (aIndexes) {
       // Add this node to the stack of indexes
       aIndexes->AppendElement(numChildren);
     }
     numChildren = child->GetChildCount();
     node = child;
   }
@@ -686,25 +686,25 @@ nsContentIterator::GetNextSibling(nsINod
   } else {
     indx = mCachedIndex;
   }
   NS_WARNING_ASSERTION(indx >= 0, "bad indx");
 
   // reverify that the index of the current node hasn't changed.
   // not super cheap, but a lot cheaper than IndexOf(), and still O(1).
   // ignore result this time - the index may now be out of range.
-  nsIContent* sib = parent->GetChildAt(indx);
+  nsIContent* sib = parent->GetChildAt_Deprecated(indx);
   if (sib != aNode) {
     // someone changed our index - find the new index the painful way
     indx = parent->IndexOf(aNode);
     NS_WARNING_ASSERTION(indx >= 0, "bad indx");
   }
 
   // indx is now canonically correct
-  if ((sib = parent->GetChildAt(++indx))) {
+  if ((sib = parent->GetChildAt_Deprecated(++indx))) {
     // update index cache
     if (aIndexes && !aIndexes->IsEmpty()) {
       aIndexes->ElementAt(aIndexes->Length()-1) = indx;
     } else {
       mCachedIndex = indx;
     }
   } else {
     if (parent != mCommonParent) {
@@ -747,25 +747,25 @@ nsContentIterator::GetPrevSibling(nsINod
     // use the last entry on the Indexes array for the current index
     indx = (*aIndexes)[aIndexes->Length()-1];
   } else {
     indx = mCachedIndex;
   }
 
   // reverify that the index of the current node hasn't changed
   // ignore result this time - the index may now be out of range.
-  nsIContent* sib = parent->GetChildAt(indx);
+  nsIContent* sib = parent->GetChildAt_Deprecated(indx);
   if (sib != aNode) {
     // someone changed our index - find the new index the painful way
     indx = parent->IndexOf(aNode);
     NS_WARNING_ASSERTION(indx >= 0, "bad indx");
   }
 
   // indx is now canonically correct
-  if (indx > 0 && (sib = parent->GetChildAt(--indx))) {
+  if (indx > 0 && (sib = parent->GetChildAt_Deprecated(--indx))) {
     // update index cache
     if (aIndexes && !aIndexes->IsEmpty()) {
       aIndexes->ElementAt(aIndexes->Length()-1) = indx;
     } else {
       mCachedIndex = indx;
     }
   } else if (parent != mCommonParent) {
     if (aIndexes && !aIndexes->IsEmpty()) {
@@ -824,26 +824,26 @@ nsContentIterator::NextNode(nsINode* aNo
   } else {
     indx = mCachedIndex;
   }
 
   // reverify that the index of the current node hasn't changed.  not super
   // cheap, but a lot cheaper than IndexOf(), and still O(1).  ignore result
   // this time - the index may now be out of range.
   if (indx >= 0) {
-    sibling = parent->GetChildAt(indx);
+    sibling = parent->GetChildAt_Deprecated(indx);
   }
   if (sibling != node) {
     // someone changed our index - find the new index the painful way
     indx = parent->IndexOf(node);
     NS_WARNING_ASSERTION(indx >= 0, "bad indx");
   }
 
   // indx is now canonically correct
-  sibling = parent->GetChildAt(++indx);
+  sibling = parent->GetChildAt_Deprecated(++indx);
   if (sibling) {
     // update cache
     if (aIndexes && !aIndexes->IsEmpty()) {
       // replace an entry on the index stack
       aIndexes->ElementAt(aIndexes->Length()-1) = indx;
     } else {
       mCachedIndex = indx;
     }
@@ -893,28 +893,28 @@ nsContentIterator::PrevNode(nsINode* aNo
     } else {
       indx = mCachedIndex;
     }
 
     // reverify that the index of the current node hasn't changed.  not super
     // cheap, but a lot cheaper than IndexOf(), and still O(1).  ignore result
     // this time - the index may now be out of range.
     if (indx >= 0) {
-      sibling = parent->GetChildAt(indx);
-      NS_WARNING_ASSERTION(sibling, "GetChildAt returned null");
+      sibling = parent->GetChildAt_Deprecated(indx);
+      NS_WARNING_ASSERTION(sibling, "GetChildAt_Deprecated returned null");
     }
 
     if (sibling != node) {
       // someone changed our index - find the new index the painful way
       indx = parent->IndexOf(node);
       NS_WARNING_ASSERTION(indx >= 0, "bad indx");
     }
 
     // indx is now canonically correct
-    if (indx && (sibling = parent->GetChildAt(--indx))) {
+    if (indx && (sibling = parent->GetChildAt_Deprecated(--indx))) {
       // update cache
       if (aIndexes && !aIndexes->IsEmpty()) {
         // replace an entry on the index stack
         aIndexes->ElementAt(aIndexes->Length()-1) = indx;
       } else {
         mCachedIndex = indx;
       }
 
@@ -1390,17 +1390,17 @@ nsContentSubtreeIterator::InitWithRange(
   // find first node in range
   int32_t offset = mRange->StartOffset();
 
   nsINode* node = nullptr;
   if (!startContainer->GetChildCount()) {
     // no children, start at the node itself
     node = startContainer;
   } else {
-    nsIContent* child = startContainer->GetChildAt(offset);
+    nsIContent* child = startContainer->GetChildAt_Deprecated(offset);
     if (!child) {
       // offset after last child
       node = startContainer;
     } else {
       firstCandidate = child;
     }
   }
 
@@ -1439,17 +1439,17 @@ nsContentSubtreeIterator::InitWithRange(
 
   if (offset > numChildren) {
     // Can happen for text nodes
     offset = numChildren;
   }
   if (!offset || !numChildren) {
     node = endContainer;
   } else {
-    lastCandidate = endContainer->GetChildAt(--offset);
+    lastCandidate = endContainer->GetChildAt_Deprecated(--offset);
     NS_ASSERTION(lastCandidate,
                  "tree traversal trouble in nsContentSubtreeIterator::Init");
   }
 
   if (!lastCandidate) {
     // then lastCandidate is prev node before node
     lastCandidate = GetPrevSibling(node);
   }
--- a/dom/base/nsContentSink.cpp
+++ b/dom/base/nsContentSink.cpp
@@ -1296,17 +1296,17 @@ nsContentSink::NotifyAppend(nsIContent* 
   }
 
   mInNotification++;
 
   {
     // Scope so we call EndUpdate before we decrease mInNotification
     MOZ_AUTO_DOC_UPDATE(mDocument, UPDATE_CONTENT_MODEL, !mBeganUpdate);
     nsNodeUtils::ContentAppended(aContainer,
-                                 aContainer->GetChildAt(aStartIndex));
+                                 aContainer->GetChildAt_Deprecated(aStartIndex));
     mLastNotificationTime = PR_Now();
   }
 
   mInNotification--;
 }
 
 NS_IMETHODIMP
 nsContentSink::Notify(nsITimer *timer)
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -5301,17 +5301,17 @@ nsContentUtils::SetNodeTextContent(nsICo
   nsAutoMutationBatch mb;
 
   uint32_t childCount = aContent->GetChildCount();
 
   if (aTryReuse && !aValue.IsEmpty()) {
     uint32_t removeIndex = 0;
 
     for (uint32_t i = 0; i < childCount; ++i) {
-      nsIContent* child = aContent->GetChildAt(removeIndex);
+      nsIContent* child = aContent->GetChildAt_Deprecated(removeIndex);
       if (removeIndex == 0 && child && child->IsNodeOfType(nsINode::eTEXT)) {
         nsresult rv = child->SetText(aValue, true);
         NS_ENSURE_SUCCESS(rv, rv);
 
         removeIndex = 1;
       }
       else {
         aContent->RemoveChildAt(removeIndex, true);
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -4436,17 +4436,17 @@ nsDocument::GetRootElementInternal() con
     }
   }
 
   const_cast<nsDocument*>(this)->mCachedRootElement = nullptr;
   return nullptr;
 }
 
 nsIContent *
-nsDocument::GetChildAt(uint32_t aIndex) const
+nsDocument::GetChildAt_Deprecated(uint32_t aIndex) const
 {
   return mChildren.GetSafeChildAt(aIndex);
 }
 
 int32_t
 nsDocument::IndexOf(const nsINode* aPossibleChild) const
 {
   return mChildren.IndexOfChild(aPossibleChild);
@@ -4468,17 +4468,17 @@ nsDocument::InsertChildAt(nsIContent* aK
   }
 
   return doInsertChildAt(aKid, aIndex, aNotify, mChildren);
 }
 
 void
 nsDocument::RemoveChildAt(uint32_t aIndex, bool aNotify)
 {
-  nsCOMPtr<nsIContent> oldKid = GetChildAt(aIndex);
+  nsCOMPtr<nsIContent> oldKid = GetChildAt_Deprecated(aIndex);
   if (!oldKid) {
     return;
   }
 
   if (oldKid->IsElement()) {
     // Destroy the link map up front before we mess with the child list.
     DestroyElementMaps();
   }
--- a/dom/base/nsDocument.h
+++ b/dom/base/nsDocument.h
@@ -549,17 +549,17 @@ public:
   virtual void OnPageShow(bool aPersisted, mozilla::dom::EventTarget* aDispatchStartTarget) override;
   virtual void OnPageHide(bool aPersisted, mozilla::dom::EventTarget* aDispatchStartTarget) override;
 
   virtual void WillDispatchMutationEvent(nsINode* aTarget) override;
   virtual void MutationEventDispatched(nsINode* aTarget) override;
 
   // nsINode
   virtual bool IsNodeOfType(uint32_t aFlags) const override;
-  virtual nsIContent *GetChildAt(uint32_t aIndex) const override;
+  virtual nsIContent *GetChildAt_Deprecated(uint32_t aIndex) const override;
   virtual int32_t IndexOf(const nsINode* aPossibleChild) const override;
   virtual uint32_t GetChildCount() const override;
   virtual nsresult InsertChildAt(nsIContent* aKid, uint32_t aIndex,
                                  bool aNotify) override;
   virtual void RemoveChildAt(uint32_t aIndex, bool aNotify) override;
   virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
                          bool aPreallocateChildren) const override
   {
--- a/dom/base/nsDocumentEncoder.cpp
+++ b/dom/base/nsDocumentEncoder.cpp
@@ -638,17 +638,17 @@ nsDocumentEncoder::FlushText(nsAString& 
 static nsresult ChildAt(nsIDOMNode* aNode, int32_t aIndex, nsIDOMNode*& aChild)
 {
   nsCOMPtr<nsIContent> content(do_QueryInterface(aNode));
 
   aChild = nullptr;
 
   NS_ENSURE_TRUE(content, NS_ERROR_FAILURE);
 
-  nsIContent *child = content->GetChildAt(aIndex);
+  nsIContent *child = content->GetChildAt_Deprecated(aIndex);
 
   if (child)
     return CallQueryInterface(child, &aChild);
 
   return NS_OK;
 }
 
 static int32_t IndexOf(nsIDOMNode* aParent, nsIDOMNode* aChild)
@@ -840,17 +840,17 @@ nsDocumentEncoder::SerializeRangeNodes(n
         if (aNode != aRange->GetEndContainer())
         {
           endOffset++;
         }
       }
       // serialize the children of this node that are in the range
       for (j=startOffset; j<endOffset; j++)
       {
-        childAsNode = content->GetChildAt(j);
+        childAsNode = content->GetChildAt_Deprecated(j);
 
         if ((j==startOffset) || (j==endOffset-1))
           rv = SerializeRangeNodes(aRange, childAsNode, aString, aDepth+1);
         else
           rv = SerializeToStringRecursive(childAsNode, aString, false);
 
         NS_ENSURE_SUCCESS(rv, rv);
       }
@@ -1853,17 +1853,17 @@ nsHTMLCopyEncoder::GetChildAt(nsIDOMNode
   nsCOMPtr<nsIDOMNode> resultNode;
 
   if (!aParent)
     return resultNode;
 
   nsCOMPtr<nsIContent> content = do_QueryInterface(aParent);
   NS_PRECONDITION(content, "null content in nsHTMLCopyEncoder::GetChildAt");
 
-  resultNode = do_QueryInterface(content->GetChildAt(aOffset));
+  resultNode = do_QueryInterface(content->GetChildAt_Deprecated(aOffset));
 
   return resultNode;
 }
 
 bool
 nsHTMLCopyEncoder::IsMozBR(nsIDOMNode* aNode)
 {
   MOZ_ASSERT(aNode);
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -2550,27 +2550,27 @@ nsFocusManager::GetSelectionLocation(nsI
       domRange->GetStartContainer(getter_AddRefs(startNode));
       domRange->GetEndContainer(getter_AddRefs(endNode));
       domRange->GetStartOffset(&startOffset);
 
       nsIContent *childContent = nullptr;
 
       startContent = do_QueryInterface(startNode);
       if (startContent && startContent->IsElement()) {
-        childContent = startContent->GetChildAt(startOffset);
+        childContent = startContent->GetChildAt_Deprecated(startOffset);
         if (childContent) {
           startContent = childContent;
         }
       }
 
       endContent = do_QueryInterface(endNode);
       if (endContent && endContent->IsElement()) {
         uint32_t endOffset = 0;
         domRange->GetEndOffset(&endOffset);
-        childContent = endContent->GetChildAt(endOffset);
+        childContent = endContent->GetChildAt_Deprecated(endOffset);
         if (childContent) {
           endContent = childContent;
         }
       }
     }
   }
   else {
     rv = NS_ERROR_INVALID_ARG;
@@ -3377,19 +3377,20 @@ nsFocusManager::GetNextTabbableMapArea(b
                       tabIndex != aCurrentTabIndex)) {
       // If aStartContent is in this map we must start iterating past it.
       // We skip the case where aStartContent has tabindex == aStartContent
       // since the next tab ordered element might be before it
       // (or after for backwards) in the child list.
       index = aForward ? -1 : (int32_t)count;
     }
 
-    // GetChildAt will return nullptr if our index < 0 or index >= count
+    // GetChildAt_Deprecated will return nullptr if our index < 0 or index >=
+    // count
     nsCOMPtr<nsIContent> areaContent;
-    while ((areaContent = mapContent->GetChildAt(aForward ? ++index : --index)) != nullptr) {
+    while ((areaContent = mapContent->GetChildAt_Deprecated(aForward ? ++index : --index)) != nullptr) {
       if (areaContent->IsFocusable(&tabIndex) && tabIndex == aCurrentTabIndex) {
         return areaContent;
       }
     }
   }
 
   return nullptr;
 }
--- a/dom/base/nsGenericDOMDataNode.cpp
+++ b/dom/base/nsGenericDOMDataNode.cpp
@@ -634,17 +634,17 @@ nsGenericDOMDataNode::GetChildren(uint32
 
 uint32_t
 nsGenericDOMDataNode::GetChildCount() const
 {
   return 0;
 }
 
 nsIContent *
-nsGenericDOMDataNode::GetChildAt(uint32_t aIndex) const
+nsGenericDOMDataNode::GetChildAt_Deprecated(uint32_t aIndex) const
 {
   return nullptr;
 }
 
 
 int32_t
 nsGenericDOMDataNode::IndexOf(const nsINode* aPossibleChild) const
 {
@@ -771,30 +771,30 @@ nsGenericDOMDataNode::SplitText(uint32_t
   return rv;
 }
 
 /* static */ int32_t
 nsGenericDOMDataNode::FirstLogicallyAdjacentTextNode(nsIContent* aParent,
                                                      int32_t aIndex)
 {
   while (aIndex-- > 0) {
-    nsIContent* sibling = aParent->GetChildAt(aIndex);
+    nsIContent* sibling = aParent->GetChildAt_Deprecated(aIndex);
     if (!sibling->IsNodeOfType(nsINode::eTEXT))
       return aIndex + 1;
   }
   return 0;
 }
 
 /* static */ int32_t
 nsGenericDOMDataNode::LastLogicallyAdjacentTextNode(nsIContent* aParent,
                                                     int32_t aIndex,
                                                     uint32_t aCount)
 {
   while (++aIndex < int32_t(aCount)) {
-    nsIContent* sibling = aParent->GetChildAt(aIndex);
+    nsIContent* sibling = aParent->GetChildAt_Deprecated(aIndex);
     if (!sibling->IsNodeOfType(nsINode::eTEXT))
       return aIndex - 1;
   }
   return aCount - 1;
 }
 
 nsresult
 nsGenericDOMDataNode::GetWholeText(nsAString& aWholeText)
@@ -815,17 +815,17 @@ nsGenericDOMDataNode::GetWholeText(nsASt
   int32_t last =
     LastLogicallyAdjacentTextNode(parent, index, parent->GetChildCount());
 
   aWholeText.Truncate();
 
   nsCOMPtr<nsIDOMText> node;
   nsAutoString tmp;
   do {
-    node = do_QueryInterface(parent->GetChildAt(first));
+    node = do_QueryInterface(parent->GetChildAt_Deprecated(first));
     node->GetData(tmp);
     aWholeText.Append(tmp);
   } while (first++ < last);
 
   return NS_OK;
 }
 
 //----------------------------------------------------------------------
--- a/dom/base/nsGenericDOMDataNode.h
+++ b/dom/base/nsGenericDOMDataNode.h
@@ -100,17 +100,17 @@ public:
   nsresult AppendData(const nsAString& aArg);
   nsresult InsertData(uint32_t aOffset, const nsAString& aArg);
   nsresult DeleteData(uint32_t aOffset, uint32_t aCount);
   nsresult ReplaceData(uint32_t aOffset, uint32_t aCount,
                        const nsAString& aArg);
 
   // nsINode methods
   virtual uint32_t GetChildCount() const override;
-  virtual nsIContent *GetChildAt(uint32_t aIndex) const override;
+  virtual nsIContent *GetChildAt_Deprecated(uint32_t aIndex) const override;
   virtual int32_t IndexOf(const nsINode* aPossibleChild) const override;
   virtual nsresult InsertChildAt(nsIContent* aKid, uint32_t aIndex,
                                  bool aNotify) override;
   virtual void RemoveChildAt(uint32_t aIndex, bool aNotify) override;
   virtual void GetTextContentInternal(nsAString& aTextContent,
                                       mozilla::OOMReporter& aError) override
   {
     GetNodeValue(aTextContent);
--- a/dom/base/nsINode.cpp
+++ b/dom/base/nsINode.cpp
@@ -1923,17 +1923,17 @@ void
 nsINode::doRemoveChildAt(uint32_t aIndex, bool aNotify,
                          nsIContent* aKid, nsAttrAndChildArray& aChildArray)
 {
   // NOTE: This function must not trigger any calls to
   // nsIDocument::GetRootElement() calls until *after* it has removed aKid from
   // aChildArray. Any calls before then could potentially restore a stale
   // value for our cached root element, per note in nsDocument::RemoveChildAt().
   MOZ_ASSERT(aKid && aKid->GetParentNode() == this &&
-             aKid == GetChildAt(aIndex) &&
+             aKid == GetChildAt_Deprecated(aIndex) &&
              IndexOf(aKid) == (int32_t)aIndex, "Bogus aKid");
   MOZ_ASSERT(!IsNodeOfType(nsINode::eATTRIBUTE));
 
   nsMutationGuard::DidMutate();
   mozAutoDocUpdate updateBatch(GetComposedDoc(), UPDATE_CONTENT_MODEL, aNotify);
 
   nsIContent* previousSibling = aKid->GetPreviousSibling();
 
@@ -2257,18 +2257,18 @@ nsINode::ReplaceOrInsertBefore(bool aRep
     // while kungFuDeathGrip is still alive.
     {
       mozAutoDocUpdate batch(newContent->GetComposedDoc(),
                              UPDATE_CONTENT_MODEL, true);
       nsAutoMutationBatch mb(oldParent, true, true);
       oldParent->RemoveChildAt(removeIndex, true);
       if (nsAutoMutationBatch::GetCurrentBatch() == &mb) {
         mb.RemovalDone();
-        mb.SetPrevSibling(oldParent->GetChildAt(removeIndex - 1));
-        mb.SetNextSibling(oldParent->GetChildAt(removeIndex));
+        mb.SetPrevSibling(oldParent->GetChildAt_Deprecated(removeIndex - 1));
+        mb.SetNextSibling(oldParent->GetChildAt_Deprecated(removeIndex));
       }
     }
 
     // We expect one mutation (the removal) to have happened.
     if (guard.Mutated(1)) {
       // XBL destructors, yuck.
 
       // Verify that nodeToInsertBefore, if non-null, is still our child.  If
@@ -2467,18 +2467,18 @@ nsINode::ReplaceOrInsertBefore(bool aRep
   nsINode* result = aReplace ? aRefChild : aNewChild;
   if (nodeType == nsIDOMNode::DOCUMENT_FRAGMENT_NODE) {
     if (!aReplace) {
       mb.Init(this, true, true);
     }
     nsAutoMutationBatch* mutationBatch = nsAutoMutationBatch::GetCurrentBatch();
     if (mutationBatch) {
       mutationBatch->RemovalDone();
-      mutationBatch->SetPrevSibling(GetChildAt(insPos - 1));
-      mutationBatch->SetNextSibling(GetChildAt(insPos));
+      mutationBatch->SetPrevSibling(GetChildAt_Deprecated(insPos - 1));
+      mutationBatch->SetNextSibling(GetChildAt_Deprecated(insPos));
     }
 
     uint32_t count = fragChildren->Length();
     if (!count) {
       return result;
     }
 
     bool appending =
@@ -2525,18 +2525,18 @@ nsINode::ReplaceOrInsertBefore(bool aRep
 
     // FIXME https://bugzilla.mozilla.org/show_bug.cgi?id=544654
     //       We need to reparent here for nodes for which the parent of their
     //       wrapper is not the wrapper for their ownerDocument (XUL elements,
     //       form controls, ...). Also applies in the fragment code above.
 
     if (nsAutoMutationBatch::GetCurrentBatch() == &mb) {
       mb.RemovalDone();
-      mb.SetPrevSibling(GetChildAt(insPos - 1));
-      mb.SetNextSibling(GetChildAt(insPos));
+      mb.SetPrevSibling(GetChildAt_Deprecated(insPos - 1));
+      mb.SetNextSibling(GetChildAt_Deprecated(insPos));
     }
     aError = InsertChildAt(newContent, insPos, true);
     if (aError.Failed()) {
       return nullptr;
     }
   }
 
   return result;
--- a/dom/base/nsINode.h
+++ b/dom/base/nsINode.h
@@ -497,29 +497,32 @@ public:
 
   /**
    * Get the number of children
    * @return the number of children
    */
   virtual uint32_t GetChildCount() const = 0;
 
   /**
+   * NOTE: this function is going to be removed soon (hopefully!) Don't use it
+   * in new code.
+   *
    * Get a child by index
    * @param aIndex the index of the child to get
    * @return the child, or null if index out of bounds
    */
-  virtual nsIContent* GetChildAt(uint32_t aIndex) const = 0;
+  virtual nsIContent* GetChildAt_Deprecated(uint32_t aIndex) const = 0;
 
   /**
    * Get the index of a child within this content
    * @param aPossibleChild the child to get the index of.
    * @return the index of the child, or -1 if not a child
    *
-   * If the return value is not -1, then calling GetChildAt() with that value
-   * will return aPossibleChild.
+   * If the return value is not -1, then calling GetChildAt_Deprecated() with
+   * that value will return aPossibleChild.
    */
   virtual int32_t IndexOf(const nsINode* aPossibleChild) const = 0;
 
   /**
    * Returns the "node document" of this node.
    *
    * https://dom.spec.whatwg.org/#concept-node-document
    *
@@ -1299,17 +1302,17 @@ public:
   nsIContent* GetSelectionRootContent(nsIPresShell* aPresShell);
 
   virtual nsINodeList* ChildNodes();
   nsIContent* GetFirstChild() const { return mFirstChild; }
   nsIContent* GetLastChild() const
   {
     uint32_t count = GetChildCount();
 
-    return count > 0 ? GetChildAt(count - 1) : nullptr;
+    return count > 0 ? GetChildAt_Deprecated(count - 1) : nullptr;
   }
 
   /**
    * Implementation is in nsIDocument.h, because it needs to cast from
    * nsIDocument* to nsINode*.
    */
   nsIDocument* GetOwnerDocument() const;
 
--- a/dom/base/nsRange.cpp
+++ b/dom/base/nsRange.cpp
@@ -3854,28 +3854,28 @@ nsRange::GetInnerTextNoFlush(DOMString& 
     auto t = static_cast<nsGenericDOMDataNode*>(aStartContainer);
     if (aStartContainer == aEndContainer) {
       AppendTransformedText(result, t, aStartOffset, aEndOffset);
       return;
     }
     AppendTransformedText(result, t, aStartOffset, t->TextLength());
   } else {
     if (uint32_t(aStartOffset) < aStartContainer->GetChildCount()) {
-      currentNode = aStartContainer->GetChildAt(aStartOffset);
+      currentNode = aStartContainer->GetChildAt_Deprecated(aStartOffset);
       currentState = AT_NODE;
     }
   }
 
   nsIContent* endNode = aEndContainer;
   TreeTraversalState endState = AFTER_NODE;
   if (aEndContainer->IsNodeOfType(nsINode::eTEXT)) {
     endState = AT_NODE;
   } else {
     if (aEndOffset < aEndContainer->GetChildCount()) {
-      endNode = aEndContainer->GetChildAt(aEndOffset);
+      endNode = aEndContainer->GetChildAt_Deprecated(aEndOffset);
       endState = AT_NODE;
     }
   }
 
   while (currentNode != endNode || currentState != endState) {
     nsIFrame* f = currentNode->GetPrimaryFrame();
     bool isVisibleAndNotReplaced = IsVisibleAndNotInReplacedElement(f);
     if (currentState == AT_NODE) {
--- a/dom/events/ContentEventHandler.cpp
+++ b/dom/events/ContentEventHandler.cpp
@@ -1607,24 +1607,24 @@ ContentEventHandler::GetNodePositionHavi
   // If it's a empty element node, returns itself.
   if (!childCount) {
     MOZ_ASSERT(!aNodeOffset || aNodeOffset == 1);
     return NodePosition(aNode, aNodeOffset);
   }
 
   // If there is a node at given position, return the start of it.
   if (aNodeOffset < childCount) {
-    return NodePosition(aNode->GetChildAt(aNodeOffset), 0);
+    return NodePosition(aNode->GetChildAt_Deprecated(aNodeOffset), 0);
   }
 
   // If the offset represents "after" the node, we need to return the last
   // child of it.  For example, if a range is |<p>[<br>]</p>|, then, the
   // end point is {<p>, 1}.  In such case, callers need the <br> node.
   if (aNodeOffset == childCount) {
-    nsINode* node = aNode->GetChildAt(childCount - 1);
+    nsINode* node = aNode->GetChildAt_Deprecated(childCount - 1);
     return NodePosition(node,
       node->IsNodeOfType(nsINode::eTEXT)
         ? static_cast<int32_t>(node->AsContent()->TextLength())
         : 1);
   }
 
   NS_WARNING("aNodeOffset is invalid value");
   return NodePosition();
@@ -1714,17 +1714,17 @@ ContentEventHandler::GetLastFrameInRange
     // Don't set nextNodeOfRangeEnd to the start node of aRawRange because if
     // endNode is same as start node of the range, the text node shouldn't be
     // next of range end even if the offset is 0.  This could occur with empty
     // text node.
     if (!endOffset && aRawRange.GetStartContainer() != endNode) {
       nextNodeOfRangeEnd = endNode;
     }
   } else if (endOffset < endNode->GetChildCount()) {
-    nextNodeOfRangeEnd = endNode->GetChildAt(endOffset);
+    nextNodeOfRangeEnd = endNode->GetChildAt_Deprecated(endOffset);
   }
 
   for (iter->Last(); !iter->IsDone(); iter->Prev()) {
     nsINode* node = iter->GetCurrentNode();
     if (NS_WARN_IF(!node)) {
       break;
     }
 
@@ -3053,17 +3053,17 @@ ContentEventHandler::AdjustCollapsedRang
     // If the range is the start of the container, adjusted the range to the
     // start of the first child.
     childNode = container->GetFirstChild();
     offsetInChildNode = 0;
   } else if (static_cast<uint32_t>(offsetInParentNode) <
                container->GetChildCount()) {
     // If the range is next to a child node, adjust the range to the end of
     // the previous child.
-    childNode = container->GetChildAt(offsetInParentNode - 1);
+    childNode = container->GetChildAt_Deprecated(offsetInParentNode - 1);
     offsetInChildNode = childNode->Length();
   }
 
   // But if the found node isn't a text node, we cannot modify the range.
   if (!childNode || !childNode->IsNodeOfType(nsINode::eTEXT) ||
       NS_WARN_IF(offsetInChildNode < 0)) {
     return NS_OK;
   }
--- a/dom/events/IMEContentObserver.cpp
+++ b/dom/events/IMEContentObserver.cpp
@@ -1272,17 +1272,17 @@ IMEContentObserver::GetChildNode(nsINode
     return nullptr;
   }
   if (!aOffset) {
     return aParent->GetFirstChild();
   }
   if (aOffset == static_cast<int32_t>(aParent->Length() - 1)) {
     return aParent->GetLastChild();
   }
-  return aParent->GetChildAt(aOffset);
+  return aParent->GetChildAt_Deprecated(aOffset);
 }
 
 bool
 IMEContentObserver::IsNextNodeOfLastAddedNode(nsINode* aParent,
                                               nsIContent* aChild) const
 {
   MOZ_ASSERT(aParent);
   MOZ_ASSERT(aChild && aChild->GetParentNode() == aParent);
--- a/dom/html/HTMLFieldSetElement.cpp
+++ b/dom/html/HTMLFieldSetElement.cpp
@@ -169,17 +169,17 @@ HTMLFieldSetElement::InsertChildAt(nsICo
   return rv;
 }
 
 void
 HTMLFieldSetElement::RemoveChildAt(uint32_t aIndex, bool aNotify)
 {
   bool firstLegendHasChanged = false;
 
-  if (mFirstLegend && (GetChildAt(aIndex) == mFirstLegend)) {
+  if (mFirstLegend && (GetChildAt_Deprecated(aIndex) == mFirstLegend)) {
     // If we are removing the first legend we have to found another one.
     nsIContent* child = mFirstLegend->GetNextSibling();
     mFirstLegend = nullptr;
     firstLegendHasChanged = true;
 
     for (; child; child = child->GetNextSibling()) {
       if (child->IsHTMLElement(nsGkAtoms::legend)) {
         mFirstLegend = child;
--- a/dom/html/HTMLPictureElement.cpp
+++ b/dom/html/HTMLPictureElement.cpp
@@ -30,17 +30,17 @@ HTMLPictureElement::~HTMLPictureElement(
 
 NS_IMPL_ISUPPORTS_INHERITED0(HTMLPictureElement, nsGenericHTMLElement)
 
 NS_IMPL_ELEMENT_CLONE(HTMLPictureElement)
 
 void
 HTMLPictureElement::RemoveChildAt(uint32_t aIndex, bool aNotify)
 {
-  nsCOMPtr<nsIContent> child = GetChildAt(aIndex);
+  nsCOMPtr<nsIContent> child = GetChildAt_Deprecated(aIndex);
 
   if (child && child->IsHTMLElement(nsGkAtoms::img)) {
     HTMLImageElement* img = HTMLImageElement::FromContent(child);
     if (img) {
       img->PictureSourceRemoved(child->AsContent());
     }
   } else if (child && child->IsHTMLElement(nsGkAtoms::source)) {
     // Find all img siblings after this <source> to notify them of its demise
--- a/dom/html/HTMLSelectElement.cpp
+++ b/dom/html/HTMLSelectElement.cpp
@@ -415,17 +415,17 @@ HTMLSelectElement::WillAddOptions(nsICon
     if (aContentIndex >= children) {
       // If the content insert is after the end of the parent, then we want to get
       // the next index *after* the parent and insert there.
       ind = GetOptionIndexAfter(aParent);
     } else {
       // If the content insert is somewhere in the middle of the container, then
       // we want to get the option currently at the index and insert in front of
       // that.
-      nsIContent* currentKid = aParent->GetChildAt(aContentIndex);
+      nsIContent* currentKid = aParent->GetChildAt_Deprecated(aContentIndex);
       NS_ASSERTION(currentKid, "Child not found!");
       if (currentKid) {
         ind = GetOptionIndexAt(currentKid);
       } else {
         ind = -1;
       }
     }
   }
@@ -440,17 +440,17 @@ HTMLSelectElement::WillRemoveOptions(nsI
                                      bool aNotify)
 {
   if (this != aParent && this != aParent->GetParent()) {
     return NS_OK;
   }
   int32_t level = this == aParent ? 0 : 1;
 
   // Get the index where the options will be removed
-  nsIContent* currentKid = aParent->GetChildAt(aContentIndex);
+  nsIContent* currentKid = aParent->GetChildAt_Deprecated(aContentIndex);
   if (currentKid) {
     int32_t ind;
     if (!mNonOptionChildren) {
       // If there are no artifacts, aContentIndex == ind
       ind = aContentIndex;
     } else {
       // If there are artifacts, we have to get the index of the option the
       // hard way
@@ -525,17 +525,17 @@ HTMLSelectElement::GetFirstOptionIndex(n
 int32_t
 HTMLSelectElement::GetFirstChildOptionIndex(nsIContent* aOptions,
                                             int32_t aStartIndex,
                                             int32_t aEndIndex)
 {
   int32_t retval = -1;
 
   for (int32_t i = aStartIndex; i < aEndIndex; ++i) {
-    retval = GetFirstOptionIndex(aOptions->GetChildAt(i));
+    retval = GetFirstOptionIndex(aOptions->GetChildAt_Deprecated(i));
     if (retval != -1) {
       break;
     }
   }
 
   return retval;
 }
 
--- a/dom/html/nsHTMLContentSink.cpp
+++ b/dom/html/nsHTMLContentSink.cpp
@@ -325,17 +325,17 @@ SinkContext::DidAddContent(nsIContent* a
   // an insertion happen, we need to do an immediate
   // notification for that insertion.
   if (0 < mStackPos &&
       mStack[mStackPos - 1].mInsertionPoint != -1 &&
       mStack[mStackPos - 1].mNumFlushed <
       mStack[mStackPos - 1].mContent->GetChildCount()) {
     nsIContent* parent = mStack[mStackPos - 1].mContent;
     int32_t childIndex = mStack[mStackPos - 1].mInsertionPoint - 1;
-    NS_ASSERTION(parent->GetChildAt(childIndex) == aContent,
+    NS_ASSERTION(parent->GetChildAt_Deprecated(childIndex) == aContent,
                  "Flushing the wrong child.");
     mSink->NotifyInsert(parent, aContent, childIndex);
     mStack[mStackPos - 1].mNumFlushed = parent->GetChildCount();
   } else if (mSink->IsTimeToNotify()) {
     FlushTags();
   }
 }
 
@@ -519,17 +519,17 @@ SinkContext::FlushTags()
 
       if (!flushed && (mStack[stackPos].mNumFlushed < childCount)) {
         if (mStack[stackPos].mInsertionPoint != -1) {
           // We might have popped the child off our stack already
           // but not notified on it yet, which is why we have to get it
           // directly from its parent node.
 
           int32_t childIndex = mStack[stackPos].mInsertionPoint - 1;
-          nsIContent* child = content->GetChildAt(childIndex);
+          nsIContent* child = content->GetChildAt_Deprecated(childIndex);
           // Child not on stack anymore; can't assert it's correct
           NS_ASSERTION(!(mStackPos > (stackPos + 1)) ||
                        (child == mStack[stackPos + 1].mContent),
                        "Flushing the wrong child.");
           mSink->NotifyInsert(content, child, childIndex);
         } else {
           mSink->NotifyAppend(content, mStack[stackPos].mNumFlushed);
         }
--- a/dom/xbl/XBLChildrenElement.cpp
+++ b/dom/xbl/XBLChildrenElement.cpp
@@ -118,17 +118,17 @@ nsAnonymousContentList::Item(uint32_t aI
       if (point->HasInsertedChildren()) {
         if (remIndex < point->InsertedChildrenLength()) {
           return point->InsertedChild(remIndex);
         }
         remIndex -= point->InsertedChildrenLength();
       }
       else {
         if (remIndex < point->GetChildCount()) {
-          return point->GetChildAt(remIndex);
+          return point->GetChildAt_Deprecated(remIndex);
         }
         remIndex -= point->GetChildCount();
       }
     }
     else {
       if (remIndex == 0) {
         return child;
       }
--- a/dom/xbl/nsXBLPrototypeBinding.cpp
+++ b/dom/xbl/nsXBLPrototypeBinding.cpp
@@ -478,17 +478,17 @@ nsXBLPrototypeBinding::LocateInstance(El
 
   nsIContent *copyParent =
     templParent == aTemplRoot ? aCopyRoot :
                    LocateInstance(aBoundElement, aTemplRoot, aCopyRoot, templParent);
 
   if (!copyParent)
     return nullptr;
 
-  nsIContent* child = copyParent->GetChildAt(templParent->IndexOf(aTemplChild));
+  nsIContent* child = copyParent->GetChildAt_Deprecated(templParent->IndexOf(aTemplChild));
   if (child && child->IsElement()) {
     return child->AsElement();
   }
   return nullptr;
 }
 
 void
 nsXBLPrototypeBinding::SetInitialAttributes(
@@ -1482,17 +1482,17 @@ nsXBLPrototypeBinding::WriteContentNode(
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Finally, write out the child nodes.
   count = element->GetChildCount();
   rv = aStream->Write32(count);
   NS_ENSURE_SUCCESS(rv, rv);
 
   for (i = 0; i < count; i++) {
-    rv = WriteContentNode(aStream, element->GetChildAt(i));
+    rv = WriteContentNode(aStream, element->GetChildAt_Deprecated(i));
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   return NS_OK;
 }
 
 nsresult
 nsXBLPrototypeBinding::ReadNamespace(nsIObjectInputStream* aStream,
--- a/dom/xslt/xslt/txMozillaXMLOutput.cpp
+++ b/dom/xslt/xslt/txMozillaXMLOutput.cpp
@@ -627,17 +627,17 @@ txMozillaXMLOutput::createTxWrapper()
 
     uint32_t i, j, childCount = mDocument->GetChildCount();
 #ifdef DEBUG
     // Keep track of the location of the current documentElement, if there is
     // one, so we can verify later
     uint32_t rootLocation = 0;
 #endif
     for (i = 0, j = 0; i < childCount; ++i) {
-        nsCOMPtr<nsIContent> childContent = mDocument->GetChildAt(j);
+        nsCOMPtr<nsIContent> childContent = mDocument->GetChildAt_Deprecated(j);
 
 #ifdef DEBUG
         if (childContent->IsElement()) {
             rootLocation = j;
         }
 #endif
 
         if (childContent->NodeInfo()->NameAtom() == nsGkAtoms::documentTypeNodeName) {
--- a/dom/xul/templates/nsXULContentBuilder.cpp
+++ b/dom/xul/templates/nsXULContentBuilder.cpp
@@ -869,22 +869,22 @@ nsXULContentBuilder::SynchronizeUsingTem
         rv = CopyAttributesToElement(aTemplateNode->AsElement(), aRealNode->AsElement(), aResult, true);
         if (NS_FAILED(rv))
             return rv;
     }
 
     uint32_t count = aTemplateNode->GetChildCount();
 
     for (uint32_t loop = 0; loop < count; ++loop) {
-        nsIContent *tmplKid = aTemplateNode->GetChildAt(loop);
+        nsIContent *tmplKid = aTemplateNode->GetChildAt_Deprecated(loop);
 
         if (! tmplKid)
             break;
 
-        nsIContent *realKid = aRealNode->GetChildAt(loop);
+        nsIContent *realKid = aRealNode->GetChildAt_Deprecated(loop);
         if (! realKid)
             break;
 
         // check for text nodes and update them accordingly.
         // This code is similar to that in BuildContentFromTemplate
         if (tmplKid->NodeInfo()->Equals(nsGkAtoms::textnode,
                                         kNameSpaceID_XUL)) {
             nsAutoString attrValue;
@@ -1050,17 +1050,17 @@ nsXULContentBuilder::CreateContainerCont
         CreateContainerContentsForQuerySet(aElement, aResult, aNotify, queryset,
                                            &container, &newIndexInContainer);
     }
 
     if (aNotifyAtEnd && container) {
         MOZ_AUTO_DOC_UPDATE(container->GetUncomposedDoc(), UPDATE_CONTENT_MODEL,
                             true);
         nsNodeUtils::ContentAppended(container,
-                                     container->GetChildAt(newIndexInContainer));
+                                     container->GetChildAt_Deprecated(newIndexInContainer));
     }
 
     NS_IF_RELEASE(container);
 
     return NS_OK;
 }
 
 nsresult
@@ -1280,17 +1280,17 @@ nsXULContentBuilder::RemoveGeneratedCont
         // Pull the next "ungenerated" element off the queue.
         uint32_t last = count - 1;
         nsCOMPtr<nsIContent> element = ungenerated[last];
         ungenerated.RemoveElementAt(last);
 
         uint32_t i = element->GetChildCount();
 
         while (i-- > 0) {
-            nsCOMPtr<nsIContent> child = element->GetChildAt(i);
+            nsCOMPtr<nsIContent> child = element->GetChildAt_Deprecated(i);
 
             // Optimize for the <template> element, because we *know*
             // it won't have any generated content: there's no reason
             // to even check this subtree.
             // XXX should this check |child| rather than |element|? Otherwise
             //     it should be moved outside the inner loop. Bug 297290.
             if (element->NodeInfo()->Equals(nsGkAtoms::_template,
                                             kNameSpaceID_XUL) ||
@@ -1903,39 +1903,39 @@ nsXULContentBuilder::InsertSortedNode(El
         if (numChildren > 0) {
             nsIContent *temp;
             int32_t direction;
 
             // rjc says: The following is an implementation of a fairly optimal
             // binary search insertion sort... with interpolation at either end-point.
 
             if (mSortState.lastWasFirst) {
-                child = aContainer->GetChildAt(staticCount);
+                child = aContainer->GetChildAt_Deprecated(staticCount);
                 temp = child;
                 rv = CompareResultToNode(aResult, temp, &direction);
                 if (direction < 0) {
                     aContainer->InsertChildAt(aNode, staticCount, aNotify);
                     childAdded = true;
                 } else
                     mSortState.lastWasFirst = false;
             } else if (mSortState.lastWasLast) {
-                child = aContainer->GetChildAt(realNumChildren - 1);
+                child = aContainer->GetChildAt_Deprecated(realNumChildren - 1);
                 temp = child;
                 rv = CompareResultToNode(aResult, temp, &direction);
                 if (direction > 0) {
                     aContainer->InsertChildAt(aNode, realNumChildren, aNotify);
                     childAdded = true;
                 } else
                     mSortState.lastWasLast = false;
             }
 
             int32_t left = staticCount + 1, right = realNumChildren, x;
             while (!childAdded && right >= left) {
                 x = (left + right) / 2;
-                child = aContainer->GetChildAt(x - 1);
+                child = aContainer->GetChildAt_Deprecated(x - 1);
                 temp = child;
 
                 rv = CompareResultToNode(aResult, temp, &direction);
                 if ((x == left && direction < 0) ||
                     (x == right && direction >= 0) ||
                     left == right)
                 {
                     int32_t thePos = (direction > 0 ? x : x - 1);
--- a/editor/libeditor/EditorBase.cpp
+++ b/editor/libeditor/EditorBase.cpp
@@ -2619,28 +2619,28 @@ EditorBase::FindBetterInsertionPoint(con
       return EditorRawDOMPoint(aPoint.GetContainer()->GetFirstChild(), 0);
     }
 
     // In some other cases, aNode is the anonymous DIV, and offset points to the
     // terminating mozBR.  In that case, we'll adjust aInOutNode and
     // aInOutOffset to the preceding text node, if any.
     if (!aPoint.IsStartOfContainer()) {
       if (AsHTMLEditor()) {
-        // Fall back to a slow path that uses GetChildAt() for Thunderbird's
+        // Fall back to a slow path that uses GetChildAt_Deprecated() for Thunderbird's
         // plaintext editor.
         nsIContent* child = aPoint.GetPreviousSiblingOfChild();
         if (child && child->IsNodeOfType(nsINode::eTEXT)) {
           if (NS_WARN_IF(child->Length() > INT32_MAX)) {
             return aPoint;
           }
           return EditorRawDOMPoint(child, child->Length());
         }
       } else {
         // If we're in a real plaintext editor, use a fast path that avoids
-        // calling GetChildAt() which may perform a linear search.
+        // calling GetChildAt_Deprecated() which may perform a linear search.
         nsIContent* child = aPoint.GetContainer()->GetLastChild();
         while (child) {
           if (child->IsNodeOfType(nsINode::eTEXT)) {
             if (NS_WARN_IF(child->Length() > INT32_MAX)) {
               return aPoint;
             }
             return EditorRawDOMPoint(child, child->Length());
           }
@@ -4275,17 +4275,17 @@ EditorBase::JoinNodeDeep(nsIContent& aLe
 
     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;
-    rightNodeToJoin = parentNode->GetChildAt(length);
+    rightNodeToJoin = parentNode->GetChildAt_Deprecated(length);
     if (rightNodeToJoin) {
       leftNodeToJoin = rightNodeToJoin->GetPreviousSibling();
     } else {
       leftNodeToJoin = nullptr;
     }
 
     // Skip over non-editable nodes
     while (leftNodeToJoin && !IsEditable(leftNodeToJoin)) {
--- a/editor/libeditor/EditorDOMPoint.h
+++ b/editor/libeditor/EditorDOMPoint.h
@@ -140,17 +140,17 @@ public:
     , mOffset(mozilla::Some(aOffset))
     , mIsChildInitialized(true)
   {
     MOZ_RELEASE_ASSERT(aContainer,
       "This constructor shouldn't be used when pointing nowhere");
     MOZ_ASSERT(mOffset.value() <= mParent->Length());
     MOZ_ASSERT(mChild || mParent->Length() == mOffset.value());
     MOZ_ASSERT(!mChild || mParent == mChild->GetParentNode());
-    MOZ_ASSERT(mParent->GetChildAt(mOffset.value()) == mChild);
+    MOZ_ASSERT(mParent->GetChildAt_Deprecated(mOffset.value()) == mChild);
   }
 
   template<typename PT, typename CT>
   explicit EditorDOMPointBase(const RangeBoundaryBase<PT, CT>& aOther)
     : mParent(aOther.mParent)
     , mChild(aOther.mRef ? aOther.mRef->GetNextSibling() :
                            (aOther.mParent ? aOther.mParent->GetFirstChild() :
                                              nullptr))
@@ -545,17 +545,17 @@ public:
     }
     if (mIsChildInitialized) {
       if (mParent->GetFirstChild() == mChild) {
         NS_WARNING_ASSERTION(!mOffset.isSome() || !mOffset.value(),
           "If mOffset was initialized, it should be 0");
         return true;
       }
       NS_WARNING_ASSERTION(!mOffset.isSome() ||
-                           mParent->GetChildAt(mOffset.value()) == mChild,
+                           mParent->GetChildAt_Deprecated(mOffset.value()) == mChild,
         "If mOffset and mChild are mismatched");
       return false;
     }
     MOZ_ASSERT(mOffset.isSome());
     return !mOffset.value();
   }
 
   bool
@@ -573,17 +573,17 @@ public:
     if (mIsChildInitialized) {
       if (!mChild) {
         NS_WARNING_ASSERTION(!mOffset.isSome() ||
                              mOffset.value() == mParent->Length(),
           "If mOffset was initialized, it should be length of the container");
         return true;
       }
       NS_WARNING_ASSERTION(!mOffset.isSome() ||
-                           mParent->GetChildAt(mOffset.value()) == mChild,
+                           mParent->GetChildAt_Deprecated(mOffset.value()) == mChild,
         "If mOffset and mChild are mismatched");
       return false;
     }
     MOZ_ASSERT(mOffset.isSome());
     return mOffset.value() == mParent->Length();
   }
 
   // Convenience methods for switching between the two types
@@ -698,17 +698,17 @@ public:
       return RawRangeBoundary(mParent, mOffset.value());
     }
     if (mIsChildInitialized && mOffset.isSome()) {
       // If we've already set both child and offset, we should create
       // RangeBoundary with offset after validation.
 #ifdef DEBUG
       if (mChild) {
         MOZ_ASSERT(mParent == mChild->GetParentNode());
-        MOZ_ASSERT(mParent->GetChildAt(mOffset.value()) == mChild);
+        MOZ_ASSERT(mParent->GetChildAt_Deprecated(mOffset.value()) == mChild);
       } else {
         MOZ_ASSERT(mParent->Length() == mOffset.value());
       }
 #endif // #ifdef DEBUG
       return RawRangeBoundary(mParent,  mOffset.value());
     }
     // Otherwise, we should create RangeBoundaryBase only with available
     // information.
@@ -733,17 +733,17 @@ private:
       return;
     }
     MOZ_ASSERT(mOffset.isSome());
     MOZ_ASSERT(mOffset.value() <= mParent->Length());
     mIsChildInitialized = true;
     if (!mParent->IsContainerNode()) {
       return;
     }
-    mChild = mParent->GetChildAt(mOffset.value());
+    mChild = mParent->GetChildAt_Deprecated(mOffset.value());
     MOZ_ASSERT(mChild || mOffset.value() == mParent->Length());
   }
 
   ParentType mParent;
   ChildType mChild;
 
   mozilla::Maybe<uint32_t> mOffset;
 
--- a/editor/libeditor/HTMLEditorDataTransfer.cpp
+++ b/editor/libeditor/HTMLEditorDataTransfer.cpp
@@ -417,17 +417,17 @@ HTMLEditor::DoInsertHTMLWithContext(cons
 
     // don't orphan partial list or table structure
     if (highWaterMark >= 0) {
       ReplaceOrphanedStructure(StartOrEnd::end, nodeList,
                                endListAndTableArray, highWaterMark);
     }
 
     MOZ_ASSERT(pointToInsert.GetContainer()->
-                               GetChildAt(pointToInsert.Offset()) ==
+                               GetChildAt_Deprecated(pointToInsert.Offset()) ==
                  pointToInsert.GetChild());
 
     // Loop over the node list and paste the nodes:
     nsCOMPtr<nsINode> parentBlock =
       IsBlockNode(pointToInsert.GetContainer()) ?
         pointToInsert.GetContainer() :
         GetBlockNodeParent(pointToInsert.GetContainer());
     nsCOMPtr<nsIContent> lastInsertNode;
--- a/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp
+++ b/extensions/spellcheck/src/mozInlineSpellWordUtil.cpp
@@ -128,17 +128,17 @@ FindNextNode(nsINode* aNode, nsINode* aR
 static nsINode*
 FindNextTextNode(nsINode* aNode, int32_t aOffset, nsINode* aRoot)
 {
   NS_PRECONDITION(aNode, "Null starting node?");
   NS_ASSERTION(!IsSpellCheckingTextNode(aNode), "FindNextTextNode should start with a non-text node");
 
   nsINode* checkNode;
   // Need to start at the aOffset'th child
-  nsIContent* child = aNode->GetChildAt(aOffset);
+  nsIContent* child = aNode->GetChildAt_Deprecated(aOffset);
 
   if (child) {
     checkNode = child;
   } else {
     // aOffset was beyond the end of the child list.
     // goto next node after the last descendant of aNode in
     // a preorder DOM traversal.
     checkNode = aNode->GetNextNonChildNode(aRoot);
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -7251,17 +7251,17 @@ nsCSSFrameConstructor::CreateNeededFrame
   // child lists).
 
   // Scan the children of aContent to see what operations (if any) we need to
   // perform.
   uint32_t childCount = aContent->GetChildCount();
   bool inRun = false;
   nsIContent* firstChildInRun = nullptr;
   for (uint32_t i = 0; i < childCount; i++) {
-    nsIContent* child = aContent->GetChildAt(i);
+    nsIContent* child = aContent->GetChildAt_Deprecated(i);
     if (child->HasFlag(NODE_NEEDS_FRAME)) {
       NS_ASSERTION(!child->GetPrimaryFrame() ||
                    child->GetPrimaryFrame()->GetContent() != child,
                    //XXX the child->GetPrimaryFrame()->GetContent() != child
                    // check is needed due to bug 135040. Remove it once that's
                    // fixed.
                    "NEEDS_FRAME set on a node that already has a frame?");
       if (!inRun) {
@@ -7715,18 +7715,18 @@ nsCSSFrameConstructor::ContentAppended(n
                               frameItems);
 
   for (nsIContent* child = aFirstNewContent;
        child;
        child = child->GetNextSibling()) {
     // Invalidate now instead of before the WipeContainingBlock call, just in
     // case we do wipe; in that case we don't need to do this walk at all.
     // XXXbz does that matter?  Would it make more sense to save some virtual
-    // GetChildAt calls instead and do this during construction of our
-    // FrameConstructionItemList?
+    // GetChildAt_Deprecated calls instead and do this during construction of
+    // our FrameConstructionItemList?
     InvalidateCanvasIfNeeded(mPresShell, child);
   }
 
   // If the container is a table and a caption was appended, it needs to be put
   // in the table wrapper frame's additional child list.
   nsFrameItems captionItems;
   if (LayoutFrameType::Table == frameType) {
     // Pull out the captions.  Note that we don't want to do that as we go,
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -1290,17 +1290,17 @@ void nsPresContext::SetImgAnimations(nsI
     nsCOMPtr<imgIRequest> imgReq;
     imgContent->GetRequest(nsIImageLoadingContent::CURRENT_REQUEST,
                            getter_AddRefs(imgReq));
     SetImgAnimModeOnImgReq(imgReq, aMode);
   }
 
   uint32_t count = aParent->GetChildCount();
   for (uint32_t i = 0; i < count; ++i) {
-    SetImgAnimations(aParent->GetChildAt(i), aMode);
+    SetImgAnimations(aParent->GetChildAt_Deprecated(i), aMode);
   }
 }
 
 void
 nsPresContext::SetSMILAnimations(nsIDocument *aDoc, uint16_t aNewMode,
                                  uint16_t aOldMode)
 {
   if (aDoc->HasAnimationController()) {
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -942,23 +942,23 @@ nsTextControlFrame::SelectAllOrCollapseT
 
   NS_ENSURE_TRUE(rootNode && rootContent, NS_ERROR_FAILURE);
 
   int32_t numChildren = rootContent->GetChildCount();
 
   if (numChildren > 0) {
     // We never want to place the selection after the last
     // br under the root node!
-    nsIContent *child = rootContent->GetChildAt(numChildren - 1);
+    nsIContent *child = rootContent->GetChildAt_Deprecated(numChildren - 1);
     if (child) {
       if (child->IsHTMLElement(nsGkAtoms::br))
         --numChildren;
     }
     if (!aSelect && numChildren) {
-      child = rootContent->GetChildAt(numChildren - 1);
+      child = rootContent->GetChildAt_Deprecated(numChildren - 1);
       if (child && child->IsNodeOfType(nsINode::eTEXT)) {
         rootNode = do_QueryInterface(child);
         const nsTextFragment* fragment = child->GetText();
         numChildren = fragment ? fragment->GetLength() : 0;
       }
     }
   }
 
@@ -1265,17 +1265,17 @@ nsTextControlFrame::UpdateValueDisplay(b
 {
   if (!IsSingleLineTextControl()) // textareas don't use this
     return NS_OK;
 
   NS_PRECONDITION(mRootNode, "Must have a div content\n");
   NS_PRECONDITION(!mEditorHasBeenInitialized,
                   "Do not call this after editor has been initialized");
 
-  nsIContent* textContent = mRootNode->GetChildAt(0);
+  nsIContent* textContent = mRootNode->GetChildAt_Deprecated(0);
   if (!textContent) {
     // Set up a textnode with our value
     RefPtr<nsTextNode> textNode =
       new nsTextNode(mContent->NodeInfo()->NodeInfoManager());
     textNode->MarkAsMaybeModifiedFrequently();
 
     mRootNode->AppendChildTo(textNode, aNotify);
     textContent = textNode;
--- a/layout/generic/nsFrameSelection.cpp
+++ b/layout/generic/nsFrameSelection.cpp
@@ -1634,17 +1634,17 @@ nsFrameSelection::GetFrameForNodeOffset(
             childIndex = 0;
           }
         } else {
           childIndex = aOffset;
         }
       }
 
       if (childIndex > 0 || numChildren > 0) {
-        nsCOMPtr<nsIContent> childNode = theNode->GetChildAt(childIndex);
+        nsCOMPtr<nsIContent> childNode = theNode->GetChildAt_Deprecated(childIndex);
 
         if (!childNode) {
           break;
         }
 
         theNode = childNode;
       }
 
@@ -1675,17 +1675,17 @@ nsFrameSelection::GetFrameForNodeOffset(
               *aReturnOffset = 0;
             }
           } else {
             int32_t numChildren = aNode->GetChildCount();
             int32_t newChildIndex =
               aHint == CARET_ASSOCIATE_BEFORE ? childIndex - 1 : childIndex + 1;
 
             if (newChildIndex >= 0 && newChildIndex < numChildren) {
-              nsCOMPtr<nsIContent> newChildNode = aNode->GetChildAt(newChildIndex);
+              nsCOMPtr<nsIContent> newChildNode = aNode->GetChildAt_Deprecated(newChildIndex);
               if (!newChildNode) {
                 return nullptr;
               }
 
               aNode = newChildNode;
               aOffset = aHint == CARET_ASSOCIATE_BEFORE ? aNode->GetChildCount() : 0;
               continue;
             } else {
@@ -2060,17 +2060,17 @@ GetFirstSelectedContent(nsRange* aRange)
   if (!aRange) {
     return nullptr;
   }
 
   NS_PRECONDITION(aRange->GetStartContainer(), "Must have start parent!");
   NS_PRECONDITION(aRange->GetStartContainer()->IsElement(),
                   "Unexpected parent");
 
-  return aRange->GetStartContainer()->GetChildAt(aRange->StartOffset());
+  return aRange->GetStartContainer()->GetChildAt_Deprecated(aRange->StartOffset());
 }
 
 // Table selection support.
 // TODO: Separate table methods into a separate nsITableSelection interface
 nsresult
 nsFrameSelection::HandleTableSelection(nsINode* aParentContent,
                                        int32_t aContentOffset,
                                        int32_t aTarget,
@@ -2083,17 +2083,17 @@ nsFrameSelection::HandleTableSelection(n
   {
     // We were selecting cells and user drags mouse in table border or inbetween cells,
     //  just do nothing
       return NS_OK;
   }
 
   nsresult result = NS_OK;
 
-  nsIContent *childContent = aParentContent->GetChildAt(aContentOffset);
+  nsIContent *childContent = aParentContent->GetChildAt_Deprecated(aContentOffset);
 
   // When doing table selection, always set the direction to next so
   // we can be sure that anchorNode's offset always points to the
   // selected cell
   int8_t index = GetIndexFromSelectionType(SelectionType::eNormal);
   if (!mDomSelections[index])
     return NS_ERROR_NULL_POINTER;
 
@@ -2345,17 +2345,17 @@ printf("HandleTableSelection: Unselectin
 
           nsINode* container = range->GetStartContainer();
           if (!container) {
             return NS_ERROR_NULL_POINTER;
           }
 
           int32_t offset = range->StartOffset();
           // Be sure previous selection is a table cell
-          nsIContent* child = container->GetChildAt(offset);
+          nsIContent* child = container->GetChildAt_Deprecated(offset);
           if (child && IsCell(child)) {
             previousCellParent = container;
           }
 
           // We're done if we didn't find parent of a previously-selected cell
           if (!previousCellParent) break;
 
           if (previousCellParent == aParentContent && offset == aContentOffset)
@@ -2697,17 +2697,17 @@ nsFrameSelection::GetFirstCellNodeInRang
 
   nsINode* startContainer = aRange->GetStartContainer();
   if (!startContainer) {
     return nullptr;
   }
 
   int32_t offset = aRange->StartOffset();
 
-  nsIContent* childContent = startContainer->GetChildAt(offset);
+  nsIContent* childContent = startContainer->GetChildAt_Deprecated(offset);
   if (!childContent)
     return nullptr;
   // Don't return node if not a cell
   if (!IsCell(childContent))
     return nullptr;
 
   return childContent;
 }
--- a/layout/printing/nsPrintJob.cpp
+++ b/layout/printing/nsPrintJob.cpp
@@ -2477,17 +2477,17 @@ GetCorrespondingNodeInDocument(const nsI
     MOZ_ASSERT(index >= 0);
     indexArray.AppendElement(index);
     child = parent;
   }
   MOZ_ASSERT(child->IsNodeOfType(nsINode::eDOCUMENT));
 
   nsINode* correspondingNode = aDoc;
   for (int32_t i = indexArray.Length() - 1; i >= 0; --i) {
-    correspondingNode = correspondingNode->GetChildAt(indexArray[i]);
+    correspondingNode = correspondingNode->GetChildAt_Deprecated(indexArray[i]);
     NS_ENSURE_TRUE(correspondingNode, nullptr);
   }
 
   return correspondingNode;
 }
 
 static NS_NAMED_LITERAL_STRING(kEllipsis, u"\x2026");
 
--- a/layout/style/nsCSSRuleProcessor.cpp
+++ b/layout/style/nsCSSRuleProcessor.cpp
@@ -1353,17 +1353,17 @@ checkGenericEmptyMatches(Element* aEleme
 {
   nsIContent *child = nullptr;
   int32_t index = -1;
 
   if (aTreeMatchContext.mForStyling)
     aElement->SetFlags(NODE_HAS_EMPTY_SELECTOR);
 
   do {
-    child = aElement->GetChildAt(++index);
+    child = aElement->GetChildAt_Deprecated(++index);
     // stop at first non-comment (and non-whitespace for
     // :-moz-only-whitespace) node
   } while (child && !IsSignificantChild(child, true, isWhitespaceSignificant));
   return (child == nullptr);
 }
 
 static const EventStates sPseudoClassStates[] = {
 #define CSS_PSEUDO_CLASS(_name, _value, _flags, _pref) \
@@ -1627,17 +1627,17 @@ static bool SelectorMatches(Element* aEl
         nsIContent *firstNode = nullptr;
         nsIContent *parent = aElement->GetParent();
         if (parent) {
           if (aTreeMatchContext.mForStyling)
             parent->SetFlags(NODE_HAS_EDGE_CHILD_SELECTOR);
 
           int32_t index = -1;
           do {
-            firstNode = parent->GetChildAt(++index);
+            firstNode = parent->GetChildAt_Deprecated(++index);
             // stop at first non-comment and non-whitespace node
           } while (firstNode &&
                     !IsSignificantChild(firstNode, true, false));
         }
         if (aElement != firstNode) {
           return false;
         }
       }
@@ -1654,17 +1654,17 @@ static bool SelectorMatches(Element* aEl
         nsIContent *lastNode = nullptr;
         nsIContent *parent = aElement->GetParent();
         if (parent) {
           if (aTreeMatchContext.mForStyling)
             parent->SetFlags(NODE_HAS_EDGE_CHILD_SELECTOR);
 
           uint32_t index = parent->GetChildCount();
           do {
-            lastNode = parent->GetChildAt(--index);
+            lastNode = parent->GetChildAt_Deprecated(--index);
             // stop at first non-comment and non-whitespace node
           } while (lastNode &&
                     !IsSignificantChild(lastNode, true, false));
         }
         if (aElement != lastNode) {
           return false;
         }
       }
--- a/layout/xul/nsListBoxBodyFrame.cpp
+++ b/layout/xul/nsListBoxBodyFrame.cpp
@@ -732,17 +732,17 @@ nsListBoxBodyFrame::ComputeIntrinsicISiz
     FlattenedChildIterator iter(mContent);
     for (nsIContent* child = iter.GetNextChild(); child; child = iter.GetNextChild()) {
       if (child->IsXULElement(nsGkAtoms::listitem)) {
         gfxContext* rendContext = aBoxLayoutState.GetRenderingContext();
         if (rendContext) {
           nsAutoString value;
           uint32_t textCount = child->GetChildCount();
           for (uint32_t j = 0; j < textCount; ++j) {
-            nsIContent* text = child->GetChildAt(j);
+            nsIContent* text = child->GetChildAt_Deprecated(j);
             if (text && text->IsNodeOfType(nsINode::eTEXT)) {
               text->AppendTextTo(value);
             }
           }
 
           RefPtr<nsFontMetrics> fm =
             nsLayoutUtils::GetFontMetricsForStyleContext(styleContext);
 
@@ -1166,17 +1166,17 @@ nsListBoxBodyFrame::GetFirstItemBox(int3
   if (mTopFrame && mRowsToPrepend > 0) {
     // We need to insert rows before the top frame
     nsIContent* topContent = mTopFrame->GetContent();
     nsIContent* topParent = topContent->GetParent();
     int32_t contentIndex = topParent->IndexOf(topContent);
     contentIndex -= aOffset;
     if (contentIndex < 0)
       return nullptr;
-    startContent = topParent->GetChildAt(contentIndex - mRowsToPrepend);
+    startContent = topParent->GetChildAt_Deprecated(contentIndex - mRowsToPrepend);
   } else {
     // This will be the first item frame we create.  Use the content
     // at the current index, which is the first index scrolled into view
     GetListItemContentAt(mCurrentIndex+aOffset, getter_AddRefs(startContent));
   }
 
   if (startContent) {
     nsIFrame* existingFrame;
@@ -1229,17 +1229,17 @@ nsListBoxBodyFrame::GetNextItemBox(nsIFr
     nsIContent* prevContent = aBox->GetContent();
     nsIContent* parentContent = prevContent->GetParent();
 
     int32_t i = parentContent->IndexOf(prevContent);
 
     uint32_t childCount = parentContent->GetChildCount();
     if (((uint32_t)i + aOffset + 1) < childCount) {
       // There is a content node that wants a frame.
-      nsIContent *nextContent = parentContent->GetChildAt(i + aOffset + 1);
+      nsIContent *nextContent = parentContent->GetChildAt_Deprecated(i + aOffset + 1);
 
       nsIFrame* existingFrame;
       if (!IsListItemChild(this, nextContent, &existingFrame)) {
         return GetNextItemBox(aBox, ++aOffset, aCreated);
       }
       if (!existingFrame) {
         // Either append the new frame, or insert it after the current frame
         bool isAppend = result != mLinkupFrame && mRowsToPrepend <= 0;
--- a/layout/xul/nsXULTooltipListener.cpp
+++ b/layout/xul/nsXULTooltipListener.cpp
@@ -552,17 +552,17 @@ nsXULTooltipListener::HideTooltip()
 }
 
 static void
 GetImmediateChild(nsIContent* aContent, nsAtom *aTag, nsIContent** aResult)
 {
   *aResult = nullptr;
   uint32_t childCount = aContent->GetChildCount();
   for (uint32_t i = 0; i < childCount; i++) {
-    nsIContent *child = aContent->GetChildAt(i);
+    nsIContent *child = aContent->GetChildAt_Deprecated(i);
 
     if (child->IsXULElement(aTag)) {
       *aResult = child;
       NS_ADDREF(*aResult);
       return;
     }
   }
 }
--- a/layout/xul/tree/nsTreeColumns.cpp
+++ b/layout/xul/tree/nsTreeColumns.cpp
@@ -683,17 +683,17 @@ nsTreeColumns::RestoreNaturalOrder()
 
   // Strong ref, since we'll be setting attributes
   nsCOMPtr<nsIContent> colsContent =
     nsTreeUtils::GetImmediateChild(content, nsGkAtoms::treecols);
   if (!colsContent)
     return NS_OK;
 
   for (uint32_t i = 0; i < colsContent->GetChildCount(); ++i) {
-    nsCOMPtr<nsIContent> child = colsContent->GetChildAt(i);
+    nsCOMPtr<nsIContent> child = colsContent->GetChildAt_Deprecated(i);
     nsAutoString ordinal;
     ordinal.AppendInt(i);
     if (child->IsElement()) {
       child->AsElement()->SetAttr(kNameSpaceID_None, nsGkAtoms::ordinal, ordinal,
                                   true);
     }
   }
 
--- a/layout/xul/tree/nsTreeContentView.cpp
+++ b/layout/xul/tree/nsTreeContentView.cpp
@@ -1332,17 +1332,17 @@ nsTreeContentView::GetIndexInSubtree(nsI
                                      nsIContent* aContent, int32_t* aIndex)
 {
   uint32_t childCount = aContainer->GetChildCount();
 
   if (!aContainer->IsXULElement())
     return;
 
   for (uint32_t i = 0; i < childCount; i++) {
-    nsIContent *content = aContainer->GetChildAt(i);
+    nsIContent *content = aContainer->GetChildAt_Deprecated(i);
 
     if (content == aContent)
       break;
 
     if (content->IsXULElement(nsGkAtoms::treeitem)) {
       if (!content->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::hidden,
                                              nsGkAtoms::_true, eCaseMatters)) {
         (*aIndex)++;
--- a/layout/xul/tree/nsTreeUtils.cpp
+++ b/layout/xul/tree/nsTreeUtils.cpp
@@ -91,17 +91,17 @@ nsTreeUtils::UpdateSortIndicators(Elemen
 
   // Unset sort attribute(s) on the other columns
   nsCOMPtr<nsIContent> parentContent = aColumn->GetParent();
   if (parentContent &&
       parentContent->NodeInfo()->Equals(nsGkAtoms::treecols,
                                         kNameSpaceID_XUL)) {
     uint32_t i, numChildren = parentContent->GetChildCount();
     for (i = 0; i < numChildren; ++i) {
-      nsCOMPtr<nsIContent> childContent = parentContent->GetChildAt(i);
+      nsCOMPtr<nsIContent> childContent = parentContent->GetChildAt_Deprecated(i);
 
       if (childContent &&
           childContent != aColumn &&
           childContent->NodeInfo()->Equals(nsGkAtoms::treecol,
                                            kNameSpaceID_XUL)) {
         childContent->AsElement()->UnsetAttr(kNameSpaceID_None,
                                              nsGkAtoms::sortDirection, true);
         childContent->AsElement()->UnsetAttr(kNameSpaceID_None,
@@ -118,17 +118,17 @@ nsTreeUtils::GetColumnIndex(Element* aCo
 {
   nsIContent* parentContent = aColumn->GetParent();
   if (parentContent &&
       parentContent->NodeInfo()->Equals(nsGkAtoms::treecols,
                                         kNameSpaceID_XUL)) {
     uint32_t i, numChildren = parentContent->GetChildCount();
     int32_t colIndex = 0;
     for (i = 0; i < numChildren; ++i) {
-      nsIContent* childContent = parentContent->GetChildAt(i);
+      nsIContent* childContent = parentContent->GetChildAt_Deprecated(i);
       if (childContent &&
           childContent->NodeInfo()->Equals(nsGkAtoms::treecol,
                                            kNameSpaceID_XUL)) {
         if (childContent == aColumn) {
           *aResult = colIndex;
           return NS_OK;
         }
         ++colIndex;
--- a/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
+++ b/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
@@ -892,17 +892,17 @@ nsTypeAheadFind::RangeStartsInsideLink(n
   startContent = do_QueryInterface(startNode);
   if (!startContent) {
     NS_NOTREACHED("startContent should never be null");
     return;
   }
   origContent = startContent;
 
   if (startContent->IsElement()) {
-    nsIContent *childContent = startContent->GetChildAt(startOffset);
+    nsIContent *childContent = startContent->GetChildAt_Deprecated(startOffset);
     if (childContent) {
       startContent = childContent;
     }
   }
   else if (startOffset > 0) {
     const nsTextFragment *textFrag = startContent->GetText();
     if (textFrag) {
       // look for non whitespace character before start offset
--- a/widget/cocoa/nsMenuBarX.mm
+++ b/widget/cocoa/nsMenuBarX.mm
@@ -160,17 +160,17 @@ nsresult nsMenuBarX::Create(nsIWidget* a
 
   return NS_OK;
 }
 
 void nsMenuBarX::ConstructNativeMenus()
 {
   uint32_t count = mContent->GetChildCount();
   for (uint32_t i = 0; i < count; i++) {
-    nsIContent *menuContent = mContent->GetChildAt(i);
+    nsIContent *menuContent = mContent->GetChildAt_Deprecated(i);
     if (menuContent &&
         menuContent->IsXULElement(nsGkAtoms::menu)) {
       nsMenuX* newMenu = new nsMenuX();
       if (newMenu) {
         nsresult rv = newMenu->Create(this, this, menuContent->AsElement());
         if (NS_SUCCEEDED(rv))
           InsertMenuAtIndex(newMenu, GetMenuCount());
         else
--- a/widget/cocoa/nsMenuItemX.mm
+++ b/widget/cocoa/nsMenuItemX.mm
@@ -219,17 +219,17 @@ void nsMenuItemX::UncheckRadioSiblings(n
 
   nsCOMPtr<nsIContent> parent = inCheckedContent->GetParent();
   if (!parent)
     return;
 
   // loop over siblings
   uint32_t count = parent->GetChildCount();
   for (uint32_t i = 0; i < count; i++) {
-    nsIContent *sibling = parent->GetChildAt(i);
+    nsIContent *sibling = parent->GetChildAt_Deprecated(i);
     if (sibling &&
         sibling != inCheckedContent &&
         sibling->IsElement()) { // skip this node
       // if the current sibling is in the same group, clear it
       if (sibling->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::name,
                                             myGroupName, eCaseMatters)) {
         sibling->AsElement()->SetAttr(kNameSpaceID_None, nsGkAtoms::checked, NS_LITERAL_STRING("false"), true);
       }
--- a/widget/cocoa/nsMenuX.mm
+++ b/widget/cocoa/nsMenuX.mm
@@ -435,17 +435,17 @@ void nsMenuX::MenuConstruct()
         mXBLAttached = true;
       }
     }
   }
 
   // Iterate over the kids
   uint32_t count = menuPopup->GetChildCount();
   for (uint32_t i = 0; i < count; i++) {
-    nsIContent *child = menuPopup->GetChildAt(i);
+    nsIContent *child = menuPopup->GetChildAt_Deprecated(i);
     if (child) {
       // depending on the type, create a menu item, separator, or submenu
       if (child->IsAnyOfXULElements(nsGkAtoms::menuitem,
                                     nsGkAtoms::menuseparator)) {
         LoadMenuItem(child);
       } else if (child->IsXULElement(nsGkAtoms::menu)) {
         LoadSubMenu(child);
       }
@@ -653,17 +653,17 @@ void nsMenuX::GetMenuPopupContent(nsICon
   }
 
   // Otherwise check our child nodes.
 
   uint32_t count = mContent->GetChildCount();
 
   for (uint32_t i = 0; i < count; i++) {
     int32_t dummy;
-    nsIContent *child = mContent->GetChildAt(i);
+    nsIContent *child = mContent->GetChildAt_Deprecated(i);
     RefPtr<nsAtom> tag = child->OwnerDoc()->BindingManager()->ResolveTag(child, &dummy);
     if (tag == nsGkAtoms::menupopup) {
       *aResult = child;
       NS_ADDREF(*aResult);
       return;
     }
   }
 }