Bug 1425440 - Get rid of GetChildAt_Deprecated in nsCSSFrameConstructor, r=catalinb
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 03 Jan 2018 16:30:15 +0100
changeset 449389 074809c8e26631af5f37372c4c14a15f846acf6b
parent 449388 a52d6d2099335faeb0e3639ac8979c205ef57fba
child 449390 3c5811b083f9d3c4f6a45a17e5d676e9db522551
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 nsCSSFrameConstructor, r=catalinb
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -7247,21 +7247,20 @@ nsCSSFrameConstructor::CreateNeededFrame
 
   // It might be better to use GetChildArray and scan it completely first and
   // then issue all notifications. (We have to scan it completely first because
   // constructing frames can set attributes, which can change the storage of
   // 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_Deprecated(i);
+  for (nsIContent* child = aContent->GetFirstChild();
+       child; child = child->GetNextSibling()) {
     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) {