Bug 653649 - New way of getting child lists from frames. (part 5/5) r=roc
authorMats Palmgren <matspal@gmail.com>
Wed, 24 Aug 2011 22:54:30 +0200
changeset 75844 427a6b2313db302c4c2d5c726aeddfd9c05b66ba
parent 75843 d9797d99f5f739ebd244ce27748a548f4b3b9cfd
child 75845 e58e98a89827d0aa29ebf648312de26f2f98073d
child 75849 b1cab441835f70d24ac0c78bde4d24070178971f
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersroc
bugs653649
milestone9.0a1
Bug 653649 - New way of getting child lists from frames. (part 5/5) r=roc Add a kPrincipalList alias in nsCSSFrameConstructor.cpp to avoid the nsIFrame:: prefix in numerous places.
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -146,16 +146,19 @@
 #include "nsSVGOuterSVGFrame.h"
 
 #include "nsRefreshDriver.h"
 #include "nsRuleProcessorData.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
+// An alias for convenience.
+static const nsIFrame::ChildListID kPrincipalList = nsIFrame::kPrincipalList;
+
 nsIFrame*
 NS_NewHTMLCanvasFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 
 #if defined(MOZ_MEDIA)
 nsIFrame*
 NS_NewHTMLVideoFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
 #endif
 
@@ -576,34 +579,34 @@ FindFirstNonBlock(const nsFrameList& aLi
   return link;
 }
 
 inline void
 SetInitialSingleChild(nsIFrame* aParent, nsIFrame* aFrame)
 {
   NS_PRECONDITION(!aFrame->GetNextSibling(), "Should be using a frame list");
   nsFrameList temp(aFrame, aFrame);
-  aParent->SetInitialChildList(nsIFrame::kPrincipalList, temp);
+  aParent->SetInitialChildList(kPrincipalList, temp);
 }
 
 // -----------------------------------------------------------
 
 // Structure used when constructing formatting object trees.
 struct nsFrameItems : public nsFrameList
 {
   // Appends the frame to the end of the list
   void AddChild(nsIFrame* aChild);
 };
 
 void 
 nsFrameItems::AddChild(nsIFrame* aChild)
 {
   NS_PRECONDITION(aChild, "nsFrameItems::AddChild");
 
-  // It'd be really nice if we could just AppendFrames(nsIFrame::kPrincipalList, aChild) here,
+  // It'd be really nice if we could just AppendFrames(kPrincipalList, aChild) here,
   // but some of our callers put frames that have different
   // parents (caption, I'm looking at you) on the same framelist, and
   // nsFrameList asserts if you try to do that.
   if (IsEmpty()) {
     SetFrames(aChild);
   }
   else {
     NS_ASSERTION(aChild != mLastChild,
@@ -1262,17 +1265,17 @@ nsFrameConstructorState::ProcessFrameIns
 }
 
 
 nsFrameConstructorSaveState::nsFrameConstructorSaveState()
   : mItems(nsnull),
     mFixedPosIsAbsPos(nsnull),
     mSavedItems(nsnull),
     mSavedFixedPosIsAbsPos(PR_FALSE),
-    mChildListID(nsIFrame::kPrincipalList),
+    mChildListID(kPrincipalList),
     mState(nsnull)
 {
 }
 
 nsFrameConstructorSaveState::~nsFrameConstructorSaveState()
 {
   // Restore the state
   if (mItems) {
@@ -1333,19 +1336,19 @@ MoveChildrenTo(nsPresContext* aPresConte
   }
 
   for (nsFrameList::Enumerator e(aFrameList); !e.AtEnd(); e.Next()) {
     e.get()->SetParent(aNewParent);
   }
 
   if (aNewParent->PrincipalChildList().IsEmpty() &&
       (aNewParent->GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
-    aNewParent->SetInitialChildList(nsIFrame::kPrincipalList, aFrameList);
+    aNewParent->SetInitialChildList(kPrincipalList, aFrameList);
   } else {
-    aNewParent->AppendFrames(nsIFrame::kPrincipalList, aFrameList);
+    aNewParent->AppendFrames(kPrincipalList, aFrameList);
   }
 }
 
 //----------------------------------------------------------------------
 
 nsCSSFrameConstructor::nsCSSFrameConstructor(nsIDocument *aDocument,
                                              nsIPresShell *aPresShell)
   : mDocument(aDocument)
@@ -1934,17 +1937,17 @@ nsCSSFrameConstructor::ConstructTable(ns
   }
   // XXXbz what about cleaning up?
   if (NS_FAILED(rv)) return rv;
 
   nsFrameItems captionItems;
   PullOutCaptionFrames(childItems, captionItems);
 
   // Set the inner table frame's initial primary list 
-  innerFrame->SetInitialChildList(nsIFrame::kPrincipalList, childItems);
+  innerFrame->SetInitialChildList(kPrincipalList, childItems);
 
   // Set the outer table frame's secondary childlist lists
   if (captionItems.NotEmpty()) {
     newFrame->SetInitialChildList(nsIFrame::kCaptionList, captionItems);
   }
 
   *aNewFrame = newFrame;
   return rv;
@@ -1981,17 +1984,17 @@ nsCSSFrameConstructor::ConstructTableRow
     rv = ConstructFramesFromItemList(aState, aItem.mChildItems, newFrame,
                                      childItems);
   } else {
     rv = ProcessChildren(aState, content, styleContext, newFrame,
                          PR_TRUE, childItems, PR_FALSE, aItem.mPendingBinding);
   }
   if (NS_FAILED(rv)) return rv;
 
-  newFrame->SetInitialChildList(nsIFrame::kPrincipalList, childItems);
+  newFrame->SetInitialChildList(kPrincipalList, childItems);
   aFrameItems.AddChild(newFrame);
   *aNewFrame = newFrame;
 
   return NS_OK;
 }
 
 nsresult
 nsCSSFrameConstructor::ConstructTableCol(nsFrameConstructorState& aState,
@@ -2121,17 +2124,17 @@ nsCSSFrameConstructor::ConstructTableCel
   if (NS_FAILED(rv)) {
     // Clean up
     // XXXbz kids of this stuff need to be cleaned up too!
     cellInnerFrame->Destroy();
     newFrame->Destroy();
     return rv;
   }
 
-  cellInnerFrame->SetInitialChildList(nsIFrame::kPrincipalList, childItems);
+  cellInnerFrame->SetInitialChildList(kPrincipalList, childItems);
   SetInitialSingleChild(newFrame, cellInnerFrame);
   aFrameItems.AddChild(newFrame);
   *aNewFrame = newFrame;
 
   return NS_OK;
 }
 
 static inline PRBool 
@@ -2489,17 +2492,17 @@ nsCSSFrameConstructor::ConstructDocEleme
 
     NS_ASSERTION(!nsLayoutUtils::GetAsBlock(contentFrame),
                  "Only XUL and SVG frames should reach here");
     // Use a null PendingBinding, since our binding is not in fact pending.
     ProcessChildren(state, aDocElement, styleContext, contentFrame, PR_TRUE,
                     childItems, PR_FALSE, nsnull);
 
     // Set the initial child lists
-    contentFrame->SetInitialChildList(nsIFrame::kPrincipalList, childItems);
+    contentFrame->SetInitialChildList(kPrincipalList, childItems);
   }
 
   SetInitialSingleChild(mDocElementContainingBlock, *aNewFrame);
 
   return NS_OK;
 }
 
 
@@ -2773,17 +2776,17 @@ nsCSSFrameConstructor::SetUpDocElementCo
     mDocElementContainingBlock = canvasFrame;
     mHasRootAbsPosContainingBlock = PR_TRUE;
   }
 
   if (viewportFrame->GetStateBits() & NS_FRAME_FIRST_REFLOW) {
     SetInitialSingleChild(viewportFrame, newFrame);
   } else {
     nsFrameList newFrameList(newFrame, newFrame);
-    viewportFrame->AppendFrames(nsIFrame::kPrincipalList, newFrameList);
+    viewportFrame->AppendFrames(kPrincipalList, newFrameList);
   }
 
   return NS_OK;
 }
 
 nsresult
 nsCSSFrameConstructor::ConstructPageFrame(nsIPresShell*  aPresShell,
                                           nsPresContext* aPresContext,
@@ -2987,34 +2990,34 @@ nsCSSFrameConstructor::ConstructButtonFr
 #endif
 
     rv = ProcessChildren(aState, content, styleContext, blockFrame, PR_TRUE,
                          childItems, aStyleDisplay->IsBlockInside(),
                          aItem.mPendingBinding);
     if (NS_FAILED(rv)) return rv;
   
     // Set the areas frame's initial child lists
-    blockFrame->SetInitialChildList(nsIFrame::kPrincipalList, childItems);
+    blockFrame->SetInitialChildList(kPrincipalList, childItems);
   }
 
   SetInitialSingleChild(buttonFrame, blockFrame);
 
   if (isLeaf) {
     ClearLazyBits(content->GetFirstChild(), nsnull);
 
     nsFrameItems  anonymousChildItems;
     // if there are any anonymous children create frames for them.  Note that
     // we're doing this using a different parent frame from the one we pass to
     // ProcessChildren!
     CreateAnonymousFrames(aState, content, buttonFrame, aItem.mPendingBinding,
                           anonymousChildItems);
     if (anonymousChildItems.NotEmpty()) {
       // the anonymous content is already parented to the area frame
       aState.mFrameManager->AppendFrames(blockFrame,
-                                         nsIFrame::kPrincipalList,
+                                         kPrincipalList,
                                          anonymousChildItems);
     }
   }
 
   // our new button frame returned is the top frame. 
   *aNewFrame = buttonFrame; 
 
   return NS_OK;  
@@ -3104,17 +3107,17 @@ nsCSSFrameConstructor::ConstructSelectFr
       // Create display and button frames from the combobox's anonymous content.
       // The anonymous content is appended to existing anonymous content for this
       // element (the scrollbars).
 
       nsFrameItems childItems;
       CreateAnonymousFrames(aState, content, comboboxFrame,
                             aItem.mPendingBinding, childItems);
   
-      comboboxFrame->SetInitialChildList(nsIFrame::kPrincipalList, childItems);
+      comboboxFrame->SetInitialChildList(kPrincipalList, childItems);
 
       // Initialize the additional popup child list which contains the
       // dropdown list frame.
       nsFrameItems popupItems;
       popupItems.AddChild(listFrame);
       comboboxFrame->SetInitialChildList(nsIFrame::kSelectPopupList,
                                          popupItems);
 
@@ -3208,17 +3211,17 @@ nsCSSFrameConstructor::InitializeSelectF
     // absolutely positioned
     aState.PushAbsoluteContainingBlock(scrolledFrame, absoluteSaveState);
   }
 
   ProcessChildren(aState, aContent, aStyleContext, scrolledFrame, PR_FALSE,
                   childItems, PR_FALSE, aPendingBinding);
 
   // Set the scrolled frame's initial child lists
-  scrolledFrame->SetInitialChildList(nsIFrame::kPrincipalList, childItems);
+  scrolledFrame->SetInitialChildList(kPrincipalList, childItems);
   return NS_OK;
 }
 
 nsresult
 nsCSSFrameConstructor::ConstructFieldSetFrame(nsFrameConstructorState& aState,
                                               FrameConstructionItem&   aItem,
                                               nsIFrame*                aParentFrame,
                                               const nsStyleDisplay*    aStyleDisplay,
@@ -3283,20 +3286,20 @@ nsCSSFrameConstructor::ConstructFieldSet
       childItems.RemoveFrame(legendFrame);
       // Make sure to reparent the legend so it has the fieldset as the parent.
       fieldsetKids.InsertFrame(newFrame, nsnull, legendFrame);
       break;
     }
   }
 
   // Set the inner frame's initial child lists
-  blockFrame->SetInitialChildList(nsIFrame::kPrincipalList, childItems);
+  blockFrame->SetInitialChildList(kPrincipalList, childItems);
 
   // Set the outer frame's initial child list
-  newFrame->SetInitialChildList(nsIFrame::kPrincipalList, fieldsetKids);
+  newFrame->SetInitialChildList(kPrincipalList, fieldsetKids);
 
   // our new frame returned is the top frame which is the list frame. 
   *aNewFrame = newFrame; 
 
   return NS_OK;
 }
 
 static nsIFrame*
@@ -3804,17 +3807,17 @@ nsCSSFrameConstructor::ConstructFrameFro
       }
 
       childItems = newItems;
     }
 
     // Set the frame's initial child list
     // Note that MathML depends on this being called even if
     // childItems is empty!
-    newFrame->SetInitialChildList(nsIFrame::kPrincipalList, childItems);
+    newFrame->SetInitialChildList(kPrincipalList, childItems);
   }
 
   NS_ASSERTION(newFrame->IsFrameOfType(nsIFrame::eLineParticipant) ==
                ((bits & FCDATA_IS_LINE_PARTICIPANT) != 0),
                "Incorrectly set FCDATA_IS_LINE_PARTICIPANT bits");
 
   // Even if mCreatingExtraFrames is set, we may need to SetPrimaryFrame for
   // generated content that doesn't have one yet.  Note that we have to examine
@@ -4208,28 +4211,28 @@ nsCSSFrameConstructor::BeginBuildingScro
   aNewFrame = gfxScrollFrame;
 
   // we used the style that was passed in. So resolve another one.
   nsStyleSet *styleSet = mPresShell->StyleSet();
   nsStyleContext* aScrolledChildStyle =
     styleSet->ResolveAnonymousBoxStyle(aScrolledPseudo, contentStyle).get();
 
   if (gfxScrollFrame) {
-     gfxScrollFrame->SetInitialChildList(nsIFrame::kPrincipalList, anonymousItems);
+     gfxScrollFrame->SetInitialChildList(kPrincipalList, anonymousItems);
   }
 
   return aScrolledChildStyle;
 }
 
 void
 nsCSSFrameConstructor::FinishBuildingScrollFrame(nsIFrame* aScrollFrame,
                                                  nsIFrame* aScrolledFrame)
 {
   nsFrameList scrolled(aScrolledFrame, aScrolledFrame);
-  aScrollFrame->AppendFrames(nsIFrame::kPrincipalList, scrolled);
+  aScrollFrame->AppendFrames(kPrincipalList, scrolled);
 }
 
 
 /**
  * Called to wrap a gfx scrollframe around a frame. The hierarchy will look like this
  *
  * ------- for gfx scrollbars ------
  *
@@ -4587,17 +4590,17 @@ nsCSSFrameConstructor::FlushAccumulatedB
                           NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT);
   if (NS_UNLIKELY(!blockFrame))
     return NS_ERROR_OUT_OF_MEMORY;
 
   InitAndRestoreFrame(aState, aContent, aParentFrame, nsnull, blockFrame);
   ReparentFrames(aState.mFrameManager, blockFrame, *aBlockItems);
   // abs-pos and floats are disabled in MathML children so we don't have to
   // worry about messing up those.
-  blockFrame->SetInitialChildList(nsIFrame::kPrincipalList, *aBlockItems);
+  blockFrame->SetInitialChildList(kPrincipalList, *aBlockItems);
   NS_ASSERTION(aBlockItems->IsEmpty(), "What happened?");
   aBlockItems->Clear();
   aNewItems->AddChild(blockFrame);
   return NS_OK;
 }
 
 // Only <math> elements can be floated or positioned.  All other MathML
 // should be in-flow.
@@ -4895,17 +4898,17 @@ nsCSSFrameConstructor::ConstructSVGForei
   nsFrameItems childItems;
   // Claim to be relatively positioned so that we end up being the
   // absolute containing block.
   rv = ConstructBlock(aState, innerPseudoStyle->GetStyleDisplay(), content,
                       newFrame, newFrame, innerPseudoStyle,
                       &blockFrame, childItems, PR_TRUE,
                       aItem.mPendingBinding);
 
-  newFrame->SetInitialChildList(nsIFrame::kPrincipalList, childItems);
+  newFrame->SetInitialChildList(kPrincipalList, childItems);
 
   *aNewFrame = newFrame;
 
   return rv;
 }
 
 void
 nsCSSFrameConstructor::AddPageBreakItem(nsIContent* aContent,
@@ -5623,17 +5626,17 @@ AdjustAppendParentForAfterContent(nsPres
 static nsIFrame*
 FindAppendPrevSibling(nsIFrame* aParentFrame, nsIFrame* aAfterFrame)
 {
   if (aAfterFrame) {
     NS_ASSERTION(aAfterFrame->GetParent() == aParentFrame, "Wrong parent");
     return aAfterFrame->GetPrevSibling();
   }
 
-  return aParentFrame->GetLastChild(nsIFrame::kPrincipalList);
+  return aParentFrame->GetLastChild(kPrincipalList);
 }
 
 /**
  * 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)
@@ -5711,17 +5714,17 @@ nsCSSFrameConstructor::AppendFrames(nsFr
 
     // We want to put some of the frames into this inline frame.
     nsFrameList::FrameLinkEnumerator firstBlockEnumerator(aFrameList);
     FindFirstBlock(firstBlockEnumerator);
 
     nsFrameList inlineKids = aFrameList.ExtractHead(firstBlockEnumerator);
     if (!inlineKids.IsEmpty()) {
       aState.mFrameManager->AppendFrames(aParentFrame,
-                                         nsIFrame::kPrincipalList,
+                                         kPrincipalList,
                                          inlineKids);
     }
 
     if (!aFrameList.IsEmpty()) {
       const nsStyleDisplay* parentDisplay = aParentFrame->GetStyleDisplay();
       PRBool positioned =
         parentDisplay->mPosition == NS_STYLE_POSITION_RELATIVE ||
         parentDisplay->HasTransform();
@@ -5741,17 +5744,17 @@ nsCSSFrameConstructor::AppendFrames(nsFr
                           aParentFrame, PR_TRUE);
     }
 
     return NS_OK;
   }
   
   // Insert the frames after our aPrevSibling
   return aState.mFrameManager->InsertFrames(aParentFrame,
-                                            nsIFrame::kPrincipalList,
+                                            kPrincipalList,
                                             aPrevSibling,
                                             aFrameList);
 }
 
 #define UNSET_DISPLAY 255
 
 // This gets called to see if the frames corresponding to aSibling and aContent
 // should be siblings in the frame tree. Although (1) rows and cols, (2) row
@@ -7275,17 +7278,17 @@ nsCSSFrameConstructor::ContentRangeInser
   }
 
   if (frameItems.NotEmpty()) {
     // Notify the parent frame
     if (isAppend) {
       AppendFrames(state, parentFrame, frameItems, prevSibling);
     } else {
       state.mFrameManager->InsertFrames(parentFrame,
-                                        nsIFrame::kPrincipalList,
+                                        kPrincipalList,
                                         prevSibling,
                                         frameItems);
     }
   }
 
   if (haveFirstLetterStyle) {
     // Recover the letter frames for the containing block when
     // it has first-letter style.
@@ -8342,17 +8345,17 @@ nsCSSFrameConstructor::CreateContinuingO
         return rv;
       }
       newChildFrames.AddChild(continuingTableFrame);
       
       NS_ASSERTION(!childFrame->GetNextSibling(),"there can be only one inner table frame");
     }
 
     // Set the outer table's initial child list
-    newFrame->SetInitialChildList(nsIFrame::kPrincipalList, newChildFrames);
+    newFrame->SetInitialChildList(kPrincipalList, newChildFrames);
     
     *aContinuingFrame = newFrame;
     return NS_OK;
   }
   else {
     *aContinuingFrame = nsnull;
     return NS_ERROR_OUT_OF_MEMORY;
   }
@@ -8396,29 +8399,29 @@ nsCSSFrameConstructor::CreateContinuingT
         headerFooterFrame = static_cast<nsTableRowGroupFrame*>
                                        (NS_NewTableRowGroupFrame(aPresShell, rowGroupFrame->GetStyleContext()));
         nsIContent* headerFooter = rowGroupFrame->GetContent();
         headerFooterFrame->Init(headerFooter, newFrame, nsnull);
         ProcessChildren(state, headerFooter, rowGroupFrame->GetStyleContext(),
                         headerFooterFrame, PR_TRUE, childItems, PR_FALSE,
                         nsnull);
         NS_ASSERTION(state.mFloatedItems.IsEmpty(), "unexpected floated element");
-        headerFooterFrame->SetInitialChildList(nsIFrame::kPrincipalList, childItems);
+        headerFooterFrame->SetInitialChildList(kPrincipalList, childItems);
         headerFooterFrame->SetRepeatable(PR_TRUE);
 
         // Table specific initialization
         headerFooterFrame->InitRepeatedFrame(aPresContext, rowGroupFrame);
 
         // XXX Deal with absolute and fixed frames...
         childFrames.AddChild(headerFooterFrame);
       }
     }
     
     // Set the table frame's initial child list
-    newFrame->SetInitialChildList(nsIFrame::kPrincipalList, childFrames);
+    newFrame->SetInitialChildList(kPrincipalList, childFrames);
     
     *aContinuingFrame = newFrame;
     return NS_OK;
   }
   else {
     *aContinuingFrame = nsnull;
     return NS_ERROR_OUT_OF_MEMORY;
   }
@@ -8529,17 +8532,17 @@ nsCSSFrameConstructor::CreateContinuingF
             return NS_ERROR_OUT_OF_MEMORY;
           }
           newChildList.AddChild(continuingCellFrame);
         }
         cellFrame = cellFrame->GetNextSibling();
       }
       
       // Set the table cell's initial child list
-      newFrame->SetInitialChildList(nsIFrame::kPrincipalList, newChildList);
+      newFrame->SetInitialChildList(kPrincipalList, newChildList);
     }
 
   } else if (IS_TABLE_CELL(frameType)) {
     // Warning: If you change this and add a wrapper frame around table cell
     // frames, make sure Bug 368554 doesn't regress!
     // See IsInAutoWidthTableCellForQuirk() in nsImageFrame.cpp.
     newFrame = NS_NewTableCellFrame(shell, styleContext, IsBorderCollapse(aParentFrame));
 
@@ -8740,17 +8743,17 @@ nsCSSFrameConstructor::ReplicateFixedFra
     }
   }
 
   // Add the placeholders to our primary child list.
   // XXXbz this is a little screwed up, since the fixed frames will have 
   // broken auto-positioning. Oh, well.
   NS_ASSERTION(!canvasFrame->GetFirstPrincipalChild(),
                "leaking frames; doc root continuation must be empty");
-  canvasFrame->SetInitialChildList(nsIFrame::kPrincipalList, fixedPlaceholders);
+  canvasFrame->SetInitialChildList(kPrincipalList, fixedPlaceholders);
   return NS_OK;
 }
 
 nsresult
 nsCSSFrameConstructor::GetInsertionPoint(nsIFrame*     aParentFrame,
                                          nsIContent*   aChildContent,
                                          nsIFrame**    aInsertionPoint,
                                          PRBool*       aMultiple)
@@ -9643,17 +9646,17 @@ nsCSSFrameConstructor::ProcessChildren(n
     // a real block placed here wouldn't get those set on it.
 
     InitAndRestoreFrame(aState, aContent, aFrame, nsnull,
                         blockFrame, PR_FALSE);
 
     NS_ASSERTION(!blockFrame->HasView(), "need to do view reparenting");
     ReparentFrames(aState.mFrameManager, blockFrame, aFrameItems);
 
-    blockFrame->SetInitialChildList(nsIFrame::kPrincipalList, aFrameItems);
+    blockFrame->SetInitialChildList(kPrincipalList, aFrameItems);
     NS_ASSERTION(aFrameItems.IsEmpty(), "How did that happen?");
     aFrameItems.Clear();
     aFrameItems.AddChild(blockFrame);
 
     aFrame->AddStateBits(NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK);
   }
 
   return rv;
@@ -9722,20 +9725,20 @@ nsCSSFrameConstructor::WrapFramesInFirst
     }
   }
 
   if (aLineFrame) {
     // Give the inline frames to the lineFrame <b>after</b> reparenting them
     ReparentFrames(aState.mFrameManager, aLineFrame, firstLineChildren);
     if (aLineFrame->PrincipalChildList().IsEmpty() &&
         (aLineFrame->GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
-      aLineFrame->SetInitialChildList(nsIFrame::kPrincipalList, firstLineChildren);
+      aLineFrame->SetInitialChildList(kPrincipalList, firstLineChildren);
     } else {
       aState.mFrameManager->AppendFrames(aLineFrame,
-                                         nsIFrame::kPrincipalList,
+                                         kPrincipalList,
                                          firstLineChildren);
     }
   }
   else {
     rv = NS_ERROR_OUT_OF_MEMORY;
   }
 
   return rv;
@@ -9803,17 +9806,17 @@ nsCSSFrameConstructor::InsertFirstLineFr
     if (firstBlockKid->GetType() == nsGkAtoms::lineFrame) {
       // We already have a first-line frame
       nsIFrame* lineFrame = firstBlockKid;
 
       if (isInline) {
         // Easy case: the new inline frame will go into the lineFrame.
         ReparentFrame(aState.mFrameManager, lineFrame, newFrame);
         aState.mFrameManager->InsertFrames(lineFrame,
-                                           nsIFrame::kPrincipalList,
+                                           kPrincipalList,
                                            nsnull,
                                            newFrame);
 
         // Since the frame is going into the lineFrame, don't let it
         // go into the block too.
         aFrameItems.childList = nsnull;
         aFrameItems.lastChild = nsnull;
       }
@@ -9850,17 +9853,17 @@ nsCSSFrameConstructor::InsertFirstLineFr
           aFrameItems.childList = lineFrame;
           aFrameItems.lastChild = lineFrame;
 
           // Give the inline frames to the lineFrame <b>after</b>
           // reparenting them
           NS_ASSERTION(lineFrame->GetStyleContext() == firstLineStyle,
                        "Bogus style context on line frame");
           ReparentFrame(aPresContext, lineFrame, newFrame);
-          lineFrame->SetInitialChildList(nsIFrame::kPrincipalList, newFrame);
+          lineFrame->SetInitialChildList(kPrincipalList, newFrame);
         }
       }
       else {
         // Easy case: the regular insertion logic can insert the new
         // frame because it's a block frame.
       }
     }
   }
@@ -9909,17 +9912,17 @@ nsCSSFrameConstructor::InsertFirstLineFr
             nsIFrame* kids = nextLineFrame->GetFirstPrincipalChild();
           }
         }
         else {
           // We got lucky: aPrevSibling was the last inline frame in
           // the line-frame.
           ReparentFrame(aState.mFrameManager, aBlockFrame, newFrame);
           aState.mFrameManager->InsertFrames(aBlockFrame,
-                                             nsIFrame::kPrincipalList,
+                                             kPrincipalList,
                                              prevSiblingParent, newFrame);
           aFrameItems.childList = nsnull;
           aFrameItems.lastChild = nsnull;
         }
       }
     }
   }
 
@@ -10191,20 +10194,20 @@ nsCSSFrameConstructor::WrapFramesInFirst
     if (parentFrame == aBlockFrame) {
       // Take textFrame out of the block's frame list and substitute the
       // letter frame(s) instead.
       aBlockFrames.DestroyFrame(textFrame);
       aBlockFrames.InsertFrames(nsnull, prevFrame, letterFrames);
     }
     else {
       // Take the old textFrame out of the inline parent's child list
-      mPresShell->FrameManager()->RemoveFrame(nsIFrame::kPrincipalList, textFrame);
+      mPresShell->FrameManager()->RemoveFrame(kPrincipalList, textFrame);
 
       // Insert in the letter frame(s)
-      parentFrame->InsertFrames(nsIFrame::kPrincipalList, prevFrame, letterFrames);
+      parentFrame->InsertFrames(kPrincipalList, prevFrame, letterFrames);
     }
   }
 
   return rv;
 }
 
 nsresult
 nsCSSFrameConstructor::WrapFramesInFirstLetterFrame(
@@ -10339,38 +10342,38 @@ nsCSSFrameConstructor::RemoveFloatingFir
   }
   newTextFrame->Init(textContent, parentFrame, nsnull);
 
   // Destroy the old text frame's continuations (the old text frame
   // will be destroyed when its letter frame is destroyed).
   nsIFrame* frameToDelete = textFrame->GetLastContinuation();
   while (frameToDelete != textFrame) {
     nsIFrame* nextFrameToDelete = frameToDelete->GetPrevContinuation();
-    aFrameManager->RemoveFrame(nsIFrame::kPrincipalList, frameToDelete);
+    aFrameManager->RemoveFrame(kPrincipalList, frameToDelete);
     frameToDelete = nextFrameToDelete;
   }
 
   nsIFrame* prevSibling = placeholderFrame->GetPrevSibling();
 
   // Now that everything is set...
 #ifdef NOISY_FIRST_LETTER
   printf("RemoveFloatingFirstLetterFrames: textContent=%p oldTextFrame=%p newTextFrame=%p\n",
          textContent.get(), textFrame, newTextFrame);
 #endif
 
   // Remove placeholder frame and the float
-  aFrameManager->RemoveFrame(nsIFrame::kPrincipalList, placeholderFrame);
+  aFrameManager->RemoveFrame(kPrincipalList, placeholderFrame);
 
   // Now that the old frames are gone, we can start pointing to our
   // new primary frame.
   textContent->SetPrimaryFrame(newTextFrame);
 
   // Insert text frame in its place
   nsFrameList textList(newTextFrame, newTextFrame);
-  aFrameManager->InsertFrames(parentFrame, nsIFrame::kPrincipalList,
+  aFrameManager->InsertFrames(parentFrame, kPrincipalList,
                               prevSibling, textList);
 
   return NS_OK;
 }
 
 nsresult
 nsCSSFrameConstructor::RemoveFirstLetterFrames(nsPresContext* aPresContext,
                                                nsIPresShell* aPresShell,
@@ -10403,25 +10406,25 @@ nsCSSFrameConstructor::RemoveFirstLetter
       newSC = aPresShell->StyleSet()->ResolveStyleForNonElement(parentSC);
       if (!newSC) {
         break;
       }
       textFrame = NS_NewTextFrame(aPresShell, newSC);
       textFrame->Init(textContent, aFrame, nsnull);
 
       // Next rip out the kid and replace it with the text frame
-      aFrameManager->RemoveFrame(nsIFrame::kPrincipalList, kid);
+      aFrameManager->RemoveFrame(kPrincipalList, kid);
 
       // Now that the old frames are gone, we can start pointing to our
       // new primary frame.
       textContent->SetPrimaryFrame(textFrame);
 
       // Insert text frame in its place
       nsFrameList textList(textFrame, textFrame);
-      aFrameManager->InsertFrames(aFrame, nsIFrame::kPrincipalList,
+      aFrameManager->InsertFrames(aFrame, kPrincipalList,
                                   prevSibling, textList);
 
       *aStopLooking = PR_TRUE;
       NS_ASSERTION(!aBlockFrame->GetPrevContinuation(),
                    "should have the first continuation here");
       aBlockFrame->RemoveStateBits(NS_BLOCK_HAS_FIRST_LETTER_CHILD);
       break;
     }
@@ -10493,20 +10496,20 @@ nsCSSFrameConstructor::RecoverLetterFram
     if (stopLooking) {
       break;
     }
     continuation = continuation->GetNextContinuation();
   } while (continuation);
 
   if (parentFrame) {
     // Take the old textFrame out of the parents child list
-    mPresShell->FrameManager()->RemoveFrame(nsIFrame::kPrincipalList, textFrame);
+    mPresShell->FrameManager()->RemoveFrame(kPrincipalList, textFrame);
 
     // Insert in the letter frame(s)
-    parentFrame->InsertFrames(nsIFrame::kPrincipalList, prevFrame, letterFrames);
+    parentFrame->InsertFrames(kPrincipalList, prevFrame, letterFrames);
   }
   return rv;
 }
 
 //----------------------------------------------------------------------
 
 // listbox Widget Routines
 
@@ -10641,17 +10644,17 @@ nsCSSFrameConstructor::ConstructBlock(ns
   }
 
   // Process the child content
   nsFrameItems childItems;
   rv = ProcessChildren(aState, aContent, aStyleContext, blockFrame, PR_TRUE,
                        childItems, PR_TRUE, aPendingBinding);
 
   // Set the frame's initial child list
-  blockFrame->SetInitialChildList(nsIFrame::kPrincipalList, childItems);
+  blockFrame->SetInitialChildList(kPrincipalList, childItems);
 
   return rv;
 }
 
 nsresult
 nsCSSFrameConstructor::ConstructInline(nsFrameConstructorState& aState,
                                        FrameConstructionItem&   aItem,
                                        nsIFrame*                aParentFrame,
@@ -10759,30 +10762,30 @@ nsCSSFrameConstructor::ConstructInline(n
 
   if (aItem.mIsAllInline || firstBlockEnumerator.AtEnd()) { 
     // This part is easy.  We either already know we have no non-inline kids,
     // or haven't found any when constructing actual frames (the latter can
     // happen only if out-of-flows that we thought had no containing block
     // acquired one when ancestor inline frames and {ib} splits got
     // constructed).  Just put all the kids into the single inline frame and
     // bail.
-    newFrame->SetInitialChildList(nsIFrame::kPrincipalList, childItems);
+    newFrame->SetInitialChildList(kPrincipalList, childItems);
     if (NS_SUCCEEDED(rv)) {
       aState.AddChild(newFrame, aFrameItems, content, styleContext, aParentFrame);
       *aNewFrame = newFrame;
     }
     return rv;
   }
 
   // This inline frame contains several types of children. Therefore this frame
   // has to be chopped into several pieces, as described above.
 
   // Grab the first inline's kids
   nsFrameList firstInlineKids = childItems.ExtractHead(firstBlockEnumerator);
-  newFrame->SetInitialChildList(nsIFrame::kPrincipalList, firstInlineKids);
+  newFrame->SetInitialChildList(kPrincipalList, firstInlineKids);
 
   aFrameItems.AddChild(newFrame);
 
   CreateIBSiblings(aState, newFrame, positioned, childItems, aFrameItems);
 
   *aNewFrame = newFrame;
   return NS_OK;
 }
@@ -11042,17 +11045,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(nsIFrame::kPrincipalList);
+              prevSibling = parentPrevCont->GetLastChild(kPrincipalList);
               if (prevSibling) {
                 break;
               }
               parentPrevCont = parentPrevCont->GetPrevContinuation();
             }
           };
           if (prevSibling) {
             if (IsTablePseudo(prevSibling)) {
@@ -11710,17 +11713,17 @@ nsCSSFrameConstructor::GenerateChildFram
     nsresult rv = ProcessChildren(state, aFrame->GetContent(), aFrame->GetStyleContext(),
                                   aFrame, PR_FALSE, childItems, PR_FALSE,
                                   nsnull);
     if (NS_FAILED(rv)) {
       EndUpdate();
       return rv;
     }
 
-    aFrame->SetInitialChildList(nsIFrame::kPrincipalList, childItems);
+    aFrame->SetInitialChildList(kPrincipalList, childItems);
 
     EndUpdate();
   }
 
 #ifdef ACCESSIBILITY
   nsAccessibilityService* accService = nsIPresShell::AccService();
   if (accService) {
     nsIContent* container = aFrame->GetContent();