Bug 1425440 - Get rid of GetChildAt_Deprecated in txMozillaXMLOutput, r=catalinb
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 03 Jan 2018 16:29:59 +0100
changeset 449388 a52d6d2099335faeb0e3639ac8979c205ef57fba
parent 449387 5ac1716f22f0610dce34c01e9bd158f794d61e68
child 449389 074809c8e26631af5f37372c4c14a15f846acf6b
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 txMozillaXMLOutput, r=catalinb
dom/xslt/xslt/txMozillaXMLOutput.cpp
--- a/dom/xslt/xslt/txMozillaXMLOutput.cpp
+++ b/dom/xslt/xslt/txMozillaXMLOutput.cpp
@@ -620,25 +620,24 @@ txMozillaXMLOutput::createTxWrapper()
     nsresult rv = nsContentUtils::NameSpaceManager()->
         RegisterNameSpace(NS_LITERAL_STRING(kTXNameSpaceURI), namespaceID);
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<Element> wrapper =
       mDocument->CreateElem(nsDependentAtomString(nsGkAtoms::result),
                             nsGkAtoms::transformiix, namespaceID);
 
-    uint32_t i, j, childCount = mDocument->GetChildCount();
+    uint32_t j = 0;
 #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_Deprecated(j);
-
+    for (nsCOMPtr<nsIContent> childContent = mDocument->GetFirstChild();
+         childContent; childContent = childContent->GetNextSibling()) {
 #ifdef DEBUG
         if (childContent->IsElement()) {
             rootLocation = j;
         }
 #endif
 
         if (childContent->NodeInfo()->NameAtom() == nsGkAtoms::documentTypeNodeName) {
 #ifdef DEBUG