Bug 1226875 - Remove nsIFrame::GetLastChild(). r=mats
authorTing-Yu Lin <tlin@mozilla.com>
Thu, 26 Nov 2015 17:12:39 +0800
changeset 274244 298051dbb67c18d7f3d338e8c9ed694f9ae2996e
parent 274243 ad83a815314e76ccad3ded95f271643d8975088a
child 274245 e2d0fd2b8d177b3ede37702a2d22ce7cb33f336a
push id68528
push usertlin@mozilla.com
push dateThu, 26 Nov 2015 09:15:56 +0000
treeherdermozilla-inbound@298051dbb67c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1226875
milestone45.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 1226875 - Remove nsIFrame::GetLastChild(). r=mats
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsLayoutUtils.cpp
layout/generic/nsFrame.cpp
layout/generic/nsIFrame.h
layout/mathml/nsMathMLmfencedFrame.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -6018,17 +6018,17 @@ AdjustAppendParentForAfterContent(nsFram
     nsIFrame* afterFrame = nullptr;
     nsContainerFrame* parent =
       static_cast<nsContainerFrame*>(aParentFrame->LastContinuation());
     bool done = false;
     while (!done && parent) {
       // Ensure that all normal flow children are on the principal child list.
       parent->DrainSelfOverflowList();
 
-      nsIFrame* child = parent->GetLastChild(nsIFrame::kPrincipalList);
+      nsIFrame* child = parent->GetChildList(nsIFrame::kPrincipalList).LastChild();
       if (child && child->IsPseudoFrame(aContainer) &&
           !child->IsGeneratedContentFrame()) {
         // Drill down into non-generated pseudo frames of aContainer.
         nsContainerFrame* childAsContainer = do_QueryFrame(child);
         if (childAsContainer) {
           parent = nsLayoutUtils::LastContinuationWithChild(childAsContainer);
           continue;
         }
@@ -6111,17 +6111,17 @@ FindAppendPrevSibling(nsIFrame* aParentF
     NS_ASSERTION(aAfterFrame->GetPrevSibling() ||
                  aParentFrame->GetFirstPrincipalChild() == aAfterFrame,
                  ":after frame must be on the principal child list here");
     return aAfterFrame->GetPrevSibling();
   }
 
   aParentFrame->DrainSelfOverflowList();
 
-  return aParentFrame->GetLastChild(kPrincipalList);
+  return aParentFrame->GetChildList(kPrincipalList).LastChild();
 }
 
 /**
  * This function will get the next sibling for a frame insert operation given
  * the parent and previous sibling.  aPrevSibling may be null.
  */
 static nsIFrame*
 GetInsertNextSibling(nsIFrame* aParentFrame, nsIFrame* aPrevSibling)
@@ -11927,17 +11927,17 @@ nsCSSFrameConstructor::WipeContainingBlo
         if (iter == start) {
           // Leading whitespace.  How to handle this depends on our
           // previous sibling and aFrame.  See the long comment above.
           nsIFrame* prevSibling = aPrevSibling;
           if (!prevSibling) {
             // Try to find one after all
             nsIFrame* parentPrevCont = aFrame->GetPrevContinuation();
             while (parentPrevCont) {
-              prevSibling = parentPrevCont->GetLastChild(kPrincipalList);
+              prevSibling = parentPrevCont->GetChildList(kPrincipalList).LastChild();
               if (prevSibling) {
                 break;
               }
               parentPrevCont = parentPrevCont->GetPrevContinuation();
             }
           };
           if (prevSibling) {
             if (IsTablePseudo(prevSibling)) {
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -1427,17 +1427,17 @@ nsLayoutUtils::GetAfterFrameForContent(n
   genConParentFrame = aFrame->GetContentInsertionFrame();
   if (!genConParentFrame) {
     return nullptr;
   }
   nsIFrame* lastParentContinuation =
     LastContinuationWithChild(static_cast<nsContainerFrame*>(
       LastContinuationOrIBSplitSibling(genConParentFrame)));
   nsIFrame* childFrame =
-    lastParentContinuation->GetLastChild(nsIFrame::kPrincipalList);
+    lastParentContinuation->GetChildList(nsIFrame::kPrincipalList).LastChild();
   if (childFrame &&
       childFrame->IsPseudoFrame(aContent) &&
       !childFrame->IsGeneratedContentFrame()) {
     return GetAfterFrameForContent(childFrame->FirstContinuation(), aContent);
   }
   return nullptr;
 }
 
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -6552,17 +6552,17 @@ FindBlockFrameOrBR(nsIFrame* aFrame, nsD
     aFrame->GetOffsets(startOffset, endOffset);
     result.mContent = aFrame->GetContent();
     result.mOffset = endOffset - (aDirection == eDirPrevious ? 0 : 1);
     return result;
   }
 
   // Iterate over children and call ourselves recursively
   if (aDirection == eDirPrevious) {
-    nsIFrame* child = aFrame->GetLastChild(nsIFrame::kPrincipalList);
+    nsIFrame* child = aFrame->GetChildList(nsIFrame::kPrincipalList).LastChild();
     while(child && !result.mContent) {
       result = FindBlockFrameOrBR(child, aDirection);
       child = child->GetPrevSibling();
     }
   } else { // eDirNext
     nsIFrame* child = aFrame->GetFirstPrincipalChild();
     while(child && !result.mContent) {
       result = FindBlockFrameOrBR(child, aDirection);
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -1062,20 +1062,16 @@ public:
   virtual void GetChildLists(nsTArray<ChildList>* aLists) const = 0;
 
   /**
    * Gets the child lists for this frame, including
    * ones belong to a child document.
    */
   void GetCrossDocChildLists(nsTArray<ChildList>* aLists);
 
-  // XXXmats this method should also go away then
-  nsIFrame* GetLastChild(ChildListID aListID) const {
-    return GetChildList(aListID).LastChild();
-  }
   nsIFrame* GetFirstPrincipalChild() const {
     return GetChildList(kPrincipalList).FirstChild();
   }
 
   // The individual concrete child lists.
   static const ChildListID kPrincipalList = mozilla::layout::kPrincipalList;
   static const ChildListID kAbsoluteList = mozilla::layout::kAbsoluteList;
   static const ChildListID kBulletList = mozilla::layout::kBulletList;
--- a/layout/mathml/nsMathMLmfencedFrame.cpp
+++ b/layout/mathml/nsMathMLmfencedFrame.cpp
@@ -386,17 +386,17 @@ nsMathMLmfencedFrame::Reflow(nsPresConte
 
   if (leftChar) {
     PlaceChar(leftChar, ascent, bm, dx);
     aDesiredSize.mBoundingMetrics = bm;
     firstTime = false;
   }
 
   if (isRTL) {
-    childFrame = this->GetLastChild(nsIFrame::kPrincipalList);
+    childFrame = this->GetChildList(nsIFrame::kPrincipalList).LastChild();
   } else {
     childFrame = firstChild;
   }
   while (childFrame) {
     nsHTMLReflowMetrics childSize(aReflowState);
     GetReflowAndBoundingMetricsFor(childFrame, childSize, bm);
     if (firstTime) {
       firstTime = false;