Bug 1425440 - Get rid of GetChildAt_Deprecated in nsTreeContentView, r=catalinb
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 03 Jan 2018 16:28:37 +0100
changeset 449383 9f8bb5d303fa4cf92fd4a14cbcb72e2928762522
parent 449382 ad03ffad73fe90c83089cfe5e14e782ebe8297da
child 449384 8817148653e9ba43697765b20e6d8488872e9a34
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscatalinb
bugs1425440
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 1425440 - Get rid of GetChildAt_Deprecated in nsTreeContentView, r=catalinb
layout/xul/tree/nsTreeContentView.cpp
--- a/layout/xul/tree/nsTreeContentView.cpp
+++ b/layout/xul/tree/nsTreeContentView.cpp
@@ -1326,23 +1326,21 @@ nsTreeContentView::SerializeSeparator(El
   row->SetSeparator(true);
   aRows.AppendElement(Move(row));
 }
 
 void
 nsTreeContentView::GetIndexInSubtree(nsIContent* aContainer,
                                      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_Deprecated(i);
+  for (nsIContent* content = aContainer->GetFirstChild();
+       content; content = content->GetNextSibling()) {
 
     if (content == aContent)
       break;
 
     if (content->IsXULElement(nsGkAtoms::treeitem)) {
       if (!content->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::hidden,
                                              nsGkAtoms::_true, eCaseMatters)) {
         (*aIndex)++;