Bug 508665 - part 7, Require a nsContainerFrame* for aParent in nsFrameManager methods. r=roc
authorMats Palmgren <matspal@gmail.com>
Sat, 24 May 2014 22:20:40 +0000
changeset 184831 6c8a275251b69c2a35411f6802581ede2b5eb11d
parent 184830 a86816c839412bd837c298699d1456e3dd8aea5e
child 184832 c22a627d243b5750e7bbf29d31bed4ad562b7130
push id43946
push usermpalmgren@mozilla.com
push dateSat, 24 May 2014 22:20:59 +0000
treeherdermozilla-inbound@db861719b5d0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs508665
milestone32.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 508665 - part 7, Require a nsContainerFrame* for aParent in nsFrameManager methods. r=roc
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsFrameManager.cpp
layout/base/nsFrameManager.h
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -1249,17 +1249,17 @@ nsFrameConstructorState::ProcessFrameIns
   NS_PRECONDITION(NS_NONXUL_LIST_TEST,
                   "Unexpected aFrameItems/aChildListID combination");
 #endif
 
   if (aFrameItems.IsEmpty()) {
     return;
   }
 
-  nsIFrame* containingBlock = aFrameItems.containingBlock;
+  nsContainerFrame* containingBlock = aFrameItems.containingBlock;
 
   NS_ASSERTION(containingBlock,
                "Child list without containing block?");
 
   if (aChildListID == nsIFrame::kFixedList) {
     // Put this frame on the transformed-frame's abs-pos list instead, if
     // it has abs-pos children instead of fixed-pos children.
     aChildListID = containingBlock->GetAbsoluteListID();
--- a/layout/base/nsFrameManager.cpp
+++ b/layout/base/nsFrameManager.cpp
@@ -344,34 +344,34 @@ nsFrameManager::ClearAllUndisplayedConte
     if (child->GetParent() != aParentContent) {
       ClearUndisplayedContentIn(child, child->GetParent());
     }
   }
 }
 
 //----------------------------------------------------------------------
 nsresult
-nsFrameManager::AppendFrames(nsIFrame*       aParentFrame,
-                             ChildListID     aListID,
-                             nsFrameList&    aFrameList)
+nsFrameManager::AppendFrames(nsContainerFrame* aParentFrame,
+                             ChildListID       aListID,
+                             nsFrameList&      aFrameList)
 {
   if (aParentFrame->IsAbsoluteContainer() &&
       aListID == aParentFrame->GetAbsoluteListID()) {
     return aParentFrame->GetAbsoluteContainingBlock()->
            AppendFrames(aParentFrame, aListID, aFrameList);
   } else {
     return aParentFrame->AppendFrames(aListID, aFrameList);
   }
 }
 
 nsresult
-nsFrameManager::InsertFrames(nsIFrame*       aParentFrame,
-                             ChildListID     aListID,
-                             nsIFrame*       aPrevFrame,
-                             nsFrameList&    aFrameList)
+nsFrameManager::InsertFrames(nsContainerFrame* aParentFrame,
+                             ChildListID       aListID,
+                             nsIFrame*         aPrevFrame,
+                             nsFrameList&      aFrameList)
 {
   NS_PRECONDITION(!aPrevFrame || (!aPrevFrame->GetNextContinuation()
                   || (((aPrevFrame->GetNextContinuation()->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER))
                   && !(aPrevFrame->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER))),
                   "aPrevFrame must be the last continuation in its chain!");
 
   if (aParentFrame->IsAbsoluteContainer() &&
       aListID == aParentFrame->GetAbsoluteListID()) {
@@ -400,17 +400,17 @@ nsFrameManager::RemoveFrame(ChildListID 
   NS_ASSERTION(!aOldFrame->GetPrevContinuation() ||
                // exception for nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames
                aOldFrame->GetType() == nsGkAtoms::textFrame,
                "Must remove first continuation.");
   NS_ASSERTION(!(aOldFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW &&
                  GetPlaceholderFrameFor(aOldFrame)),
                "Must call RemoveFrame on placeholder for out-of-flows.");
   nsresult rv = NS_OK;
-  nsIFrame* parentFrame = aOldFrame->GetParent();
+  nsContainerFrame* parentFrame = aOldFrame->GetParent();
   if (parentFrame->IsAbsoluteContainer() &&
       aListID == parentFrame->GetAbsoluteListID()) {
     parentFrame->GetAbsoluteContainingBlock()->
       RemoveFrame(parentFrame, aListID, aOldFrame);
   } else {
     rv = parentFrame->RemoveFrame(aListID, aOldFrame);
   }
 
--- a/layout/base/nsFrameManager.h
+++ b/layout/base/nsFrameManager.h
@@ -18,16 +18,18 @@
 
 #ifndef _nsFrameManager_h_
 #define _nsFrameManager_h_
 
 #include "nsIFrame.h"
 #include "nsFrameManagerBase.h"
 #include "nsIContent.h"
 
+class nsContainerFrame;
+
 namespace mozilla {
 /**
  * Node in a linked list, containing the style for an element that
  * does not have a frame but whose parent does have a frame.
  */
 struct UndisplayedNode {
   UndisplayedNode(nsIContent* aContent, nsStyleContext* aStyle)
     : mContent(aContent),
@@ -107,24 +109,24 @@ public:
                                          nsStyleContext* aStyleContext);
   NS_HIDDEN_(void) ChangeUndisplayedContent(nsIContent* aContent,
                                             nsStyleContext* aStyleContext);
   NS_HIDDEN_(void) ClearUndisplayedContentIn(nsIContent* aContent,
                                              nsIContent* aParentContent);
   NS_HIDDEN_(void) ClearAllUndisplayedContentIn(nsIContent* aParentContent);
 
   // Functions for manipulating the frame model
-  NS_HIDDEN_(nsresult) AppendFrames(nsIFrame*       aParentFrame,
-                                    ChildListID     aListID,
-                                    nsFrameList&    aFrameList);
+  NS_HIDDEN_(nsresult) AppendFrames(nsContainerFrame* aParentFrame,
+                                    ChildListID       aListID,
+                                    nsFrameList&      aFrameList);
 
-  NS_HIDDEN_(nsresult) InsertFrames(nsIFrame*       aParentFrame,
-                                    ChildListID     aListID,
-                                    nsIFrame*       aPrevFrame,
-                                    nsFrameList&    aFrameList);
+  NS_HIDDEN_(nsresult) InsertFrames(nsContainerFrame* aParentFrame,
+                                    ChildListID       aListID,
+                                    nsIFrame*         aPrevFrame,
+                                    nsFrameList&      aFrameList);
 
   NS_HIDDEN_(nsresult) RemoveFrame(ChildListID     aListID,
                                    nsIFrame*       aOldFrame);
 
   /*
    * Notification that a frame is about to be destroyed. This allows any
    * outstanding references to the frame to be cleaned up.
    */