diff --git a/layout/base/nsBidiPresUtils.cpp b/layout/base/nsBidiPresUtils.cpp index 6f82958ec507..86de755c4988 100644 --- a/layout/base/nsBidiPresUtils.cpp +++ b/layout/base/nsBidiPresUtils.cpp @@ -433,7 +433,7 @@ SplitInlineAncestors(nsIFrame* aParent, nsIFrame* newParent; while (IsBidiSplittable(parent)) { - nsIFrame* grandparent = parent->GetParent(); + nsContainerFrame* grandparent = parent->GetParent(); NS_ASSERTION(grandparent, "Couldn't get parent's parent in nsBidiPresUtils::SplitInlineAncestors"); // Split the child list after |frame|, unless it is the last child. @@ -540,7 +540,7 @@ CreateContinuation(nsIFrame* aFrame, nsIPresShell *presShell = presContext->PresShell(); NS_ASSERTION(presShell, "PresShell must be set on PresContext before calling nsBidiPresUtils::CreateContinuation"); - nsIFrame* parent = aFrame->GetParent(); + nsContainerFrame* parent = aFrame->GetParent(); NS_ASSERTION(parent, "Couldn't get frame parent in nsBidiPresUtils::CreateContinuation"); nsresult rv = NS_OK; diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index e93943018582..b934c1e19a52 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -25,6 +25,8 @@ #include "nsIDocument.h" #include "nsTableFrame.h" #include "nsTableColFrame.h" +#include "nsTableRowFrame.h" +#include "nsTableCellFrame.h" #include "nsIDOMHTMLDocument.h" #include "nsHTMLParts.h" #include "nsIPresShell.h" @@ -71,6 +73,14 @@ #include "StickyScrollContainer.h" #include "nsFieldSetFrame.h" #include "nsInlineFrame.h" +#include "nsBlockFrame.h" +#include "nsCanvasFrame.h" +#include "nsFirstLetterFrame.h" +#include "nsGfxScrollFrame.h" +#include "nsPageFrame.h" +#include "nsSimplePageSequenceFrame.h" +#include "nsTableOuterFrame.h" +#include "nsIScrollableFrame.h" #ifdef MOZ_XUL #include "nsIRootBox.h" @@ -79,10 +89,6 @@ #include "nsAccessibilityService.h" #endif -#include "nsBlockFrame.h" - -#include "nsIScrollableFrame.h" - #include "nsXBLService.h" #undef NOISY_FIRST_LETTER @@ -108,9 +114,9 @@ NS_NewHTMLCanvasFrame (nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewHTMLVideoFrame (nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +nsContainerFrame* NS_NewSVGOuterSVGFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +nsContainerFrame* NS_NewSVGOuterSVGAnonChildFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewSVGInnerSVGFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); @@ -120,7 +126,7 @@ nsIFrame* NS_NewSVGGFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewSVGGenericContainerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +nsContainerFrame* NS_NewSVGForeignObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewSVGAFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); @@ -140,9 +146,9 @@ extern nsIFrame* NS_NewSVGRadialGradientFrame(nsIPresShell *aPresShell, nsStyleContext* aContext); extern nsIFrame* NS_NewSVGStopFrame(nsIPresShell *aPresShell, nsStyleContext* aContext); -nsIFrame* +nsContainerFrame* NS_NewSVGMarkerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +nsContainerFrame* NS_NewSVGMarkerAnonChildFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); extern nsIFrame* NS_NewSVGImageFrame(nsIPresShell *aPresShell, nsStyleContext* aContext); @@ -206,10 +212,10 @@ static FrameCtorDebugFlags gFlags[] = { nsIFrame* NS_NewAutoRepeatBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +nsContainerFrame* NS_NewRootBoxFrame (nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +nsContainerFrame* NS_NewDocElementBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* @@ -279,12 +285,12 @@ NS_NewResizerFrame (nsIPresShell* aPresShell, nsStyleContext* aContext); #endif -nsIFrame* -NS_NewHTMLScrollFrame (nsIPresShell* aPresShell, nsStyleContext* aContext, bool aIsRoot); +nsHTMLScrollFrame* +NS_NewHTMLScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, bool aIsRoot); -nsIFrame* -NS_NewXULScrollFrame (nsIPresShell* aPresShell, nsStyleContext* aContext, - bool aIsRoot, bool aClipAllDescendants); +nsXULScrollFrame* +NS_NewXULScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, + bool aIsRoot, bool aClipAllDescendants); nsIFrame* NS_NewSliderFrame (nsIPresShell* aPresShell, nsStyleContext* aContext); @@ -484,7 +490,7 @@ GetLastIBSplitSibling(nsIFrame* aFrame, bool aReturnEmptyTrailingInline) } static void -SetFrameIsIBSplit(nsIFrame* aFrame, nsIFrame* aIBSplitSibling) +SetFrameIsIBSplit(nsContainerFrame* aFrame, nsIFrame* aIBSplitSibling) { NS_PRECONDITION(aFrame, "bad args!"); @@ -650,9 +656,9 @@ nsFrameItems::AddChild(nsIFrame* aChild) // state information needed for absolutely positioned elements struct nsAbsoluteItems : nsFrameItems { // containing block for absolutely positioned elements - nsIFrame* containingBlock; + nsContainerFrame* containingBlock; - nsAbsoluteItems(nsIFrame* aContainingBlock); + nsAbsoluteItems(nsContainerFrame* aContainingBlock); #ifdef DEBUG // XXXbz Does this need a debug-only assignment operator that nulls out the // childList in the nsAbsoluteItems we're copying? Introducing a difference @@ -667,7 +673,7 @@ struct nsAbsoluteItems : nsFrameItems { void AddChild(nsIFrame* aChild); }; -nsAbsoluteItems::nsAbsoluteItems(nsIFrame* aContainingBlock) +nsAbsoluteItems::nsAbsoluteItems(nsContainerFrame* aContainingBlock) : containingBlock(aContainingBlock) { } @@ -780,15 +786,15 @@ public: // Constructor // Use the passed-in history state. nsFrameConstructorState(nsIPresShell* aPresShell, - nsIFrame* aFixedContainingBlock, - nsIFrame* aAbsoluteContainingBlock, - nsIFrame* aFloatContainingBlock, + nsContainerFrame* aFixedContainingBlock, + nsContainerFrame* aAbsoluteContainingBlock, + nsContainerFrame* aFloatContainingBlock, nsILayoutHistoryState* aHistoryState); // Get the history state from the pres context's pres shell. nsFrameConstructorState(nsIPresShell* aPresShell, - nsIFrame* aFixedContainingBlock, - nsIFrame* aAbsoluteContainingBlock, - nsIFrame* aFloatContainingBlock); + nsContainerFrame* aFixedContainingBlock, + nsContainerFrame* aAbsoluteContainingBlock, + nsContainerFrame* aFloatContainingBlock); ~nsFrameConstructorState(); @@ -801,7 +807,7 @@ public: // aNewAbsoluteContainingBlock a containing block. E.g. for a scrollable element // aPositionedFrame is the element's primary frame and // aNewAbsoluteContainingBlock is the scrolled frame. - void PushAbsoluteContainingBlock(nsIFrame* aNewAbsoluteContainingBlock, + void PushAbsoluteContainingBlock(nsContainerFrame* aNewAbsoluteContainingBlock, nsIFrame* aPositionedFrame, nsFrameConstructorSaveState& aSaveState); @@ -812,14 +818,14 @@ public: // floated until a new float containing block is pushed. // XXX we should get rid of null float containing blocks and teach the // various frame classes to deal with floats instead. - void PushFloatContainingBlock(nsIFrame* aNewFloatContainingBlock, + void PushFloatContainingBlock(nsContainerFrame* aNewFloatContainingBlock, nsFrameConstructorSaveState& aSaveState); // Function to return the proper geometric parent for a frame with display // struct given by aStyleDisplay and parent's frame given by // aContentParentFrame. - nsIFrame* GetGeometricParent(const nsStyleDisplay* aStyleDisplay, - nsIFrame* aContentParentFrame) const; + nsContainerFrame* GetGeometricParent(const nsStyleDisplay* aStyleDisplay, + nsContainerFrame* aContentParentFrame) const; /** * Function to add a new frame to the right frame list. This MUST be called @@ -843,7 +849,7 @@ public: nsFrameItems& aFrameItems, nsIContent* aContent, nsStyleContext* aStyleContext, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, bool aCanBePositioned = true, bool aCanBeFloated = true, bool aIsOutOfFlowPopup = false, @@ -924,9 +930,9 @@ protected: }; nsFrameConstructorState::nsFrameConstructorState(nsIPresShell* aPresShell, - nsIFrame* aFixedContainingBlock, - nsIFrame* aAbsoluteContainingBlock, - nsIFrame* aFloatContainingBlock, + nsContainerFrame* aFixedContainingBlock, + nsContainerFrame* aAbsoluteContainingBlock, + nsContainerFrame* aFloatContainingBlock, nsILayoutHistoryState* aHistoryState) : mPresContext(aPresShell->GetPresContext()), mPresShell(aPresShell), @@ -960,9 +966,9 @@ nsFrameConstructorState::nsFrameConstructorState(nsIPresShell* aPresShe } nsFrameConstructorState::nsFrameConstructorState(nsIPresShell* aPresShell, - nsIFrame* aFixedContainingBlock, - nsIFrame* aAbsoluteContainingBlock, - nsIFrame* aFloatContainingBlock) + nsContainerFrame* aFixedContainingBlock, + nsContainerFrame* aAbsoluteContainingBlock, + nsContainerFrame* aFloatContainingBlock) : mPresContext(aPresShell->GetPresContext()), mPresShell(aPresShell), mFrameManager(aPresShell->FrameManager()), @@ -1026,8 +1032,8 @@ nsFrameConstructorState::~nsFrameConstructorState() } } -static nsIFrame* -AdjustAbsoluteContainingBlock(nsIFrame* aContainingBlockIn) +static nsContainerFrame* +AdjustAbsoluteContainingBlock(nsContainerFrame* aContainingBlockIn) { if (!aContainingBlockIn) { return nullptr; @@ -1035,11 +1041,11 @@ AdjustAbsoluteContainingBlock(nsIFrame* aContainingBlockIn) // Always use the container's first continuation. (Inline frames can have // non-fluid bidi continuations...) - return aContainingBlockIn->FirstContinuation(); + return static_cast(aContainingBlockIn->FirstContinuation()); } void -nsFrameConstructorState::PushAbsoluteContainingBlock(nsIFrame* aNewAbsoluteContainingBlock, +nsFrameConstructorState::PushAbsoluteContainingBlock(nsContainerFrame* aNewAbsoluteContainingBlock, nsIFrame* aPositionedFrame, nsFrameConstructorSaveState& aSaveState) { @@ -1072,7 +1078,7 @@ nsFrameConstructorState::PushAbsoluteContainingBlock(nsIFrame* aNewAbsoluteConta } void -nsFrameConstructorState::PushFloatContainingBlock(nsIFrame* aNewFloatContainingBlock, +nsFrameConstructorState::PushFloatContainingBlock(nsContainerFrame* aNewFloatContainingBlock, nsFrameConstructorSaveState& aSaveState) { NS_PRECONDITION(!aNewFloatContainingBlock || @@ -1089,9 +1095,9 @@ nsFrameConstructorState::PushFloatContainingBlock(nsIFrame* aNewFloatContainingB mFloatedItems = nsAbsoluteItems(aNewFloatContainingBlock); } -nsIFrame* +nsContainerFrame* nsFrameConstructorState::GetGeometricParent(const nsStyleDisplay* aStyleDisplay, - nsIFrame* aContentParentFrame) const + nsContainerFrame* aContentParentFrame) const { NS_PRECONDITION(aStyleDisplay, "Must have display struct!"); @@ -1139,7 +1145,7 @@ nsFrameConstructorState::AddChild(nsIFrame* aNewFrame, nsFrameItems& aFrameItems, nsIContent* aContent, nsStyleContext* aStyleContext, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, bool aCanBePositioned, bool aCanBeFloated, bool aIsOutOfFlowPopup, @@ -1434,7 +1440,7 @@ bool IsBorderCollapse(nsIFrame* aFrame) static void MoveChildrenTo(nsPresContext* aPresContext, nsIFrame* aOldParent, - nsIFrame* aNewParent, + nsContainerFrame* aNewParent, nsFrameList& aFrameList) { bool sameGrandParent = aOldParent->GetParent() == aNewParent->GetParent(); @@ -1445,7 +1451,7 @@ MoveChildrenTo(nsPresContext* aPresContext, } for (nsFrameList::Enumerator e(aFrameList); !e.AtEnd(); e.Next()) { - e.get()->SetParent(static_cast(aNewParent)); // XXX static_cast will be removed in a later patch + e.get()->SetParent(aNewParent); } if (aNewParent->PrincipalChildList().IsEmpty() && @@ -1751,7 +1757,7 @@ nsCSSFrameConstructor::CreateGeneratedContent(nsFrameConstructorState& aState, */ void nsCSSFrameConstructor::CreateGeneratedContentItem(nsFrameConstructorState& aState, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsIContent* aParentContent, nsStyleContext* aStyleContext, nsCSSPseudoElements::Type aPseudoElement, @@ -1866,11 +1872,11 @@ nsCSSFrameConstructor::GetParentType(nsIAtom* aFrameType) return eTypeBlock; } -static nsIFrame* -AdjustCaptionParentFrame(nsIFrame* aParentFrame) +static nsContainerFrame* +AdjustCaptionParentFrame(nsContainerFrame* aParentFrame) { if (nsGkAtoms::tableFrame == aParentFrame->GetType()) { - return aParentFrame->GetParent();; + return aParentFrame->GetParent(); } return aParentFrame; } @@ -1882,22 +1888,22 @@ AdjustCaptionParentFrame(nsIFrame* aParentFrame) * needed to be fixed up. */ static bool -GetCaptionAdjustedParent(nsIFrame* aParentFrame, - const nsIFrame* aChildFrame, - nsIFrame** aAdjParentFrame) +GetCaptionAdjustedParent(nsContainerFrame* aParentFrame, + const nsIFrame* aChildFrame, + nsContainerFrame** aAdjParentFrame) { *aAdjParentFrame = aParentFrame; bool haveCaption = false; if (nsGkAtoms::tableCaptionFrame == aChildFrame->GetType()) { haveCaption = true; - *aAdjParentFrame = AdjustCaptionParentFrame(aParentFrame); + *aAdjParentFrame = ::AdjustCaptionParentFrame(aParentFrame); } return haveCaption; } void -nsCSSFrameConstructor::AdjustParentFrame(nsIFrame* & aParentFrame, +nsCSSFrameConstructor::AdjustParentFrame(nsContainerFrame** aParentFrame, const FrameConstructionData* aFCData, nsStyleContext* aStyleContext) { @@ -1908,7 +1914,7 @@ nsCSSFrameConstructor::AdjustParentFrame(nsIFrame* & aParentFra if (tablePart && aStyleContext->StyleDisplay()->mDisplay == NS_STYLE_DISPLAY_TABLE_CAPTION) { - aParentFrame = AdjustCaptionParentFrame(aParentFrame); + *aParentFrame = ::AdjustCaptionParentFrame(*aParentFrame); } } @@ -1935,7 +1941,7 @@ PullOutCaptionFrames(nsFrameItems& aItems, nsFrameItems& aCaptions) nsIFrame* nsCSSFrameConstructor::ConstructTable(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aDisplay, nsFrameItems& aFrameItems) { @@ -1953,13 +1959,13 @@ nsCSSFrameConstructor::ConstructTable(nsFrameConstructorState& aState, ResolveAnonymousBoxStyle(nsCSSAnonBoxes::tableOuter, styleContext); // Create the outer table frame which holds the caption and inner table frame - nsIFrame* newFrame; + nsContainerFrame* newFrame; if (kNameSpaceID_MathML == nameSpaceID) newFrame = NS_NewMathMLmtableOuterFrame(mPresShell, outerStyleContext); else newFrame = NS_NewTableOuterFrame(mPresShell, outerStyleContext); - nsIFrame* geometricParent = + nsContainerFrame* geometricParent = aState.GetGeometricParent(outerStyleContext->StyleDisplay(), aParentFrame); @@ -1967,7 +1973,7 @@ nsCSSFrameConstructor::ConstructTable(nsFrameConstructorState& aState, InitAndRestoreFrame(aState, content, geometricParent, newFrame); // Create the inner table frame - nsIFrame* innerFrame; + nsContainerFrame* innerFrame; if (kNameSpaceID_MathML == nameSpaceID) innerFrame = NS_NewMathMLmtableFrame(mPresShell, styleContext); else @@ -2027,7 +2033,7 @@ static void MakeTablePartAbsoluteContainingBlockIfNeeded(nsFrameConstructorState& aState, const nsStyleDisplay* aDisplay, nsFrameConstructorSaveState& aAbsSaveState, - nsIFrame* aFrame) + nsContainerFrame* aFrame) { // If we're positioned, then we need to become an absolute containing block // for any absolutely positioned children and register for post-reflow fixup. @@ -2047,7 +2053,7 @@ MakeTablePartAbsoluteContainingBlockIfNeeded(nsFrameConstructorState& aState nsIFrame* nsCSSFrameConstructor::ConstructTableRowOrRowGroup(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aDisplay, nsFrameItems& aFrameItems) { @@ -2062,7 +2068,7 @@ nsCSSFrameConstructor::ConstructTableRowOrRowGroup(nsFrameConstructorState& aSta nsStyleContext* const styleContext = aItem.mStyleContext; const uint32_t nameSpaceID = aItem.mNameSpaceID; - nsIFrame* newFrame; + nsContainerFrame* newFrame; if (aDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_ROW) { if (kNameSpaceID_MathML == nameSpaceID) newFrame = NS_NewMathMLmtrFrame(mPresShell, styleContext); @@ -2100,7 +2106,7 @@ nsCSSFrameConstructor::ConstructTableRowOrRowGroup(nsFrameConstructorState& aSta nsIFrame* nsCSSFrameConstructor::ConstructTableCol(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aStyleDisplay, nsFrameItems& aFrameItems) { @@ -2132,7 +2138,7 @@ nsCSSFrameConstructor::ConstructTableCol(nsFrameConstructorState& aState, nsIFrame* nsCSSFrameConstructor::ConstructTableCell(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aDisplay, nsFrameItems& aFrameItems) { @@ -2144,7 +2150,7 @@ nsCSSFrameConstructor::ConstructTableCell(nsFrameConstructorState& aState, const uint32_t nameSpaceID = aItem.mNameSpaceID; bool borderCollapse = IsBorderCollapse(aParentFrame); - nsIFrame* newFrame; + nsContainerFrame* newFrame; // is border separate in mathml.css and the MathML code doesn't implement // border collapse. For those users who style with border collapse, // give them the default non-MathML table frames that understand border collapse. @@ -2170,7 +2176,7 @@ nsCSSFrameConstructor::ConstructTableCell(nsFrameConstructorState& aState, // Create a block frame that will format the cell's content bool isBlock; - nsIFrame* cellInnerFrame; + nsContainerFrame* cellInnerFrame; if (kNameSpaceID_MathML == nameSpaceID) { cellInnerFrame = NS_NewMathMLmtdInnerFrame(mPresShell, innerPseudoStyle); isBlock = false; @@ -2457,7 +2463,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(Element* aDocEle // particular if the root frame is positioned, in which case // contentFrame is the out-of-flow frame and newFrame is the // placeholder. - nsIFrame* contentFrame; + nsContainerFrame* contentFrame; nsIFrame* newFrame; bool processChildren = false; @@ -2492,9 +2498,10 @@ nsCSSFrameConstructor::ConstructDocElementFrame(Element* aDocEle nullptr, extraRef, true, nullptr); nsFrameItems frameItems; - contentFrame = ConstructOuterSVG(state, item, mDocElementContainingBlock, - styleContext->StyleDisplay(), - frameItems); + contentFrame = static_cast( + ConstructOuterSVG(state, item, mDocElementContainingBlock, + styleContext->StyleDisplay(), + frameItems)); newFrame = frameItems.FirstChild(); NS_ASSERTION(frameItems.OnlyChild(), "multiple root element frames"); } else if (display->mDisplay == NS_STYLE_DISPLAY_FLEX) { @@ -2527,9 +2534,10 @@ nsCSSFrameConstructor::ConstructDocElementFrame(Element* aDocEle nsFrameItems frameItems; // if the document is a table then just populate it. - contentFrame = ConstructTable(state, item, mDocElementContainingBlock, - styleContext->StyleDisplay(), - frameItems); + contentFrame = static_cast( + ConstructTable(state, item, mDocElementContainingBlock, + styleContext->StyleDisplay(), + frameItems)); newFrame = frameItems.FirstChild(); NS_ASSERTION(frameItems.OnlyChild(), "multiple root element frames"); } else { @@ -2605,13 +2613,10 @@ nsCSSFrameConstructor::ConstructRootFrame() } // --------- BUILD VIEWPORT ----------- - nsIFrame* viewportFrame = nullptr; - nsRefPtr viewportPseudoStyle; - - viewportPseudoStyle = + nsRefPtr viewportPseudoStyle = styleSet->ResolveAnonymousBoxStyle(nsCSSAnonBoxes::viewport, nullptr); - - viewportFrame = NS_NewViewportFrame(mPresShell, viewportPseudoStyle); + ViewportFrame* viewportFrame = + NS_NewViewportFrame(mPresShell, viewportPseudoStyle); // XXXbz do we _have_ to pass a null content pointer to that frame? // Would it really kill us to pass in the root element or something? @@ -2710,10 +2715,10 @@ nsCSSFrameConstructor::SetUpDocElementContainingBlock(nsIContent* aDocElement) nsPresContext* presContext = mPresShell->GetPresContext(); bool isPaginated = presContext->IsRootPaginatedDocument(); - nsIFrame* viewportFrame = mFixedContainingBlock; + nsContainerFrame* viewportFrame = mFixedContainingBlock; nsStyleContext* viewportPseudoStyle = viewportFrame->StyleContext(); - nsIFrame* rootFrame = nullptr; + nsContainerFrame* rootFrame = nullptr; nsIAtom* rootPseudo; if (!isPaginated) { @@ -2763,14 +2768,14 @@ nsCSSFrameConstructor::SetUpDocElementContainingBlock(nsIContent* aDocElement) NS_ASSERTION(!isScrollable || !isXUL, "XUL documents should never be scrollable - see above"); - nsIFrame* newFrame = rootFrame; + nsContainerFrame* newFrame = rootFrame; nsRefPtr rootPseudoStyle; // we must create a state because if the scrollbars are GFX it needs the // state to build the scrollbar frames. nsFrameConstructorState state(mPresShell, nullptr, nullptr, nullptr); // Start off with the viewport as parent; we'll adjust it as needed. - nsIFrame* parentFrame = viewportFrame; + nsContainerFrame* parentFrame = viewportFrame; nsStyleSet* styleSet = mPresShell->StyleSet(); // If paginated, make sure we don't put scrollbars in @@ -2822,11 +2827,11 @@ nsCSSFrameConstructor::SetUpDocElementContainingBlock(nsIContent* aDocElement) FinishBuildingScrollFrame(parentFrame, rootFrame); } - if (isPaginated) { // paginated + if (isPaginated) { // Create the first page // Set the initial child lists - nsIFrame* canvasFrame; - nsIFrame* pageFrame = + nsContainerFrame* canvasFrame; + nsContainerFrame* pageFrame = ConstructPageFrame(mPresShell, presContext, rootFrame, nullptr, canvasFrame); SetInitialSingleChild(rootFrame, pageFrame); @@ -2845,12 +2850,12 @@ nsCSSFrameConstructor::SetUpDocElementContainingBlock(nsIContent* aDocElement) } } -nsIFrame* +nsContainerFrame* nsCSSFrameConstructor::ConstructPageFrame(nsIPresShell* aPresShell, nsPresContext* aPresContext, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsIFrame* aPrevPageFrame, - nsIFrame*& aCanvasFrame) + nsContainerFrame*& aCanvasFrame) { nsStyleContext* parentStyleContext = aParentFrame->StyleContext(); nsStyleSet *styleSet = aPresShell->StyleSet(); @@ -2859,7 +2864,7 @@ nsCSSFrameConstructor::ConstructPageFrame(nsIPresShell* aPresShell, pagePseudoStyle = styleSet->ResolveAnonymousBoxStyle(nsCSSAnonBoxes::page, parentStyleContext); - nsIFrame* pageFrame = NS_NewPageFrame(aPresShell, pagePseudoStyle); + nsContainerFrame* pageFrame = NS_NewPageFrame(aPresShell, pagePseudoStyle); // Initialize the page frame and force it to have a view. This makes printing of // the pages easier and faster. @@ -2870,7 +2875,8 @@ nsCSSFrameConstructor::ConstructPageFrame(nsIPresShell* aPresShell, styleSet->ResolveAnonymousBoxStyle(nsCSSAnonBoxes::pageContent, pagePseudoStyle); - nsIFrame* pageContentFrame = NS_NewPageContentFrame(aPresShell, pageContentPseudoStyle); + nsContainerFrame* pageContentFrame = + NS_NewPageContentFrame(aPresShell, pageContentPseudoStyle); // Initialize the page content frame and force it to have a view. Also make it the // containing block for fixed elements which are repeated on every page. @@ -2904,13 +2910,13 @@ nsCSSFrameConstructor::ConstructPageFrame(nsIPresShell* aPresShell, /* static */ nsIFrame* -nsCSSFrameConstructor::CreatePlaceholderFrameFor(nsIPresShell* aPresShell, - nsIContent* aContent, - nsIFrame* aFrame, - nsStyleContext* aStyleContext, - nsIFrame* aParentFrame, - nsIFrame* aPrevInFlow, - nsFrameState aTypeBit) +nsCSSFrameConstructor::CreatePlaceholderFrameFor(nsIPresShell* aPresShell, + nsIContent* aContent, + nsIFrame* aFrame, + nsStyleContext* aStyleContext, + nsContainerFrame* aParentFrame, + nsIFrame* aPrevInFlow, + nsFrameState aTypeBit) { nsRefPtr placeholderStyle = aPresShell->StyleSet()-> ResolveStyleForNonElement(aStyleContext->GetParent()); @@ -2953,7 +2959,7 @@ ClearLazyBits(nsIContent* aStartContent, nsIContent* aEndContent) nsIFrame* nsCSSFrameConstructor::ConstructSelectFrame(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aStyleDisplay, nsFrameItems& aFrameItems) { @@ -2970,7 +2976,8 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsFrameConstructorState& aState, // The drop-down list's frame is created explicitly. The combobox frame shares its content // with the drop-down list. nsFrameState flags = NS_BLOCK_FLOAT_MGR; - nsIFrame* comboboxFrame = NS_NewComboboxControlFrame(mPresShell, styleContext, flags); + nsContainerFrame* comboboxFrame = + NS_NewComboboxControlFrame(mPresShell, styleContext, flags); // Save the history state so we don't restore during construction // since the complete tree is required before we restore. @@ -2994,7 +3001,7 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsFrameConstructorState& aState, ResolveAnonymousBoxStyle(nsCSSAnonBoxes::dropDownList, styleContext); // Create a listbox - nsIFrame* listFrame = NS_NewListControlFrame(mPresShell, listStyle); + nsContainerFrame* listFrame = NS_NewListControlFrame(mPresShell, listStyle); // Notify the listbox that it is being used as a dropdown list. nsIListControlFrame * listControlFrame = do_QueryFrame(listFrame); @@ -3011,7 +3018,8 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsFrameConstructorState& aState, // Initialize the scroll frame positioned. Note that it is NOT // initialized as absolutely positioned. - nsIFrame* scrolledFrame = NS_NewSelectsAreaFrame(mPresShell, styleContext, flags); + nsContainerFrame* scrolledFrame = + NS_NewSelectsAreaFrame(mPresShell, styleContext, flags); InitializeSelectFrame(aState, listFrame, scrolledFrame, content, comboboxFrame, listStyle, true, @@ -3045,9 +3053,9 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsFrameConstructorState& aState, } // Listbox, not combobox - nsIFrame* listFrame = NS_NewListControlFrame(mPresShell, styleContext); + nsContainerFrame* listFrame = NS_NewListControlFrame(mPresShell, styleContext); - nsIFrame* scrolledFrame = NS_NewSelectsAreaFrame( + nsContainerFrame* scrolledFrame = NS_NewSelectsAreaFrame( mPresShell, styleContext, NS_BLOCK_FLOAT_MGR); // ******* this code stolen from Initialze ScrollFrame ******** @@ -3067,25 +3075,23 @@ nsCSSFrameConstructor::ConstructSelectFrame(nsFrameConstructorState& aState, */ nsresult nsCSSFrameConstructor::InitializeSelectFrame(nsFrameConstructorState& aState, - nsIFrame* scrollFrame, - nsIFrame* scrolledFrame, + nsContainerFrame* scrollFrame, + nsContainerFrame* scrolledFrame, nsIContent* aContent, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsStyleContext* aStyleContext, bool aBuildCombobox, PendingBinding* aPendingBinding, nsFrameItems& aFrameItems) { - const nsStyleDisplay* display = aStyleContext->StyleDisplay(); - // Initialize it - nsIFrame* geometricParent = aState.GetGeometricParent(display, aParentFrame); + nsContainerFrame* geometricParent = + aState.GetGeometricParent(aStyleContext->StyleDisplay(), aParentFrame); // We don't call InitAndRestoreFrame for scrollFrame because we can only // restore the frame state after its parts have been created (in particular, // the scrollable view). So we have to split Init and Restore. - // Initialize the frame scrollFrame->Init(aContent, geometricParent, nullptr); if (!aBuildCombobox) { @@ -3119,14 +3125,14 @@ nsCSSFrameConstructor::InitializeSelectFrame(nsFrameConstructorState& aState, nsIFrame* nsCSSFrameConstructor::ConstructFieldSetFrame(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aStyleDisplay, nsFrameItems& aFrameItems) { nsIContent* const content = aItem.mContent; nsStyleContext* const styleContext = aItem.mStyleContext; - nsIFrame* fieldsetFrame = NS_NewFieldSetFrame(mPresShell, styleContext); + nsContainerFrame* fieldsetFrame = NS_NewFieldSetFrame(mPresShell, styleContext); // Initialize it InitAndRestoreFrame(aState, content, @@ -3140,7 +3146,7 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsFrameConstructorState& aState, const nsStyleDisplay* fieldsetContentDisplay = fieldsetContentStyle->StyleDisplay(); bool isScrollable = fieldsetContentDisplay->IsScrollableOverflow(); - nsIFrame* scrollFrame = nullptr; + nsContainerFrame* scrollFrame = nullptr; if (isScrollable) { fieldsetContentStyle = BeginBuildingScrollFrame(aState, content, fieldsetContentStyle, @@ -3148,9 +3154,9 @@ nsCSSFrameConstructor::ConstructFieldSetFrame(nsFrameConstructorState& aState, false, scrollFrame); } - nsIFrame* blockFrame = NS_NewBlockFrame(mPresShell, fieldsetContentStyle, - NS_BLOCK_FLOAT_MGR | - NS_BLOCK_MARGIN_ROOT); + nsContainerFrame* blockFrame = + NS_NewBlockFrame(mPresShell, fieldsetContentStyle, + NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT); InitAndRestoreFrame(aState, content, scrollFrame ? scrollFrame : fieldsetFrame, blockFrame); @@ -3252,7 +3258,7 @@ void nsCSSFrameConstructor::ConstructTextFrame(const FrameConstructionData* aData, nsFrameConstructorState& aState, nsIContent* aContent, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsStyleContext* aStyleContext, nsFrameItems& aFrameItems) { @@ -3572,7 +3578,7 @@ nsCSSFrameConstructor::FindCanvasData(Element* aElement, void nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aItem, nsFrameConstructorState& aState, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsFrameItems& aFrameItems) { const FrameConstructionData* data = aItem.mFCData; @@ -3669,7 +3675,7 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt nsGkAtoms::popupSetFrame), "Should have a containing block here!"); - nsIFrame* geometricParent = + nsContainerFrame* geometricParent = isPopup ? aState.mPopupItems.containingBlock : (allowOutOfFlow ? aState.GetGeometricParent(display, aParentFrame) : aParentFrame); @@ -3678,8 +3684,10 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt nsIFrame* frameToAddToList = nullptr; if ((bits & FCDATA_MAY_NEED_SCROLLFRAME) && display->IsScrollableOverflow()) { + nsContainerFrame* scrollframe = nullptr; BuildScrollFrame(aState, content, styleContext, newFrame, - geometricParent, frameToAddToList); + geometricParent, scrollframe); + frameToAddToList = scrollframe; } else { InitAndRestoreFrame(aState, content, geometricParent, newFrame); // See whether we need to create a view @@ -3706,9 +3714,10 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt nsIFrame* blockFrame = NS_NewBlockFormattingContext(mPresShell, blockContext); - InitAndRestoreFrame(aState, content, newFrame, blockFrame); + nsContainerFrame* container = static_cast(newFrame); + InitAndRestoreFrame(aState, content, container, blockFrame); - SetInitialSingleChild(newFrame, blockFrame); + SetInitialSingleChild(container, blockFrame); // Now figure out whether newFrame or blockFrame should be the // absolute container. It should be the latter if it's @@ -3726,117 +3735,121 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt aState.AddChild(frameToAddToList, aFrameItems, content, styleContext, aParentFrame, allowOutOfFlow, allowOutOfFlow, isPopup); + nsContainerFrame* newFrameAsContainer = do_QueryFrame(newFrame); + if (newFrameAsContainer) { #ifdef MOZ_XUL - // Icky XUL stuff, sadly + // Icky XUL stuff, sadly - if (aItem.mIsRootPopupgroup) { - NS_ASSERTION(nsIRootBox::GetRootBox(mPresShell) && - nsIRootBox::GetRootBox(mPresShell)->GetPopupSetFrame() == + if (aItem.mIsRootPopupgroup) { + NS_ASSERTION(nsIRootBox::GetRootBox(mPresShell) && + nsIRootBox::GetRootBox(mPresShell)->GetPopupSetFrame() == newFrame, - "Unexpected PopupSetFrame"); - aState.mPopupItems.containingBlock = newFrame; - aState.mHavePendingPopupgroup = false; - } + "Unexpected PopupSetFrame"); + aState.mPopupItems.containingBlock = newFrameAsContainer; + aState.mHavePendingPopupgroup = false; + } #endif /* MOZ_XUL */ - // Process the child content if requested - nsFrameItems childItems; - nsFrameConstructorSaveState absoluteSaveState; + // Process the child content if requested + nsFrameItems childItems; + nsFrameConstructorSaveState absoluteSaveState; - if (bits & FCDATA_FORCE_NULL_ABSPOS_CONTAINER) { - aState.PushAbsoluteContainingBlock(nullptr, nullptr, absoluteSaveState); - } else if (!(bits & FCDATA_SKIP_ABSPOS_PUSH)) { - nsIFrame* cb = maybeAbsoluteContainingBlock; - cb->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN); - // This check is identical to nsStyleDisplay::IsPositioned except without - // the assertion that the style display and frame match. When constructing - // scroll frames we intentionally use the style display for the outer, but - // make the inner the containing block. - if ((maybeAbsoluteContainingBlockDisplay->IsAbsolutelyPositionedStyle() || - maybeAbsoluteContainingBlockDisplay->IsRelativelyPositionedStyle() || - (maybeAbsoluteContainingBlockDisplay->HasTransformStyle() && - cb->IsFrameOfType(nsIFrame::eSupportsCSSTransforms)) || - maybeAbsoluteContainingBlockDisplay->HasPerspectiveStyle()) && - !cb->IsSVGText()) { - aState.PushAbsoluteContainingBlock(cb, cb, absoluteSaveState); + if (bits & FCDATA_FORCE_NULL_ABSPOS_CONTAINER) { + aState.PushAbsoluteContainingBlock(nullptr, nullptr, absoluteSaveState); + } else if (!(bits & FCDATA_SKIP_ABSPOS_PUSH)) { + nsIFrame* cb = maybeAbsoluteContainingBlock; + cb->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN); + // This check is identical to nsStyleDisplay::IsPositioned except without + // the assertion that the style display and frame match. When constructing + // scroll frames we intentionally use the style display for the outer, but + // make the inner the containing block. + if ((maybeAbsoluteContainingBlockDisplay->IsAbsolutelyPositionedStyle() || + maybeAbsoluteContainingBlockDisplay->IsRelativelyPositionedStyle() || + (maybeAbsoluteContainingBlockDisplay->HasTransformStyle() && + cb->IsFrameOfType(nsIFrame::eSupportsCSSTransforms)) || + maybeAbsoluteContainingBlockDisplay->HasPerspectiveStyle()) && + !cb->IsSVGText()) { + nsContainerFrame* cf = static_cast(cb); + aState.PushAbsoluteContainingBlock(cf, cf, absoluteSaveState); + } } - } - if (!aItem.mAnonChildren.IsEmpty()) { - NS_ASSERTION(!(bits & FCDATA_USE_CHILD_ITEMS), - "We should not have both anonymous and non-anonymous " - "children in a given FrameConstructorItem"); - AddFCItemsForAnonymousContent(aState, newFrame, aItem.mAnonChildren, - aItem.mChildItems); - bits |= FCDATA_USE_CHILD_ITEMS; - } - - if (bits & FCDATA_USE_CHILD_ITEMS) { - nsFrameConstructorSaveState floatSaveState; - - if (ShouldSuppressFloatingOfDescendants(newFrame)) { - aState.PushFloatContainingBlock(nullptr, floatSaveState); - } else if (newFrame->IsFloatContainingBlock()) { - aState.PushFloatContainingBlock(newFrame, floatSaveState); + if (!aItem.mAnonChildren.IsEmpty()) { + NS_ASSERTION(!(bits & FCDATA_USE_CHILD_ITEMS), + "We should not have both anonymous and non-anonymous " + "children in a given FrameConstructorItem"); + AddFCItemsForAnonymousContent(aState, newFrameAsContainer, aItem.mAnonChildren, + aItem.mChildItems); + bits |= FCDATA_USE_CHILD_ITEMS; } - ConstructFramesFromItemList(aState, aItem.mChildItems, newFrame, - childItems); - } else { - // Process the child frames. - ProcessChildren(aState, content, styleContext, newFrame, - !(bits & FCDATA_DISALLOW_GENERATED_CONTENT), - childItems, - (bits & FCDATA_ALLOW_BLOCK_STYLES) != 0, - aItem.mPendingBinding, possiblyLeafFrame); + + if (bits & FCDATA_USE_CHILD_ITEMS) { + nsFrameConstructorSaveState floatSaveState; + + if (ShouldSuppressFloatingOfDescendants(newFrame)) { + aState.PushFloatContainingBlock(nullptr, floatSaveState); + } else if (newFrame->IsFloatContainingBlock()) { + aState.PushFloatContainingBlock(newFrameAsContainer, floatSaveState); + } + ConstructFramesFromItemList(aState, aItem.mChildItems, newFrameAsContainer, + childItems); + } else { + // Process the child frames. + ProcessChildren(aState, content, styleContext, newFrameAsContainer, + !(bits & FCDATA_DISALLOW_GENERATED_CONTENT), + childItems, + (bits & FCDATA_ALLOW_BLOCK_STYLES) != 0, + aItem.mPendingBinding, possiblyLeafFrame); + } + + if (bits & FCDATA_WRAP_KIDS_IN_BLOCKS) { + nsFrameItems newItems; + nsFrameItems currentBlockItems; + nsIFrame* f; + while ((f = childItems.FirstChild()) != nullptr) { + bool wrapFrame = IsInlineFrame(f) || IsFramePartOfIBSplit(f); + if (!wrapFrame) { + FlushAccumulatedBlock(aState, content, newFrameAsContainer, + currentBlockItems, newItems); + } + + childItems.RemoveFrame(f); + if (wrapFrame) { + currentBlockItems.AddChild(f); + } else { + newItems.AddChild(f); + } + } + FlushAccumulatedBlock(aState, content, newFrameAsContainer, + currentBlockItems, newItems); + + if (childItems.NotEmpty()) { + // an error must have occurred, delete unprocessed frames + childItems.DestroyFrames(); + } + + childItems = newItems; + } + + // Set the frame's initial child list + // Note that MathML depends on this being called even if + // childItems is empty! + newFrameAsContainer->SetInitialChildList(kPrincipalList, childItems); } + } #ifdef MOZ_XUL - // More icky XUL stuff - if (aItem.mNameSpaceID == kNameSpaceID_XUL && - (aItem.mTag == nsGkAtoms::treechildren || // trees always need titletips - content->HasAttr(kNameSpaceID_None, nsGkAtoms::tooltiptext) || - content->HasAttr(kNameSpaceID_None, nsGkAtoms::tooltip))) { - nsIRootBox* rootBox = nsIRootBox::GetRootBox(mPresShell); - if (rootBox) { - rootBox->AddTooltipSupport(content); - } + // More icky XUL stuff + if (aItem.mNameSpaceID == kNameSpaceID_XUL && + (aItem.mTag == nsGkAtoms::treechildren || // trees always need titletips + content->HasAttr(kNameSpaceID_None, nsGkAtoms::tooltiptext) || + content->HasAttr(kNameSpaceID_None, nsGkAtoms::tooltip))) { + nsIRootBox* rootBox = nsIRootBox::GetRootBox(mPresShell); + if (rootBox) { + rootBox->AddTooltipSupport(content); } -#endif - - if (bits & FCDATA_WRAP_KIDS_IN_BLOCKS) { - nsFrameItems newItems; - nsFrameItems currentBlockItems; - nsIFrame* f; - while ((f = childItems.FirstChild()) != nullptr) { - bool wrapFrame = IsInlineFrame(f) || IsFramePartOfIBSplit(f); - if (!wrapFrame) { - FlushAccumulatedBlock(aState, content, newFrame, - currentBlockItems, newItems); - } - - childItems.RemoveFrame(f); - if (wrapFrame) { - currentBlockItems.AddChild(f); - } else { - newItems.AddChild(f); - } - } - FlushAccumulatedBlock(aState, content, newFrame, - currentBlockItems, newItems); - - if (childItems.NotEmpty()) { - // an error must have occurred, delete unprocessed frames - childItems.DestroyFrames(); - } - - childItems = newItems; - } - - // Set the frame's initial child list - // Note that MathML depends on this being called even if - // childItems is empty! - newFrame->SetInitialChildList(kPrincipalList, childItems); } +#endif NS_ASSERTION(newFrame->IsFrameOfType(nsIFrame::eLineParticipant) == ((bits & FCDATA_IS_LINE_PARTICIPANT) != 0), @@ -3864,7 +3877,7 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt nsresult nsCSSFrameConstructor::CreateAnonymousFrames(nsFrameConstructorState& aState, nsIContent* aParent, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, PendingBinding* aPendingBinding, nsFrameItems& aChildItems) { @@ -4279,12 +4292,12 @@ already_AddRefed nsCSSFrameConstructor::BeginBuildingScrollFrame(nsFrameConstructorState& aState, nsIContent* aContent, nsStyleContext* aContentStyle, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsIAtom* aScrolledPseudo, bool aIsRoot, - nsIFrame*& aNewFrame) + nsContainerFrame*& aNewFrame) { - nsIFrame* gfxScrollFrame = aNewFrame; + nsContainerFrame* gfxScrollFrame = aNewFrame; nsFrameItems anonymousItems; @@ -4330,14 +4343,13 @@ nsCSSFrameConstructor::BeginBuildingScrollFrame(nsFrameConstructorState& aState, } void -nsCSSFrameConstructor::FinishBuildingScrollFrame(nsIFrame* aScrollFrame, +nsCSSFrameConstructor::FinishBuildingScrollFrame(nsContainerFrame* aScrollFrame, nsIFrame* aScrolledFrame) { nsFrameList scrolled(aScrolledFrame, aScrolledFrame); aScrollFrame->AppendFrames(kPrincipalList, scrolled); } - /** * Called to wrap a gfx scrollframe around a frame. The hierarchy will look like this * @@ -4374,8 +4386,8 @@ nsCSSFrameConstructor::BuildScrollFrame(nsFrameConstructorState& aState, nsIContent* aContent, nsStyleContext* aContentStyle, nsIFrame* aScrolledFrame, - nsIFrame* aParentFrame, - nsIFrame*& aNewFrame) + nsContainerFrame* aParentFrame, + nsContainerFrame*& aNewFrame) { nsRefPtr scrolledContentStyle = BeginBuildingScrollFrame(aState, aContent, aContentStyle, aParentFrame, @@ -4519,14 +4531,14 @@ nsCSSFrameConstructor::FindDisplayData(const nsStyleDisplay* aDisplay, nsIFrame* nsCSSFrameConstructor::ConstructScrollableBlock(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aDisplay, nsFrameItems& aFrameItems) { nsIContent* const content = aItem.mContent; nsStyleContext* const styleContext = aItem.mStyleContext; - nsIFrame* newFrame = nullptr; + nsContainerFrame* newFrame = nullptr; nsRefPtr scrolledContentStyle = BeginBuildingScrollFrame(aState, content, styleContext, aState.GetGeometricParent(aDisplay, aParentFrame), @@ -4535,7 +4547,7 @@ nsCSSFrameConstructor::ConstructScrollableBlock(nsFrameConstructorState& aState, // Create our block frame // pass a temporary stylecontext, the correct one will be set later - nsIFrame* scrolledFrame = + nsContainerFrame* scrolledFrame = NS_NewBlockFormattingContext(mPresShell, styleContext); // Make sure to AddChild before we call ConstructBlock so that we @@ -4559,7 +4571,7 @@ nsCSSFrameConstructor::ConstructScrollableBlock(nsFrameConstructorState& aState, nsIFrame* nsCSSFrameConstructor::ConstructNonScrollableBlock(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aDisplay, nsFrameItems& aFrameItems) { @@ -4571,7 +4583,7 @@ nsCSSFrameConstructor::ConstructNonScrollableBlock(nsFrameConstructorState& aSta // we can check it later in nsFrame::ApplyPaginatedOverflowClipping. bool clipPaginatedOverflow = (aItem.mFCData->mBits & FCDATA_FORCED_NON_SCROLLABLE_BLOCK) != 0; - nsIFrame* newFrame; + nsContainerFrame* newFrame; if ((aDisplay->IsAbsolutelyPositionedStyle() || aDisplay->IsFloatingStyle() || NS_STYLE_DISPLAY_INLINE_BLOCK == aDisplay->mDisplay || @@ -4598,7 +4610,7 @@ nsCSSFrameConstructor::ConstructNonScrollableBlock(nsFrameConstructorState& aSta void nsCSSFrameConstructor::InitAndRestoreFrame(const nsFrameConstructorState& aState, nsIContent* aContent, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsIFrame* aNewFrame, bool aAllowCounters) { @@ -4676,7 +4688,7 @@ nsCSSFrameConstructor::ResolveStyleContext(nsStyleContext* aParentStyleContext, void nsCSSFrameConstructor::FlushAccumulatedBlock(nsFrameConstructorState& aState, nsIContent* aContent, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsFrameItems& aBlockItems, nsFrameItems& aNewItems) { @@ -4791,15 +4803,15 @@ nsCSSFrameConstructor::FindMathMLData(Element* aElement, } -nsIFrame* +nsContainerFrame* nsCSSFrameConstructor::ConstructFrameWithAnonymousChild( nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aDisplay, nsFrameItems& aFrameItems, - FrameCreationFunc aConstructor, - FrameCreationFunc aInnerConstructor, + ContainerFrameCreationFunc aConstructor, + ContainerFrameCreationFunc aInnerConstructor, nsICSSAnonBoxPseudo* aInnerPseudo, bool aCandidateRootFrame) { @@ -4807,7 +4819,7 @@ nsCSSFrameConstructor::ConstructFrameWithAnonymousChild( nsStyleContext* const styleContext = aItem.mStyleContext; // Create the outer frame: - nsIFrame* newFrame = aConstructor(mPresShell, styleContext); + nsContainerFrame* newFrame = aConstructor(mPresShell, styleContext); InitAndRestoreFrame(aState, content, aCandidateRootFrame ? @@ -4822,7 +4834,7 @@ nsCSSFrameConstructor::ConstructFrameWithAnonymousChild( ResolveAnonymousBoxStyle(aInnerPseudo, styleContext); // Create the anonymous inner wrapper frame - nsIFrame* innerFrame = aInnerConstructor(mPresShell, scForAnon); + nsContainerFrame* innerFrame = aInnerConstructor(mPresShell, scForAnon); InitAndRestoreFrame(aState, content, newFrame, innerFrame); @@ -4862,7 +4874,7 @@ nsCSSFrameConstructor::ConstructFrameWithAnonymousChild( nsIFrame* nsCSSFrameConstructor::ConstructOuterSVG(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aDisplay, nsFrameItems& aFrameItems) { @@ -4875,7 +4887,7 @@ nsCSSFrameConstructor::ConstructOuterSVG(nsFrameConstructorState& aState, nsIFrame* nsCSSFrameConstructor::ConstructMarker(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aDisplay, nsFrameItems& aFrameItems) { @@ -5151,7 +5163,7 @@ void nsCSSFrameConstructor::AddFrameConstructionItems(nsFrameConstructorState& aState, nsIContent* aContent, bool aSuppressWhiteSpaceOptimizations, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, FrameConstructionItemList& aItems) { aContent->UnsetFlags(NODE_DESCENDANTS_NEED_FRAMES | NODE_NEEDS_FRAME); @@ -5226,7 +5238,7 @@ nsCSSFrameConstructor::SetAsUndisplayedContent(FrameConstructionItemList& aList, void nsCSSFrameConstructor::AddFrameConstructionItemsInternal(nsFrameConstructorState& aState, nsIContent* aContent, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsIAtom* aTag, int32_t aNameSpaceID, bool aSuppressWhiteSpaceOptimizations, @@ -5582,13 +5594,13 @@ nsCSSFrameConstructor::AtLineBoundary(FCItemIterator& aIter) void nsCSSFrameConstructor::ConstructFramesFromItem(nsFrameConstructorState& aState, FCItemIterator& aIter, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsFrameItems& aFrameItems) { - nsIFrame* adjParentFrame = aParentFrame; + nsContainerFrame* adjParentFrame = aParentFrame; FrameConstructionItem& item = aIter.item(); nsStyleContext* styleContext = item.mStyleContext; - AdjustParentFrame(adjParentFrame, item.mFCData, styleContext); + AdjustParentFrame(&adjParentFrame, item.mFCData, styleContext); if (item.mIsText) { // If this is collapsible whitespace next to a line boundary, @@ -5668,7 +5680,7 @@ nsCSSFrameConstructor::ReconstructDocElementHierarchy() return RecreateFramesForContent(rootElement, false); } -nsIFrame* +nsContainerFrame* nsCSSFrameConstructor::GetAbsoluteContainingBlock(nsIFrame* aFrame, ContainingBlockType aType) { @@ -5727,7 +5739,9 @@ nsCSSFrameConstructor::GetAbsoluteContainingBlock(nsIFrame* aFrame, continue; } // For outer table frames, we can just return absPosCBCandidate. - return absPosCBCandidate; + MOZ_ASSERT((nsContainerFrame*)do_QueryFrame(absPosCBCandidate), + "abs.pos. containing block must be nsContainerFrame sub-class"); + return static_cast(absPosCBCandidate); } // It is possible for the search for the containing block to fail, because @@ -5739,7 +5753,7 @@ nsCSSFrameConstructor::GetAbsoluteContainingBlock(nsIFrame* aFrame, return mHasRootAbsPosContainingBlock ? mDocElementContainingBlock : nullptr; } -nsIFrame* +nsContainerFrame* nsCSSFrameConstructor::GetFloatContainingBlock(nsIFrame* aFrame) { // Starting with aFrame, look for a frame that is a float containing block. @@ -5751,7 +5765,9 @@ nsCSSFrameConstructor::GetFloatContainingBlock(nsIFrame* aFrame) !ShouldSuppressFloatingOfDescendants(containingBlock); containingBlock = containingBlock->GetParent()) { if (containingBlock->IsFloatContainingBlock()) { - return containingBlock; + MOZ_ASSERT((nsContainerFrame*)do_QueryFrame(containingBlock), + "float containing block must be nsContainerFrame sub-class"); + return static_cast(containingBlock); } } @@ -5856,7 +5872,7 @@ GetInsertNextSibling(nsIFrame* aParentFrame, nsIFrame* aPrevSibling) */ nsresult nsCSSFrameConstructor::AppendFramesToParent(nsFrameConstructorState& aState, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsFrameItems& aFrameList, nsIFrame* aPrevSibling, bool aIsRecursiveCall) @@ -5905,8 +5921,8 @@ nsCSSFrameConstructor::AppendFramesToParent(nsFrameConstructorState& aStat nsFrameList blockKids = aFrameList.ExtractHead(firstNonBlockEnumerator); NS_ASSERTION(blockKids.NotEmpty(), "No blocks?"); - nsIFrame* prevBlock = - GetIBSplitPrevSibling(firstContinuation)->LastContinuation(); + nsContainerFrame* prevBlock = GetIBSplitPrevSibling(firstContinuation); + prevBlock = static_cast(prevBlock->LastContinuation()); NS_ASSERTION(prevBlock, "Should have previous block here"); MoveChildrenTo(aState.mPresContext, aParentFrame, prevBlock, blockKids); @@ -6277,7 +6293,7 @@ MaybeGetListBoxBodyFrame(nsIContent* aContainer, nsIContent* aChild) void nsCSSFrameConstructor::AddTextItemIfNeeded(nsFrameConstructorState& aState, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsIContent* aPossibleTextContent, FrameConstructionItemList& aItems) { @@ -6736,7 +6752,7 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer, // See if the containing block has :first-letter style applied. bool haveFirstLetterStyle = false, haveFirstLineStyle = false; - nsIFrame* containingBlock = state.mFloatedItems.containingBlock; + nsContainerFrame* containingBlock = state.mFloatedItems.containingBlock; if (containingBlock) { haveFirstLetterStyle = HasFirstLetterStyle(containingBlock); haveFirstLineStyle = @@ -6847,7 +6863,7 @@ nsCSSFrameConstructor::ContentAppended(nsIContent* aContainer, // need special treatment if (captionItems.NotEmpty()) { // append the caption to the outer table NS_ASSERTION(nsGkAtoms::tableFrame == frameType, "how did that happen?"); - nsIFrame* outerTable = parentFrame->GetParent(); + nsContainerFrame* outerTable = parentFrame->GetParent(); AppendFrames(outerTable, nsIFrame::kCaptionList, captionItems); } @@ -7188,7 +7204,7 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer, // reason we care is that the internal structure in these cases // is not the normal structure and requires custom updating // logic. - nsIFrame* containingBlock = state.mFloatedItems.containingBlock; + nsContainerFrame* containingBlock = state.mFloatedItems.containingBlock; bool haveFirstLetterStyle = false; bool haveFirstLineStyle = false; @@ -7434,7 +7450,7 @@ nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aContainer, aStartChild, aEndChild); } - nsIFrame* outerTable = nullptr; + nsContainerFrame* outerTable = nullptr; if (GetCaptionAdjustedParent(captionParent, captionItems.FirstChild(), &outerTable)) { // If the parent is not an outer table frame we will try to add frames @@ -7645,7 +7661,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer, inflowChild = GetPlaceholderFrameFor(childFrame); NS_ASSERTION(inflowChild, "No placeholder for out-of-flow?"); } - nsIFrame* containingBlock = + nsContainerFrame* containingBlock = GetFloatContainingBlock(inflowChild->GetParent()); bool haveFLS = containingBlock && HasFirstLetterStyle(containingBlock); if (haveFLS) { @@ -7713,7 +7729,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer, mPageSequenceFrame = nullptr; mGfxScrollFrame = nullptr; mHasRootAbsPosContainingBlock = false; - mFixedContainingBlock = GetRootFrame(); + mFixedContainingBlock = static_cast(GetRootFrame()); } if (haveFLS && mRootElementFrame) { @@ -7875,7 +7891,7 @@ nsCSSFrameConstructor::CharacterDataChanged(nsIContent* aContent, // completely barf on it. And recreating the non-anonymous ancestor would // just lead us to come back into this notification (e.g. if quotes or // counters are involved), leading to a loop. - nsIFrame* block = GetFloatContainingBlock(frame); + nsContainerFrame* block = GetFloatContainingBlock(frame); bool haveFirstLetterStyle = false; if (block) { // See if the block has first-letter style applied to it. @@ -7994,14 +8010,14 @@ void nsCSSFrameConstructor::GetAlternateTextFor(nsIContent* aContent, } nsIFrame* -nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresShell* aPresShell, - nsPresContext* aPresContext, - nsIFrame* aFrame, - nsIFrame* aParentFrame, - nsIContent* aContent, - nsStyleContext* aStyleContext) +nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresShell* aPresShell, + nsPresContext* aPresContext, + nsIFrame* aFrame, + nsContainerFrame* aParentFrame, + nsIContent* aContent, + nsStyleContext* aStyleContext) { - nsIFrame* newFrame = NS_NewTableOuterFrame(aPresShell, aStyleContext); + nsTableOuterFrame* newFrame = NS_NewTableOuterFrame(aPresShell, aStyleContext); newFrame->Init(aContent, aParentFrame, aFrame); @@ -8025,14 +8041,14 @@ nsCSSFrameConstructor::CreateContinuingOuterTableFrame(nsIPresShell* aPresShe } nsIFrame* -nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresShell* aPresShell, - nsPresContext* aPresContext, - nsIFrame* aFrame, - nsIFrame* aParentFrame, - nsIContent* aContent, - nsStyleContext* aStyleContext) +nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresShell* aPresShell, + nsPresContext* aPresContext, + nsIFrame* aFrame, + nsContainerFrame* aParentFrame, + nsIContent* aContent, + nsStyleContext* aStyleContext) { - nsIFrame* newFrame = NS_NewTableFrame(aPresShell, aStyleContext); + nsTableFrame* newFrame = NS_NewTableFrame(aPresShell, aStyleContext); newFrame->Init(aContent, aParentFrame, aFrame); @@ -8092,10 +8108,10 @@ nsCSSFrameConstructor::CreateContinuingTableFrame(nsIPresShell* aPresShell, } nsIFrame* -nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext, - nsIFrame* aFrame, - nsIFrame* aParentFrame, - bool aIsFluid) +nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext, + nsIFrame* aFrame, + nsContainerFrame* aParentFrame, + bool aIsFluid) { nsIPresShell* shell = aPresContext->PresShell(); nsStyleContext* styleContext = aFrame->StyleContext(); @@ -8128,7 +8144,7 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext, newFrame = NS_NewColumnSetFrame(shell, styleContext, nsFrameState(0)); newFrame->Init(content, aParentFrame, aFrame); } else if (nsGkAtoms::pageFrame == frameType) { - nsIFrame* canvasFrame; + nsContainerFrame* canvasFrame; newFrame = ConstructPageFrame(shell, aPresContext, aParentFrame, aFrame, canvasFrame); } else if (nsGkAtoms::tableOuterFrame == frameType) { @@ -8162,7 +8178,8 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext, // See if it's a table cell frame if (IS_TABLE_CELL(cellFrame->GetType())) { nsIFrame* continuingCellFrame = - CreateContinuingFrame(aPresContext, cellFrame, newFrame); + CreateContinuingFrame(aPresContext, cellFrame, + static_cast(newFrame)); newChildList.AddChild(continuingCellFrame); } cellFrame = cellFrame->GetNextSibling(); @@ -8185,7 +8202,8 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext, // Create a continuing area frame nsIFrame* blockFrame = aFrame->GetFirstPrincipalChild(); nsIFrame* continuingBlockFrame = - CreateContinuingFrame(aPresContext, blockFrame, newFrame); + CreateContinuingFrame(aPresContext, blockFrame, + static_cast(newFrame)); // Set the table cell's initial child list SetInitialSingleChild(newFrame, continuingBlockFrame); @@ -8220,7 +8238,8 @@ nsCSSFrameConstructor::CreateContinuingFrame(nsPresContext* aPresContext, nsIFrame* blockFrame = GetFieldSetBlockFrame(aFrame); if (blockFrame) { nsIFrame* continuingBlockFrame = - CreateContinuingFrame(aPresContext, blockFrame, newFrame); + CreateContinuingFrame(aPresContext, blockFrame, + static_cast(newFrame)); // Set the fieldset's initial child list SetInitialSingleChild(newFrame, continuingBlockFrame); } else { @@ -8283,7 +8302,8 @@ nsCSSFrameConstructor::ReplicateFixedFrames(nsPageContentFrame* aParentFrame) if (!prevPageContentFrame) { return NS_OK; } - nsIFrame* canvasFrame = aParentFrame->GetFirstPrincipalChild(); + nsContainerFrame* canvasFrame = + do_QueryFrame(aParentFrame->GetFirstPrincipalChild()); nsIFrame* prevCanvasFrame = prevPageContentFrame->GetFirstPrincipalChild(); if (!canvasFrame || !prevCanvasFrame) { // document's root element frame missing @@ -9235,7 +9255,7 @@ nsCSSFrameConstructor::CreateNeededTablePseudos(nsFrameConstructorState& aState, inline void nsCSSFrameConstructor::ConstructFramesFromItemList(nsFrameConstructorState& aState, FrameConstructionItemList& aItems, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsFrameItems& aFrameItems) { CreateNeededTablePseudos(aState, aItems, aParentFrame); @@ -9255,7 +9275,7 @@ nsCSSFrameConstructor::ConstructFramesFromItemList(nsFrameConstructorState& aSta void nsCSSFrameConstructor::AddFCItemsForAnonymousContent( nsFrameConstructorState& aState, - nsIFrame* aFrame, + nsContainerFrame* aFrame, nsTArray& aAnonymousItems, FrameConstructionItemList& aItemsToConstruct, uint32_t aExtraFlags) @@ -9310,7 +9330,7 @@ void nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState, nsIContent* aContent, nsStyleContext* aStyleContext, - nsIFrame* aFrame, + nsContainerFrame* aFrame, const bool aCanHaveGeneratedContent, nsFrameItems& aFrameItems, const bool aAllowBlockStyles, @@ -9318,8 +9338,7 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState, nsIFrame* aPossiblyLeafFrame) { NS_PRECONDITION(aFrame, "Must have parent frame here"); - NS_PRECONDITION(!aFrame->GetContentInsertionFrame() || - aFrame->GetContentInsertionFrame() == aFrame, + NS_PRECONDITION(aFrame->GetContentInsertionFrame() == aFrame, "Parent frame in ProcessChildren should be its own " "content insertion frame"); const uint32_t kMaxDepth = 2 * MAX_REFLOW_DEPTH; @@ -9347,7 +9366,8 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState, if (ShouldSuppressFloatingOfDescendants(aFrame)) { aState.PushFloatContainingBlock(nullptr, floatSaveState); } else if (aFrame->IsFloatContainingBlock()) { - aState.PushFloatContainingBlock(aFrame, floatSaveState); + aState.PushFloatContainingBlock(static_cast(aFrame), + floatSaveState); } nsFrameConstructorState::PendingBindingAutoPusher pusher(aState, @@ -9527,7 +9547,7 @@ void nsCSSFrameConstructor::WrapFramesInFirstLineFrame( nsFrameConstructorState& aState, nsIContent* aBlockContent, - nsIFrame* aBlockFrame, + nsContainerFrame* aBlockFrame, nsFirstLineFrame* aLineFrame, nsFrameItems& aFrameItems) { @@ -9584,7 +9604,7 @@ void nsCSSFrameConstructor::AppendFirstLineFrames( nsFrameConstructorState& aState, nsIContent* aBlockContent, - nsIFrame* aBlockFrame, + nsContainerFrame* aBlockFrame, nsFrameItems& aFrameItems) { // It's possible that aBlockFrame needs to have a first-line frame @@ -9620,7 +9640,7 @@ nsCSSFrameConstructor::InsertFirstLineFrames( nsFrameConstructorState& aState, nsIContent* aContent, nsIFrame* aBlockFrame, - nsContainerFrame** aParentFrame, + nsContainerFrame** aParentFrame, nsIFrame* aPrevSibling, nsFrameItems& aFrameItems) { @@ -9828,24 +9848,20 @@ static bool IsFirstLetterContent(nsIContent* aContent) void nsCSSFrameConstructor::CreateFloatingLetterFrame( nsFrameConstructorState& aState, - nsIFrame* aBlockFrame, + nsContainerFrame* aBlockFrame, nsIContent* aTextContent, nsIFrame* aTextFrame, - nsIContent* aBlockContent, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsStyleContext* aStyleContext, nsFrameItems& aResult) { - // Create the first-letter-frame - nsIFrame* letterFrame; - nsStyleSet *styleSet = mPresShell->StyleSet(); - - letterFrame = NS_NewFirstLetterFrame(mPresShell, aStyleContext); + nsFirstLetterFrame* letterFrame = + NS_NewFirstLetterFrame(mPresShell, aStyleContext); // We don't want to use a text content for a non-text frame (because we want // its primary frame to be a text frame). So use its parent for the // first-letter. nsIContent* letterContent = aTextContent->GetParent(); - nsIFrame* containingBlock = aState.GetGeometricParent( + nsContainerFrame* containingBlock = aState.GetGeometricParent( aStyleContext->StyleDisplay(), aParentFrame); InitAndRestoreFrame(aState, letterContent, containingBlock, letterFrame); @@ -9854,6 +9870,7 @@ nsCSSFrameConstructor::CreateFloatingLetterFrame( // letter frame and will have the float property set on it; the text // frame shouldn't have that set). nsRefPtr textSC; + nsStyleSet* styleSet = mPresShell->StyleSet(); textSC = styleSet->ResolveStyleForNonElement(aStyleContext); aTextFrame->SetStyleContextWithoutNotification(textSC); InitAndRestoreFrame(aState, aTextContent, letterFrame, aTextFrame); @@ -9901,10 +9918,10 @@ nsCSSFrameConstructor::CreateFloatingLetterFrame( * a child of aParentFrame. */ void -nsCSSFrameConstructor::CreateLetterFrame(nsIFrame* aBlockFrame, - nsIFrame* aBlockContinuation, +nsCSSFrameConstructor::CreateLetterFrame(nsContainerFrame* aBlockFrame, + nsContainerFrame* aBlockContinuation, nsIContent* aTextContent, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsFrameItems& aResult) { NS_PRECONDITION(aTextContent->IsNodeOfType(nsINode::eTEXT), @@ -9951,11 +9968,11 @@ nsCSSFrameConstructor::CreateLetterFrame(nsIFrame* aBlockFrame, if (display->IsFloatingStyle() && !aParentFrame->IsSVGText()) { // Make a floating first-letter frame CreateFloatingLetterFrame(state, aBlockFrame, aTextContent, textFrame, - blockContent, aParentFrame, sc, aResult); + aParentFrame, sc, aResult); } else { // Make an inflow first-letter frame - nsIFrame* letterFrame = NS_NewFirstLetterFrame(mPresShell, sc); + nsFirstLetterFrame* letterFrame = NS_NewFirstLetterFrame(mPresShell, sc); // Initialize the first-letter-frame. We don't want to use a text // content for a non-text frame (because we want its primary frame to @@ -9979,12 +9996,12 @@ nsCSSFrameConstructor::CreateLetterFrame(nsIFrame* aBlockFrame, void nsCSSFrameConstructor::WrapFramesInFirstLetterFrame( nsIContent* aBlockContent, - nsIFrame* aBlockFrame, + nsContainerFrame* aBlockFrame, nsFrameItems& aBlockFrames) { aBlockFrame->AddStateBits(NS_BLOCK_HAS_FIRST_LETTER_STYLE); - nsIFrame* parentFrame = nullptr; + nsContainerFrame* parentFrame = nullptr; nsIFrame* textFrame = nullptr; nsIFrame* prevFrame = nullptr; nsFrameItems letterFrames; @@ -10012,15 +10029,15 @@ nsCSSFrameConstructor::WrapFramesInFirstLetterFrame( void nsCSSFrameConstructor::WrapFramesInFirstLetterFrame( - nsIFrame* aBlockFrame, - nsIFrame* aBlockContinuation, - nsIFrame* aParentFrame, + nsContainerFrame* aBlockFrame, + nsContainerFrame* aBlockContinuation, + nsContainerFrame* aParentFrame, nsIFrame* aParentFrameList, - nsIFrame** aModifiedParent, + nsContainerFrame** aModifiedParent, nsIFrame** aTextFrame, nsIFrame** aPrevFrame, nsFrameItems& aLetterFrames, - bool* aStopLooking) + bool* aStopLooking) { nsIFrame* prevFrame = nullptr; nsIFrame* frame = aParentFrameList; @@ -10047,7 +10064,8 @@ nsCSSFrameConstructor::WrapFramesInFirstLetterFrame( } else if (IsInlineFrame(frame) && frameType != nsGkAtoms::brFrame) { nsIFrame* kids = frame->GetFirstPrincipalChild(); - WrapFramesInFirstLetterFrame(aBlockFrame, aBlockContinuation, frame, + WrapFramesInFirstLetterFrame(aBlockFrame, aBlockContinuation, + static_cast(frame), kids, aModifiedParent, aTextFrame, aPrevFrame, aLetterFrames, aStopLooking); if (*aStopLooking) { @@ -10108,14 +10126,12 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames( } // Discover the placeholder frame for the letter frame - nsIFrame* parentFrame; nsPlaceholderFrame* placeholderFrame = GetPlaceholderFrameFor(floatFrame); - if (!placeholderFrame) { // Somethings really wrong return NS_OK; } - parentFrame = placeholderFrame->GetParent(); + nsContainerFrame* parentFrame = placeholderFrame->GetParent(); if (!parentFrame) { // Somethings really wrong return NS_OK; @@ -10179,8 +10195,8 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames( nsresult nsCSSFrameConstructor::RemoveFirstLetterFrames(nsPresContext* aPresContext, nsIPresShell* aPresShell, - nsIFrame* aFrame, - nsIFrame* aBlockFrame, + nsContainerFrame* aFrame, + nsContainerFrame* aBlockFrame, bool* aStopLooking) { nsIFrame* prevSibling = nullptr; @@ -10239,7 +10255,8 @@ nsCSSFrameConstructor::RemoveFirstLetterFrames(nsPresContext* aPresContext, else if (IsInlineFrame(kid)) { // Look inside child inline frame for the letter frame RemoveFirstLetterFrames(aPresContext, aPresShell, - kid, aBlockFrame, aStopLooking); + static_cast(kid), + aBlockFrame, aStopLooking); if (*aStopLooking) { break; } @@ -10254,10 +10271,11 @@ nsCSSFrameConstructor::RemoveFirstLetterFrames(nsPresContext* aPresContext, nsresult nsCSSFrameConstructor::RemoveLetterFrames(nsPresContext* aPresContext, nsIPresShell* aPresShell, - nsIFrame* aBlockFrame) + nsContainerFrame* aBlockFrame) { - aBlockFrame = aBlockFrame->FirstContinuation(); - nsIFrame* continuation = aBlockFrame; + aBlockFrame = + static_cast(aBlockFrame->FirstContinuation()); + nsContainerFrame* continuation = aBlockFrame; bool stopLooking = false; nsresult rv; @@ -10271,19 +10289,21 @@ nsCSSFrameConstructor::RemoveLetterFrames(nsPresContext* aPresContext, if (stopLooking) { break; } - continuation = continuation->GetNextContinuation(); + continuation = + static_cast(continuation->GetNextContinuation()); } while (continuation); return rv; } // Fixup the letter frame situation for the given block void -nsCSSFrameConstructor::RecoverLetterFrames(nsIFrame* aBlockFrame) +nsCSSFrameConstructor::RecoverLetterFrames(nsContainerFrame* aBlockFrame) { - aBlockFrame = aBlockFrame->FirstContinuation(); - nsIFrame* continuation = aBlockFrame; + aBlockFrame = + static_cast(aBlockFrame->FirstContinuation()); + nsContainerFrame* continuation = aBlockFrame; - nsIFrame* parentFrame = nullptr; + nsContainerFrame* parentFrame = nullptr; nsIFrame* textFrame = nullptr; nsIFrame* prevFrame = nullptr; nsFrameItems letterFrames; @@ -10298,7 +10318,8 @@ nsCSSFrameConstructor::RecoverLetterFrames(nsIFrame* aBlockFrame) if (stopLooking) { break; } - continuation = continuation->GetNextContinuation(); + continuation = + static_cast(continuation->GetNextContinuation()); } while (continuation); if (parentFrame) { @@ -10315,13 +10336,13 @@ nsCSSFrameConstructor::RecoverLetterFrames(nsIFrame* aBlockFrame) // listbox Widget Routines nsresult -nsCSSFrameConstructor::CreateListBoxContent(nsPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIFrame* aPrevFrame, - nsIContent* aChild, - nsIFrame** aNewFrame, - bool aIsAppend, - bool aIsScrollbar, +nsCSSFrameConstructor::CreateListBoxContent(nsPresContext* aPresContext, + nsContainerFrame* aParentFrame, + nsIFrame* aPrevFrame, + nsIContent* aChild, + nsIFrame** aNewFrame, + bool aIsAppend, + bool aIsScrollbar, nsILayoutHistoryState* aFrameState) { #ifdef MOZ_XUL @@ -10395,25 +10416,24 @@ void nsCSSFrameConstructor::ConstructBlock(nsFrameConstructorState& aState, const nsStyleDisplay* aDisplay, nsIContent* aContent, - nsIFrame* aParentFrame, - nsIFrame* aContentParentFrame, + nsContainerFrame* aParentFrame, + nsContainerFrame* aContentParentFrame, nsStyleContext* aStyleContext, - nsIFrame** aNewFrame, + nsContainerFrame** aNewFrame, nsFrameItems& aFrameItems, nsIFrame* aPositionedFrameForAbsPosContainer, PendingBinding* aPendingBinding) { // Create column wrapper if necessary - nsIFrame* blockFrame = *aNewFrame; + nsContainerFrame* blockFrame = *aNewFrame; NS_ASSERTION(blockFrame->GetType() == nsGkAtoms::blockFrame, "not a block frame?"); - nsIFrame* parent = aParentFrame; + nsContainerFrame* parent = aParentFrame; nsRefPtr blockStyle = aStyleContext; const nsStyleColumn* columns = aStyleContext->StyleColumn(); if (columns->mColumnCount != NS_STYLE_COLUMN_COUNT_AUTO || columns->mColumnWidth.GetUnit() != eStyleUnit_Auto) { - nsIFrame* columnSetFrame = nullptr; - columnSetFrame = + nsContainerFrame* columnSetFrame = NS_NewColumnSetFrame(mPresShell, aStyleContext, nsFrameState(0)); InitAndRestoreFrame(aState, aContent, aParentFrame, columnSetFrame); @@ -10463,7 +10483,7 @@ nsCSSFrameConstructor::ConstructBlock(nsFrameConstructorState& aState, nsIFrame* nsCSSFrameConstructor::ConstructInline(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aDisplay, nsFrameItems& aFrameItems) { @@ -10532,7 +10552,7 @@ nsCSSFrameConstructor::ConstructInline(nsFrameConstructorState& aState, aDisplay->IsRelativelyPositionedStyle() && !aParentFrame->IsSVGText(); - nsIFrame* newFrame = NS_NewInlineFrame(mPresShell, styleContext); + nsInlineFrame* newFrame = NS_NewInlineFrame(mPresShell, styleContext); // Initialize the frame InitAndRestoreFrame(aState, content, aParentFrame, newFrame); @@ -10588,14 +10608,14 @@ nsCSSFrameConstructor::ConstructInline(nsFrameConstructorState& aState, void nsCSSFrameConstructor::CreateIBSiblings(nsFrameConstructorState& aState, - nsIFrame* aInitialInline, + nsContainerFrame* aInitialInline, bool aIsPositioned, nsFrameItems& aChildItems, nsFrameItems& aSiblings) { nsIContent* content = aInitialInline->GetContent(); nsStyleContext* styleContext = aInitialInline->StyleContext(); - nsIFrame* parentFrame = aInitialInline->GetParent(); + nsContainerFrame* parentFrame = aInitialInline->GetParent(); // Resolve the right style context for our anonymous blocks. // The distinction in styles is needed because of CSS 2.1, section @@ -10610,7 +10630,8 @@ nsCSSFrameConstructor::CreateIBSiblings(nsFrameConstructorState& aState, nsCSSAnonBoxes::mozAnonymousBlock, styleContext); - nsIFrame* lastNewInline = aInitialInline->FirstContinuation(); + nsContainerFrame* lastNewInline = + static_cast(aInitialInline->FirstContinuation()); do { // On entry to this loop aChildItems is not empty and the first frame in it // is block-level. @@ -10621,9 +10642,7 @@ nsCSSFrameConstructor::CreateIBSiblings(nsFrameConstructorState& aState, // The initial run of blocks belongs to an anonymous block that we create // right now. The anonymous block will be the parent of these block // children of the inline. - nsIFrame* blockFrame; - blockFrame = NS_NewBlockFrame(mPresShell, blockSC); - + nsBlockFrame* blockFrame = NS_NewBlockFrame(mPresShell, blockSC); InitAndRestoreFrame(aState, content, parentFrame, blockFrame, false); // Find the first non-block child which defines the end of our block kids @@ -10638,11 +10657,9 @@ nsCSSFrameConstructor::CreateIBSiblings(nsFrameConstructorState& aState, aSiblings.AddChild(blockFrame); // Now grab the initial inlines in aChildItems and put them into an inline - // frame - nsIFrame* inlineFrame = NS_NewInlineFrame(mPresShell, styleContext); - + // frame. + nsInlineFrame* inlineFrame = NS_NewInlineFrame(mPresShell, styleContext); InitAndRestoreFrame(aState, content, parentFrame, inlineFrame, false); - inlineFrame->AddStateBits(NS_FRAME_MAY_HAVE_GENERATED_CONTENT | NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN); if (aIsPositioned) { @@ -11178,7 +11195,7 @@ nsCSSFrameConstructor::ReframeContainingBlock(nsIFrame* aFrame) } nsresult -nsCSSFrameConstructor::GenerateChildFrames(nsIFrame* aFrame) +nsCSSFrameConstructor::GenerateChildFrames(nsContainerFrame* aFrame) { { nsAutoScriptBlocker scriptBlocker; diff --git a/layout/base/nsCSSFrameConstructor.h b/layout/base/nsCSSFrameConstructor.h index a7cec092af57..c97555deb17c 100644 --- a/layout/base/nsCSSFrameConstructor.h +++ b/layout/base/nsCSSFrameConstructor.h @@ -210,7 +210,7 @@ public: nsIFrame* EnsureFrameForTextNode(nsGenericDOMDataNode* aContent); // generate the child frames and process bindings - nsresult GenerateChildFrames(nsIFrame* aFrame); + nsresult GenerateChildFrames(nsContainerFrame* aFrame); // Should be called when a frame is going to be destroyed and // WillDestroyFrameTree hasn't been called yet. @@ -225,10 +225,10 @@ public: void WillDestroyFrameTree(); // Request to create a continuing frame. This method never returns null. - nsIFrame* CreateContinuingFrame(nsPresContext* aPresContext, - nsIFrame* aFrame, - nsIFrame* aParentFrame, - bool aIsFluid = true); + nsIFrame* CreateContinuingFrame(nsPresContext* aPresContext, + nsIFrame* aFrame, + nsContainerFrame* aParentFrame, + bool aIsFluid = true); // Copy over fixed frames from aParentFrame's prev-in-flow nsresult ReplicateFixedFrames(nsPageContentFrame* aParentFrame); @@ -238,41 +238,41 @@ public: nsIContent* aChildContent, bool* aMultiple = nullptr); - nsresult CreateListBoxContent(nsPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIFrame* aPrevFrame, - nsIContent* aChild, - nsIFrame** aResult, - bool aIsAppend, - bool aIsScrollbar, + nsresult CreateListBoxContent(nsPresContext* aPresContext, + nsContainerFrame* aParentFrame, + nsIFrame* aPrevFrame, + nsIContent* aChild, + nsIFrame** aResult, + bool aIsAppend, + bool aIsScrollbar, nsILayoutHistoryState* aFrameState); // GetInitialContainingBlock() is deprecated in favor of GetRootElementFrame(); // nsIFrame* GetInitialContainingBlock() { return mRootElementFrame; } // This returns the outermost frame for the root element - nsIFrame* GetRootElementFrame() { return mRootElementFrame; } + nsContainerFrame* GetRootElementFrame() { return mRootElementFrame; } // This returns the frame for the root element that does not // have a psuedo-element style nsIFrame* GetRootElementStyleFrame() { return mRootElementStyleFrame; } nsIFrame* GetPageSequenceFrame() { return mPageSequenceFrame; } // Get the frame that is the parent of the root element. - nsIFrame* GetDocElementContainingBlock() + nsContainerFrame* GetDocElementContainingBlock() { return mDocElementContainingBlock; } private: struct FrameConstructionItem; class FrameConstructionItemList; - nsIFrame* ConstructPageFrame(nsIPresShell* aPresShell, - nsPresContext* aPresContext, - nsIFrame* aParentFrame, - nsIFrame* aPrevPageFrame, - nsIFrame*& aCanvasFrame); + nsContainerFrame* ConstructPageFrame(nsIPresShell* aPresShell, + nsPresContext* aPresContext, + nsContainerFrame* aParentFrame, + nsIFrame* aPrevPageFrame, + nsContainerFrame*& aCanvasFrame); void InitAndRestoreFrame (const nsFrameConstructorState& aState, nsIContent* aContent, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsIFrame* aNewFrame, bool aAllowCounters = true); @@ -295,7 +295,7 @@ private: void AddFrameConstructionItems(nsFrameConstructorState& aState, nsIContent* aContent, bool aSuppressWhiteSpaceOptimizations, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, FrameConstructionItemList& aItems); // Construct the frames for the document element. This can return null if the @@ -356,7 +356,7 @@ private: // aFrame may be null; this method doesn't use it directly in any case. void CreateGeneratedContentItem(nsFrameConstructorState& aState, - nsIFrame* aFrame, + nsContainerFrame* aFrame, nsIContent* aContent, nsStyleContext* aStyleContext, nsCSSPseudoElements::Type aPseudoElement, @@ -368,7 +368,7 @@ private: // be placed on aParentFrame's principal child list. It may be null if // aFrameList is being added at the beginning of the child list. nsresult AppendFramesToParent(nsFrameConstructorState& aState, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsFrameItems& aFrameList, nsIFrame* aPrevSibling, bool aIsRecursiveCall = false); @@ -380,7 +380,7 @@ private: */ nsIFrame* ConstructTable(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aDisplay, nsFrameItems& aFrameItems); @@ -389,7 +389,7 @@ private: */ nsIFrame* ConstructTableRowOrRowGroup(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aStyleDisplay, nsFrameItems& aFrameItems); @@ -398,7 +398,7 @@ private: */ nsIFrame* ConstructTableCol(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aStyleDisplay, nsFrameItems& aFrameItems); @@ -407,7 +407,7 @@ private: */ nsIFrame* ConstructTableCell(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aStyleDisplay, nsFrameItems& aFrameItems); @@ -448,6 +448,7 @@ private: the frame. @param nsStyleContext the style context to use for the frame. */ typedef nsIFrame* (* FrameCreationFunc)(nsIPresShell*, nsStyleContext*); + typedef nsContainerFrame* (* ContainerFrameCreationFunc)(nsIPresShell*, nsStyleContext*); /* A function that can be used to get a FrameConstructionData. Such a function is allowed to return null. @@ -482,7 +483,7 @@ private: typedef nsIFrame* (nsCSSFrameConstructor::* FrameFullConstructor)(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aStyleDisplay, nsFrameItems& aFrameItems); @@ -1053,27 +1054,27 @@ private: // handling to be better. This should simply be part of the job of // GetGeometricParent, and stuff like the frameitems and parent frame should // be kept track of in the state... - void AdjustParentFrame(nsIFrame* & aParentFrame, + void AdjustParentFrame(nsContainerFrame** aParentFrame, const FrameConstructionData* aFCData, nsStyleContext* aStyleContext); // END TABLE SECTION protected: - static nsIFrame* CreatePlaceholderFrameFor(nsIPresShell* aPresShell, - nsIContent* aContent, - nsIFrame* aFrame, - nsStyleContext* aStyleContext, - nsIFrame* aParentFrame, - nsIFrame* aPrevInFlow, - nsFrameState aTypeBit); + static nsIFrame* CreatePlaceholderFrameFor(nsIPresShell* aPresShell, + nsIContent* aContent, + nsIFrame* aFrame, + nsStyleContext* aStyleContext, + nsContainerFrame* aParentFrame, + nsIFrame* aPrevInFlow, + nsFrameState aTypeBit); private: // ConstructSelectFrame puts the new frame in aFrameItems and // handles the kids of the select. nsIFrame* ConstructSelectFrame(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aStyleDisplay, nsFrameItems& aFrameItems); @@ -1081,7 +1082,7 @@ private: // handles the kids of the fieldset nsIFrame* ConstructFieldSetFrame(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aStyleDisplay, nsFrameItems& aFrameItems); @@ -1092,14 +1093,14 @@ private: void ConstructTextFrame(const FrameConstructionData* aData, nsFrameConstructorState& aState, nsIContent* aContent, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsStyleContext* aStyleContext, nsFrameItems& aFrameItems); // If aPossibleTextContent is a text node and doesn't have a frame, append a // frame construction item for it to aItems. void AddTextItemIfNeeded(nsFrameConstructorState& aState, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsIContent* aPossibleTextContent, FrameConstructionItemList& aItems); @@ -1146,7 +1147,7 @@ private: */ void ConstructFrameFromItemInternal(FrameConstructionItem& aItem, nsFrameConstructorState& aState, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsFrameItems& aFrameItems); // possible flags for AddFrameConstructionItemInternal's aFlags argument @@ -1168,7 +1169,7 @@ private: // inline frame. void AddFrameConstructionItemsInternal(nsFrameConstructorState& aState, nsIContent* aContent, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsIAtom* aTag, int32_t aNameSpaceID, bool aSuppressWhiteSpaceOptimizations, @@ -1183,18 +1184,18 @@ private: */ void ConstructFramesFromItemList(nsFrameConstructorState& aState, FrameConstructionItemList& aItems, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsFrameItems& aFrameItems); void ConstructFramesFromItem(nsFrameConstructorState& aState, FCItemIterator& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsFrameItems& aFrameItems); static bool AtLineBoundary(FCItemIterator& aIter); nsresult CreateAnonymousFrames(nsFrameConstructorState& aState, nsIContent* aParent, - nsIFrame* aParentFrame, - PendingBinding * aPendingBinding, + nsContainerFrame* aParentFrame, + PendingBinding* aPendingBinding, nsFrameItems& aChildItems); nsresult GetAnonymousContent(nsIContent* aParent, @@ -1209,7 +1210,7 @@ private: */ void FlushAccumulatedBlock(nsFrameConstructorState& aState, nsIContent* aContent, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsFrameItems& aBlockItems, nsFrameItems& aNewItems); @@ -1262,14 +1263,14 @@ private: * and ConstructMarker, which both want an anonymous block child for their * children to go in to. */ - nsIFrame* ConstructFrameWithAnonymousChild( + nsContainerFrame* ConstructFrameWithAnonymousChild( nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aDisplay, nsFrameItems& aFrameItems, - FrameCreationFunc aConstructor, - FrameCreationFunc aInnerConstructor, + ContainerFrameCreationFunc aConstructor, + ContainerFrameCreationFunc aInnerConstructor, nsICSSAnonBoxPseudo* aInnerPseudo, bool aCandidateRootFrame); @@ -1278,7 +1279,7 @@ private: */ nsIFrame* ConstructOuterSVG(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aDisplay, nsFrameItems& aFrameItems); @@ -1287,7 +1288,7 @@ private: */ nsIFrame* ConstructMarker(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aDisplay, nsFrameItems& aFrameItems); @@ -1310,7 +1311,7 @@ private: */ nsIFrame* ConstructScrollableBlock(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aDisplay, nsFrameItems& aFrameItems); @@ -1319,7 +1320,7 @@ private: */ nsIFrame* ConstructNonScrollableBlock(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aDisplay, nsFrameItems& aFrameItems); @@ -1330,7 +1331,7 @@ private: */ void AddFCItemsForAnonymousContent( nsFrameConstructorState& aState, - nsIFrame* aFrame, + nsContainerFrame* aFrame, nsTArray& aAnonymousItems, FrameConstructionItemList& aItemsToConstruct, uint32_t aExtraFlags = 0); @@ -1349,7 +1350,7 @@ private: * @param aState the frame construction state * @param aContent the content node whose children need frames * @param aStyleContext the style context for aContent - * @param aFrame the frame to use as the parent frame for the new in-flow + * @param aParentFrame the frame to use as the parent frame for the new in-flow * kids. Note that this must be its own content insertion frame, but * need not be be the primary frame for aContent. This frame will be * pushed as the float containing block, as needed. aFrame is also @@ -1369,7 +1370,7 @@ private: void ProcessChildren(nsFrameConstructorState& aState, nsIContent* aContent, nsStyleContext* aStyleContext, - nsIFrame* aFrame, + nsContainerFrame* aParentFrame, const bool aCanHaveGeneratedContent, nsFrameItems& aFrameItems, const bool aAllowBlockStyles, @@ -1389,8 +1390,9 @@ public: ABS_POS, FIXED_POS }; - nsIFrame* GetAbsoluteContainingBlock(nsIFrame* aFrame, ContainingBlockType aType); - nsIFrame* GetFloatContainingBlock(nsIFrame* aFrame); + nsContainerFrame* GetAbsoluteContainingBlock(nsIFrame* aFrame, + ContainingBlockType aType); + nsContainerFrame* GetFloatContainingBlock(nsIFrame* aFrame); private: nsIContent* PropagateScrollToViewport(); @@ -1404,23 +1406,23 @@ private: nsIContent* aContent, nsStyleContext* aContentStyle, nsIFrame* aScrolledFrame, - nsIFrame* aParentFrame, - nsIFrame*& aNewFrame); + nsContainerFrame* aParentFrame, + nsContainerFrame*& aNewFrame); // Builds the initial ScrollFrame already_AddRefed BeginBuildingScrollFrame(nsFrameConstructorState& aState, nsIContent* aContent, nsStyleContext* aContentStyle, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsIAtom* aScrolledPseudo, bool aIsRoot, - nsIFrame*& aNewFrame); + nsContainerFrame*& aNewFrame); // Completes the building of the scrollframe: // Creates a view for the scrolledframe and makes it the child of the scrollframe. void - FinishBuildingScrollFrame(nsIFrame* aScrollFrame, + FinishBuildingScrollFrame(nsContainerFrame* aScrollFrame, nsIFrame* aScrolledFrame); // InitializeSelectFrame puts scrollFrame in aFrameItems if aBuildCombobox is false @@ -1428,10 +1430,10 @@ private: // popup widget or not. nsresult InitializeSelectFrame(nsFrameConstructorState& aState, - nsIFrame* scrollFrame, - nsIFrame* scrolledFrame, + nsContainerFrame* aScrollFrame, + nsContainerFrame* aScrolledFrame, nsIContent* aContent, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsStyleContext* aStyleContext, bool aBuildCombobox, PendingBinding* aPendingBinding, @@ -1455,19 +1457,19 @@ private: bool MaybeRecreateContainerForFrameRemoval(nsIFrame* aFrame, nsresult* aResult); - nsIFrame* CreateContinuingOuterTableFrame(nsIPresShell* aPresShell, - nsPresContext* aPresContext, - nsIFrame* aFrame, - nsIFrame* aParentFrame, - nsIContent* aContent, - nsStyleContext* aStyleContext); + nsIFrame* CreateContinuingOuterTableFrame(nsIPresShell* aPresShell, + nsPresContext* aPresContext, + nsIFrame* aFrame, + nsContainerFrame* aParentFrame, + nsIContent* aContent, + nsStyleContext* aStyleContext); - nsIFrame* CreateContinuingTableFrame(nsIPresShell* aPresShell, - nsPresContext* aPresContext, - nsIFrame* aFrame, - nsIFrame* aParentFrame, - nsIContent* aContent, - nsStyleContext* aStyleContext); + nsIFrame* CreateContinuingTableFrame(nsIPresShell* aPresShell, + nsPresContext* aPresContext, + nsIFrame* aFrame, + nsContainerFrame* aParentFrame, + nsIContent* aContent, + nsStyleContext* aStyleContext); //---------------------------------------- @@ -1515,17 +1517,17 @@ private: void ConstructBlock(nsFrameConstructorState& aState, const nsStyleDisplay* aDisplay, nsIContent* aContent, - nsIFrame* aParentFrame, - nsIFrame* aContentParentFrame, + nsContainerFrame* aParentFrame, + nsContainerFrame* aContentParentFrame, nsStyleContext* aStyleContext, - nsIFrame** aNewFrame, + nsContainerFrame** aNewFrame, nsFrameItems& aFrameItems, nsIFrame* aPositionedFrameForAbsPosContainer, PendingBinding* aPendingBinding); nsIFrame* ConstructInline(nsFrameConstructorState& aState, FrameConstructionItem& aItem, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, const nsStyleDisplay* aDisplay, nsFrameItems& aFrameItems); @@ -1548,7 +1550,7 @@ private: * needed. */ void CreateIBSiblings(nsFrameConstructorState& aState, - nsIFrame* aInitialInline, + nsContainerFrame* aInitialInline, bool aIsPositioned, nsFrameItems& aChildItems, nsFrameItems& aSiblings); @@ -1568,7 +1570,7 @@ private: // aIsAppend cases. Passing aIsAppend false even when an append is happening // is ok in terms of correctness, but can lead to unnecessary reframing. If // aIsAppend is true, then the caller MUST call - // nsCSSFrameConstructor::AppendFrames (as opposed to + // nsCSSFrameConstructor::AppendFramesToParent (as opposed to // nsFrameManager::InsertFrames directly) to add the new frames. // @return true if we reconstructed the containing block, false // otherwise @@ -1586,23 +1588,22 @@ private: // Methods support :first-letter style void CreateFloatingLetterFrame(nsFrameConstructorState& aState, - nsIFrame* aBlockFrame, + nsContainerFrame* aBlockFrame, nsIContent* aTextContent, nsIFrame* aTextFrame, - nsIContent* aBlockContent, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsStyleContext* aStyleContext, nsFrameItems& aResult); - void CreateLetterFrame(nsIFrame* aBlockFrame, - nsIFrame* aBlockContinuation, + void CreateLetterFrame(nsContainerFrame* aBlockFrame, + nsContainerFrame* aBlockContinuation, nsIContent* aTextContent, - nsIFrame* aParentFrame, + nsContainerFrame* aParentFrame, nsFrameItems& aResult); - void WrapFramesInFirstLetterFrame(nsIContent* aBlockContent, - nsIFrame* aBlockFrame, - nsFrameItems& aBlockFrames); + void WrapFramesInFirstLetterFrame(nsIContent* aBlockContent, + nsContainerFrame* aBlockFrame, + nsFrameItems& aBlockFrames); /** * Looks in the block aBlockFrame for a text frame that contains the @@ -1626,29 +1627,29 @@ private: * first-letter either because it was found or won't be * found */ - void WrapFramesInFirstLetterFrame(nsIFrame* aBlockFrame, - nsIFrame* aBlockContinuation, - nsIFrame* aParentFrame, - nsIFrame* aParentFrameList, - nsIFrame** aModifiedParent, - nsIFrame** aTextFrame, - nsIFrame** aPrevFrame, - nsFrameItems& aLetterFrames, - bool* aStopLooking); + void WrapFramesInFirstLetterFrame(nsContainerFrame* aBlockFrame, + nsContainerFrame* aBlockContinuation, + nsContainerFrame* aParentFrame, + nsIFrame* aParentFrameList, + nsContainerFrame** aModifiedParent, + nsIFrame** aTextFrame, + nsIFrame** aPrevFrame, + nsFrameItems& aLetterFrames, + bool* aStopLooking); - void RecoverLetterFrames(nsIFrame* aBlockFrame); + void RecoverLetterFrames(nsContainerFrame* aBlockFrame); // - nsresult RemoveLetterFrames(nsPresContext* aPresContext, - nsIPresShell* aPresShell, - nsIFrame* aBlockFrame); + nsresult RemoveLetterFrames(nsPresContext* aPresContext, + nsIPresShell* aPresShell, + nsContainerFrame* aBlockFrame); // Recursive helper for RemoveLetterFrames - nsresult RemoveFirstLetterFrames(nsPresContext* aPresContext, - nsIPresShell* aPresShell, - nsIFrame* aFrame, - nsIFrame* aBlockFrame, - bool* aStopLooking); + nsresult RemoveFirstLetterFrames(nsPresContext* aPresContext, + nsIPresShell* aPresShell, + nsContainerFrame* aFrame, + nsContainerFrame* aBlockFrame, + bool* aStopLooking); // Special remove method for those pesky floating first-letter frames nsresult RemoveFloatingFirstLetterFrames(nsPresContext* aPresContext, @@ -1674,7 +1675,7 @@ private: // the block (possibly including line frames). void WrapFramesInFirstLineFrame(nsFrameConstructorState& aState, nsIContent* aBlockContent, - nsIFrame* aBlockFrame, + nsContainerFrame* aBlockFrame, nsFirstLineFrame* aLineFrame, nsFrameItems& aFrameItems); @@ -1682,7 +1683,7 @@ private: // possibly calling WrapFramesInFirstLineFrame as needed). void AppendFirstLineFrames(nsFrameConstructorState& aState, nsIContent* aContent, - nsIFrame* aBlockFrame, + nsContainerFrame* aBlockFrame, nsFrameItems& aFrameItems); nsresult InsertFirstLineFrames(nsFrameConstructorState& aState, @@ -1781,15 +1782,15 @@ private: // about the following frames. // This is just the outermost frame for the root element. - nsIFrame* mRootElementFrame; + nsContainerFrame* mRootElementFrame; // This is the frame for the root element that has no pseudo-element style. nsIFrame* mRootElementStyleFrame; // This is the containing block for fixed-pos frames --- the // viewport or page frame - nsIFrame* mFixedContainingBlock; + nsContainerFrame* mFixedContainingBlock; // This is the containing block that contains the root element --- // the real "initial containing block" according to CSS 2.1. - nsIFrame* mDocElementContainingBlock; + nsContainerFrame* mDocElementContainingBlock; nsIFrame* mGfxScrollFrame; nsIFrame* mPageSequenceFrame; nsQuoteList mQuoteList; diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index 05ecc23d86b8..65415b83cb6e 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -100,7 +100,7 @@ NS_IMPL_ISUPPORTS(nsComboButtonListener, // static class data member for Bug 32920 nsComboboxControlFrame* nsComboboxControlFrame::sFocused = nullptr; -nsIFrame* +nsContainerFrame* NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aStateFlags) { nsComboboxControlFrame* it = new (aPresShell) nsComboboxControlFrame(aContext); diff --git a/layout/forms/nsComboboxControlFrame.h b/layout/forms/nsComboboxControlFrame.h index 3f3233a26329..acd7f848451d 100644 --- a/layout/forms/nsComboboxControlFrame.h +++ b/layout/forms/nsComboboxControlFrame.h @@ -46,7 +46,9 @@ class nsComboboxControlFrame : public nsBlockFrame, public nsIStatefulFrame { public: - friend nsIFrame* NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags); + friend nsContainerFrame* NS_NewComboboxControlFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext, + nsFrameState aFlags); friend class nsComboboxDisplayFrame; nsComboboxControlFrame(nsStyleContext* aContext); diff --git a/layout/forms/nsFieldSetFrame.cpp b/layout/forms/nsFieldSetFrame.cpp index 706971504a81..a7add52c5a65 100644 --- a/layout/forms/nsFieldSetFrame.cpp +++ b/layout/forms/nsFieldSetFrame.cpp @@ -23,7 +23,7 @@ using namespace mozilla; using namespace mozilla::layout; -nsIFrame* +nsContainerFrame* NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsFieldSetFrame(aContext); diff --git a/layout/forms/nsGfxButtonControlFrame.cpp b/layout/forms/nsGfxButtonControlFrame.cpp index 9462755a42a0..c5a2252e14c5 100644 --- a/layout/forms/nsGfxButtonControlFrame.cpp +++ b/layout/forms/nsGfxButtonControlFrame.cpp @@ -22,7 +22,7 @@ nsGfxButtonControlFrame::nsGfxButtonControlFrame(nsStyleContext* aContext): { } -nsIFrame* +nsContainerFrame* NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsGfxButtonControlFrame(aContext); diff --git a/layout/forms/nsHTMLButtonControlFrame.cpp b/layout/forms/nsHTMLButtonControlFrame.cpp index b50ba711f9f7..00cd441e2046 100644 --- a/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/layout/forms/nsHTMLButtonControlFrame.cpp @@ -19,7 +19,7 @@ using namespace mozilla; -nsIFrame* +nsContainerFrame* NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsHTMLButtonControlFrame(aContext); diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp index cf54f10b21c6..02682cffc432 100644 --- a/layout/forms/nsListControlFrame.cpp +++ b/layout/forms/nsListControlFrame.cpp @@ -75,7 +75,7 @@ private: }; //--------------------------------------------------------- -nsIFrame* +nsContainerFrame* NS_NewListControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { nsListControlFrame* it = diff --git a/layout/forms/nsListControlFrame.h b/layout/forms/nsListControlFrame.h index 32d407a4d765..301773d827f0 100644 --- a/layout/forms/nsListControlFrame.h +++ b/layout/forms/nsListControlFrame.h @@ -52,7 +52,8 @@ class nsListControlFrame : public nsHTMLScrollFrame, public nsISelectControlFrame { public: - friend nsIFrame* NS_NewListControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); + friend nsContainerFrame* NS_NewListControlFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext); NS_DECL_QUERYFRAME NS_DECL_FRAMEARENA_HELPERS diff --git a/layout/forms/nsSelectsAreaFrame.cpp b/layout/forms/nsSelectsAreaFrame.cpp index abbe689e905e..14f33a94a118 100644 --- a/layout/forms/nsSelectsAreaFrame.cpp +++ b/layout/forms/nsSelectsAreaFrame.cpp @@ -7,7 +7,7 @@ #include "nsListControlFrame.h" #include "nsDisplayList.h" -nsIFrame* +nsContainerFrame* NS_NewSelectsAreaFrame(nsIPresShell* aShell, nsStyleContext* aContext, nsFrameState aFlags) { nsSelectsAreaFrame* it = new (aShell) nsSelectsAreaFrame(aContext); diff --git a/layout/forms/nsSelectsAreaFrame.h b/layout/forms/nsSelectsAreaFrame.h index 145e6ab46373..a2614a720474 100644 --- a/layout/forms/nsSelectsAreaFrame.h +++ b/layout/forms/nsSelectsAreaFrame.h @@ -13,7 +13,9 @@ class nsSelectsAreaFrame : public nsBlockFrame public: NS_DECL_FRAMEARENA_HELPERS - friend nsIFrame* NS_NewSelectsAreaFrame(nsIPresShell* aShell, nsStyleContext* aContext, nsFrameState aFlags); + friend nsContainerFrame* NS_NewSelectsAreaFrame(nsIPresShell* aShell, + nsStyleContext* aContext, + nsFrameState aFlags); virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, diff --git a/layout/generic/nsCanvasFrame.cpp b/layout/generic/nsCanvasFrame.cpp index a2dfc41c69ee..422aacdfc80d 100644 --- a/layout/generic/nsCanvasFrame.cpp +++ b/layout/generic/nsCanvasFrame.cpp @@ -30,7 +30,7 @@ using namespace mozilla; using namespace mozilla::layout; using namespace mozilla::gfx; -nsIFrame* +nsCanvasFrame* NS_NewCanvasFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsCanvasFrame(aContext); diff --git a/layout/generic/nsColumnSetFrame.cpp b/layout/generic/nsColumnSetFrame.cpp index 9c9ce0b1f7a3..ff78cf563a26 100644 --- a/layout/generic/nsColumnSetFrame.cpp +++ b/layout/generic/nsColumnSetFrame.cpp @@ -20,7 +20,7 @@ using namespace mozilla::layout; * * XXX should we support CSS columns applied to table elements? */ -nsIFrame* +nsContainerFrame* NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aStateFlags) { nsColumnSetFrame* it = new (aPresShell) nsColumnSetFrame(aContext); diff --git a/layout/generic/nsFirstLetterFrame.cpp b/layout/generic/nsFirstLetterFrame.cpp index f2e23fd686d0..f524a6bcbdf8 100644 --- a/layout/generic/nsFirstLetterFrame.cpp +++ b/layout/generic/nsFirstLetterFrame.cpp @@ -21,7 +21,7 @@ using namespace mozilla; using namespace mozilla::layout; -nsIFrame* +nsFirstLetterFrame* NS_NewFirstLetterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsFirstLetterFrame(aContext); @@ -303,7 +303,7 @@ nsFirstLetterFrame::CreateContinuationForFloatingParent(nsPresContext* aPresCont nsIPresShell* presShell = aPresContext->PresShell(); nsPlaceholderFrame* placeholderFrame = presShell->FrameManager()->GetPlaceholderFrameFor(this); - nsIFrame* parent = placeholderFrame->GetParent(); + nsContainerFrame* parent = placeholderFrame->GetParent(); nsIFrame* continuation = presShell->FrameConstructor()-> CreateContinuingFrame(aPresContext, aChild, parent, aIsFluid); diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp index 0da7ed00437b..c6081f009cbf 100644 --- a/layout/generic/nsFlexContainerFrame.cpp +++ b/layout/generic/nsFlexContainerFrame.cpp @@ -1464,7 +1464,7 @@ NS_QUERYFRAME_TAIL_INHERITING(nsFlexContainerFrameSuper) NS_IMPL_FRAMEARENA_HELPERS(nsFlexContainerFrame) -nsIFrame* +nsContainerFrame* NS_NewFlexContainerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { diff --git a/layout/generic/nsFlexContainerFrame.h b/layout/generic/nsFlexContainerFrame.h index 4d022438e4ce..4154677cd6fc 100644 --- a/layout/generic/nsFlexContainerFrame.h +++ b/layout/generic/nsFlexContainerFrame.h @@ -16,8 +16,8 @@ namespace mozilla { template class LinkedList; } -nsIFrame* NS_NewFlexContainerFrame(nsIPresShell* aPresShell, - nsStyleContext* aContext); +nsContainerFrame* NS_NewFlexContainerFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext); typedef nsContainerFrame nsFlexContainerFrameSuper; @@ -28,8 +28,8 @@ public: NS_DECL_QUERYFRAME // Factory method: - friend nsIFrame* NS_NewFlexContainerFrame(nsIPresShell* aPresShell, - nsStyleContext* aContext); + friend nsContainerFrame* NS_NewFlexContainerFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext); // Forward-decls of helper classes class FlexItem; diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 2dad81ef8e76..5d2f3d5ba852 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -65,7 +65,7 @@ using namespace mozilla::layout; //----------nsHTMLScrollFrame------------------------------------------- -nsIFrame* +nsHTMLScrollFrame* NS_NewHTMLScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, bool aIsRoot) { return new (aPresShell) nsHTMLScrollFrame(aPresShell, aContext, aIsRoot); @@ -899,7 +899,7 @@ NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame) //----------nsXULScrollFrame------------------------------------------- -nsIFrame* +nsXULScrollFrame* NS_NewXULScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, bool aIsRoot, bool aClipAllDescendants) { diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h index c4c5e3fd128a..63d8c33e8a88 100644 --- a/layout/generic/nsGfxScrollFrame.h +++ b/layout/generic/nsGfxScrollFrame.h @@ -450,7 +450,9 @@ class nsHTMLScrollFrame : public nsContainerFrame, public: typedef mozilla::ScrollFrameHelper ScrollFrameHelper; typedef mozilla::CSSIntPoint CSSIntPoint; - friend nsIFrame* NS_NewHTMLScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, bool aIsRoot); + friend nsHTMLScrollFrame* NS_NewHTMLScrollFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext, + bool aIsRoot); NS_DECL_QUERYFRAME NS_DECL_FRAMEARENA_HELPERS @@ -762,8 +764,10 @@ public: NS_DECL_QUERYFRAME NS_DECL_FRAMEARENA_HELPERS - friend nsIFrame* NS_NewXULScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, - bool aIsRoot, bool aClipAllDescendants); + friend nsXULScrollFrame* NS_NewXULScrollFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext, + bool aIsRoot, + bool aClipAllDescendants); // Called to set the child frames. We typically have three: the scroll area, // the vertical scrollbar, and the horizontal scrollbar. diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index 512485ae98e0..491229d360cf 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -23,7 +23,7 @@ NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame) NS_IMPL_FRAMEARENA_HELPERS(nsGridContainerFrame) -nsIFrame* +nsContainerFrame* NS_NewGridContainerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { diff --git a/layout/generic/nsGridContainerFrame.h b/layout/generic/nsGridContainerFrame.h index a3accdf10dc5..db20728eb75c 100644 --- a/layout/generic/nsGridContainerFrame.h +++ b/layout/generic/nsGridContainerFrame.h @@ -15,8 +15,8 @@ * Factory function. * @return a newly allocated nsGridContainerFrame (infallible) */ -nsIFrame* NS_NewGridContainerFrame(nsIPresShell* aPresShell, - nsStyleContext* aContext); +nsContainerFrame* NS_NewGridContainerFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext); class nsGridContainerFrame MOZ_FINAL : public nsContainerFrame { @@ -37,8 +37,8 @@ public: #endif protected: - friend nsIFrame* NS_NewGridContainerFrame(nsIPresShell* aPresShell, - nsStyleContext* aContext); + friend nsContainerFrame* NS_NewGridContainerFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext); nsGridContainerFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {} #ifdef DEBUG diff --git a/layout/generic/nsHTMLParts.h b/layout/generic/nsHTMLParts.h index 38409947e784..d91619b3a19d 100644 --- a/layout/generic/nsHTMLParts.h +++ b/layout/generic/nsHTMLParts.h @@ -63,7 +63,7 @@ NS_NewAttributeContent(nsNodeInfoManager *aNodeInfoManager, // return the option frame // By default, area frames will extend // their height to cover any children that "stick out". -nsIFrame* +nsContainerFrame* NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags); // Create a block formatting context blockframe @@ -87,13 +87,16 @@ NS_NewSubDocumentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewHTMLFramesetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +class ViewportFrame; +ViewportFrame* NS_NewViewportFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +class nsCanvasFrame; +nsCanvasFrame* NS_NewCanvasFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewImageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +class nsInlineFrame; +nsInlineFrame* NS_NewInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); @@ -108,37 +111,41 @@ NS_NewWBRFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return NS_NewEmptyFrame(aPresShell, aContext); } -nsIFrame* +nsContainerFrame* NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aStateFlags); -nsIFrame* +class nsSimplePageSequenceFrame; +nsSimplePageSequenceFrame* NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +class nsPageFrame; +nsPageFrame* NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +class nsPageContentFrame; +nsPageContentFrame* NS_NewPageContentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +class nsFirstLetterFrame; +nsFirstLetterFrame* NS_NewFirstLetterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); class nsFirstLineFrame; nsFirstLineFrame* NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); // forms -nsIFrame* +nsContainerFrame* NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewNativeButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewImageControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +nsContainerFrame* NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewNativeCheckboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +nsContainerFrame* NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewFileControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); @@ -158,9 +165,9 @@ nsIFrame* NS_NewNativeRadioControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewNativeSelectControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +nsContainerFrame* NS_NewListControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +nsContainerFrame* NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags); nsIFrame* NS_NewProgressFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); @@ -172,21 +179,28 @@ nsIFrame* NS_NewNumberControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); // Table frame factories -nsIFrame* +class nsTableOuterFrame; +nsTableOuterFrame* NS_NewTableOuterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +class nsTableFrame; +nsTableFrame* NS_NewTableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +class nsTableCaptionFrame; +nsTableCaptionFrame* NS_NewTableCaptionFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsTableColFrame* NS_NewTableColFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +class nsTableColGroupFrame; +nsTableColGroupFrame* NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +class nsTableRowFrame; +nsTableRowFrame* NS_NewTableRowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +class nsTableRowGroupFrame; +nsTableRowGroupFrame* NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* +class nsTableCellFrame; +nsTableCellFrame* NS_NewTableCellFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, bool aIsBorderCollapse); nsresult diff --git a/layout/generic/nsInlineFrame.cpp b/layout/generic/nsInlineFrame.cpp index 41d171b6f421..dee5be70e716 100644 --- a/layout/generic/nsInlineFrame.cpp +++ b/layout/generic/nsInlineFrame.cpp @@ -31,7 +31,7 @@ using namespace mozilla::layout; // Basic nsInlineFrame methods -nsIFrame* +nsInlineFrame* NS_NewInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsInlineFrame(aContext); diff --git a/layout/generic/nsInlineFrame.h b/layout/generic/nsInlineFrame.h index ae1af5b5ef47..b064fe8b7b2f 100644 --- a/layout/generic/nsInlineFrame.h +++ b/layout/generic/nsInlineFrame.h @@ -28,7 +28,8 @@ public: NS_DECL_QUERYFRAME NS_DECL_FRAMEARENA_HELPERS - friend nsIFrame* NS_NewInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); + friend nsInlineFrame* NS_NewInlineFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext); // nsIFrame overrides virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder, diff --git a/layout/generic/nsPageContentFrame.cpp b/layout/generic/nsPageContentFrame.cpp index 7bba96e1542e..183f7470aac3 100644 --- a/layout/generic/nsPageContentFrame.cpp +++ b/layout/generic/nsPageContentFrame.cpp @@ -9,7 +9,7 @@ #include "nsIPresShell.h" #include "nsSimplePageSequenceFrame.h" -nsIFrame* +nsPageContentFrame* NS_NewPageContentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsPageContentFrame(aContext); diff --git a/layout/generic/nsPageContentFrame.h b/layout/generic/nsPageContentFrame.h index eaf142bc4067..d46e43781614 100644 --- a/layout/generic/nsPageContentFrame.h +++ b/layout/generic/nsPageContentFrame.h @@ -16,7 +16,8 @@ class nsPageContentFrame : public ViewportFrame { public: NS_DECL_FRAMEARENA_HELPERS - friend nsIFrame* NS_NewPageContentFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); + friend nsPageContentFrame* NS_NewPageContentFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext); friend class nsPageFrame; // nsIFrame diff --git a/layout/generic/nsPageFrame.cpp b/layout/generic/nsPageFrame.cpp index 24d48c679302..acbd32d8b68e 100644 --- a/layout/generic/nsPageFrame.cpp +++ b/layout/generic/nsPageFrame.cpp @@ -26,7 +26,7 @@ extern PRLogModuleInfo *GetLayoutPrintingLog(); using namespace mozilla; -nsIFrame* +nsPageFrame* NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsPageFrame(aContext); diff --git a/layout/generic/nsPageFrame.h b/layout/generic/nsPageFrame.h index 4e13cd4f4c1d..b07209ea0402 100644 --- a/layout/generic/nsPageFrame.h +++ b/layout/generic/nsPageFrame.h @@ -17,7 +17,8 @@ class nsPageFrame : public nsContainerFrame { public: NS_DECL_FRAMEARENA_HELPERS - friend nsIFrame* NS_NewPageFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); + friend nsPageFrame* NS_NewPageFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext); virtual void Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, diff --git a/layout/generic/nsSimplePageSequenceFrame.cpp b/layout/generic/nsSimplePageSequenceFrame.cpp index 5dbd319a8a69..824725d8c5e5 100644 --- a/layout/generic/nsSimplePageSequenceFrame.cpp +++ b/layout/generic/nsSimplePageSequenceFrame.cpp @@ -55,7 +55,7 @@ GetLayoutPrintingLog() #define PR_PL(_p1) #endif -nsIFrame* +nsSimplePageSequenceFrame* NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsSimplePageSequenceFrame(aContext); diff --git a/layout/generic/nsSimplePageSequenceFrame.h b/layout/generic/nsSimplePageSequenceFrame.h index e71a79f40d71..d508f573e6c8 100644 --- a/layout/generic/nsSimplePageSequenceFrame.h +++ b/layout/generic/nsSimplePageSequenceFrame.h @@ -58,7 +58,8 @@ public: class nsSimplePageSequenceFrame : public nsContainerFrame, public nsIPageSequenceFrame { public: - friend nsIFrame* NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); + friend nsSimplePageSequenceFrame* NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext); NS_DECL_QUERYFRAME NS_DECL_FRAMEARENA_HELPERS diff --git a/layout/generic/nsViewportFrame.cpp b/layout/generic/nsViewportFrame.cpp index 43b47d55b58a..75853e4ac504 100644 --- a/layout/generic/nsViewportFrame.cpp +++ b/layout/generic/nsViewportFrame.cpp @@ -17,7 +17,7 @@ using namespace mozilla; -nsIFrame* +ViewportFrame* NS_NewViewportFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) ViewportFrame(aContext); diff --git a/layout/mathml/nsMathMLParts.h b/layout/mathml/nsMathMLParts.h index dcb7d2557414..b9791e66eb2e 100644 --- a/layout/mathml/nsMathMLParts.h +++ b/layout/mathml/nsMathMLParts.h @@ -24,11 +24,11 @@ nsIFrame* NS_NewMathMLmsupFrame(nsIPresShell* aPresShell, nsStyleContext* aConte nsIFrame* NS_NewMathMLmsubsupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewMathMLmunderoverFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewMathMLmmultiscriptsFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* NS_NewMathMLmtableOuterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* NS_NewMathMLmtableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* NS_NewMathMLmtrFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* NS_NewMathMLmtdFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsIFrame* NS_NewMathMLmtdInnerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); +nsContainerFrame* NS_NewMathMLmtableOuterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); +nsContainerFrame* NS_NewMathMLmtableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); +nsContainerFrame* NS_NewMathMLmtrFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); +nsContainerFrame* NS_NewMathMLmtdFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); +nsContainerFrame* NS_NewMathMLmtdInnerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewMathMLmsqrtFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewMathMLmrootFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewMathMLmactionFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); diff --git a/layout/mathml/nsMathMLmtableFrame.cpp b/layout/mathml/nsMathMLmtableFrame.cpp index 5118c9bc7e9f..9267e2514d02 100644 --- a/layout/mathml/nsMathMLmtableFrame.cpp +++ b/layout/mathml/nsMathMLmtableFrame.cpp @@ -422,7 +422,7 @@ NS_QUERYFRAME_HEAD(nsMathMLmtableOuterFrame) NS_QUERYFRAME_ENTRY(nsIMathMLFrame) NS_QUERYFRAME_TAIL_INHERITING(nsTableOuterFrame) -nsIFrame* +nsContainerFrame* NS_NewMathMLmtableOuterFrame (nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsMathMLmtableOuterFrame(aContext); @@ -647,7 +647,7 @@ nsMathMLmtableOuterFrame::Reflow(nsPresContext* aPresContext, NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); } -nsIFrame* +nsContainerFrame* NS_NewMathMLmtableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsMathMLmtableFrame(aContext); @@ -684,7 +684,7 @@ nsMathMLmtableFrame::RestyleTable() // -------- // implementation of nsMathMLmtrFrame -nsIFrame* +nsContainerFrame* NS_NewMathMLmtrFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsMathMLmtrFrame(aContext); @@ -730,7 +730,7 @@ nsMathMLmtrFrame::AttributeChanged(int32_t aNameSpaceID, // -------- // implementation of nsMathMLmtdFrame -nsIFrame* +nsContainerFrame* NS_NewMathMLmtdFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsMathMLmtdFrame(aContext); @@ -864,7 +864,7 @@ NS_QUERYFRAME_HEAD(nsMathMLmtdInnerFrame) NS_QUERYFRAME_ENTRY(nsIMathMLFrame) NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame) -nsIFrame* +nsContainerFrame* NS_NewMathMLmtdInnerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsMathMLmtdInnerFrame(aContext); diff --git a/layout/mathml/nsMathMLmtableFrame.h b/layout/mathml/nsMathMLmtableFrame.h index 3a7b9a242b4b..03b1e46589c7 100644 --- a/layout/mathml/nsMathMLmtableFrame.h +++ b/layout/mathml/nsMathMLmtableFrame.h @@ -21,7 +21,8 @@ class nsMathMLmtableOuterFrame : public nsTableOuterFrame, public nsMathMLFrame { public: - friend nsIFrame* NS_NewMathMLmtableOuterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); + friend nsContainerFrame* NS_NewMathMLmtableOuterFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext); NS_DECL_QUERYFRAME NS_DECL_FRAMEARENA_HELPERS @@ -63,7 +64,8 @@ class nsMathMLmtableFrame : public nsTableFrame public: NS_DECL_FRAMEARENA_HELPERS - friend nsIFrame* NS_NewMathMLmtableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); + friend nsContainerFrame* NS_NewMathMLmtableFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext); // Overloaded nsTableFrame methods @@ -121,7 +123,8 @@ class nsMathMLmtrFrame : public nsTableRowFrame public: NS_DECL_FRAMEARENA_HELPERS - friend nsIFrame* NS_NewMathMLmtrFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); + friend nsContainerFrame* NS_NewMathMLmtrFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext); // overloaded nsTableRowFrame methods @@ -185,7 +188,8 @@ class nsMathMLmtdFrame : public nsTableCellFrame public: NS_DECL_FRAMEARENA_HELPERS - friend nsIFrame* NS_NewMathMLmtdFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); + friend nsContainerFrame* NS_NewMathMLmtdFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext); // overloaded nsTableCellFrame methods @@ -218,7 +222,7 @@ protected: class nsMathMLmtdInnerFrame : public nsBlockFrame, public nsMathMLFrame { public: - friend nsIFrame* NS_NewMathMLmtdInnerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); + friend nsContainerFrame* NS_NewMathMLmtdInnerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); NS_DECL_QUERYFRAME NS_DECL_FRAMEARENA_HELPERS diff --git a/layout/svg/nsSVGForeignObjectFrame.cpp b/layout/svg/nsSVGForeignObjectFrame.cpp index 4714b8a952c3..80a8e9c32284 100644 --- a/layout/svg/nsSVGForeignObjectFrame.cpp +++ b/layout/svg/nsSVGForeignObjectFrame.cpp @@ -27,7 +27,7 @@ using namespace mozilla::dom; //---------------------------------------------------------------------- // Implementation -nsIFrame* +nsContainerFrame* NS_NewSVGForeignObjectFrame(nsIPresShell *aPresShell, nsStyleContext *aContext) { diff --git a/layout/svg/nsSVGForeignObjectFrame.h b/layout/svg/nsSVGForeignObjectFrame.h index bbd2932f2458..a52027991a6e 100644 --- a/layout/svg/nsSVGForeignObjectFrame.h +++ b/layout/svg/nsSVGForeignObjectFrame.h @@ -21,7 +21,7 @@ typedef nsContainerFrame nsSVGForeignObjectFrameBase; class nsSVGForeignObjectFrame : public nsSVGForeignObjectFrameBase, public nsISVGChildFrame { - friend nsIFrame* + friend nsContainerFrame* NS_NewSVGForeignObjectFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); protected: nsSVGForeignObjectFrame(nsStyleContext* aContext); diff --git a/layout/svg/nsSVGMarkerFrame.cpp b/layout/svg/nsSVGMarkerFrame.cpp index a7ba27f1058c..68c9501a7493 100644 --- a/layout/svg/nsSVGMarkerFrame.cpp +++ b/layout/svg/nsSVGMarkerFrame.cpp @@ -17,7 +17,7 @@ using namespace mozilla::dom; using namespace mozilla::gfx; -nsIFrame* +nsContainerFrame* NS_NewSVGMarkerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsSVGMarkerFrame(aContext); @@ -244,7 +244,7 @@ nsSVGMarkerFrame::AutoMarkerReferencer::~AutoMarkerReferencer() //---------------------------------------------------------------------- // Implementation of nsSVGMarkerAnonChildFrame -nsIFrame* +nsContainerFrame* NS_NewSVGMarkerAnonChildFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { diff --git a/layout/svg/nsSVGMarkerFrame.h b/layout/svg/nsSVGMarkerFrame.h index 4ed24696cc80..c6c3c33589cb 100644 --- a/layout/svg/nsSVGMarkerFrame.h +++ b/layout/svg/nsSVGMarkerFrame.h @@ -15,12 +15,7 @@ #include "nsSVGContainerFrame.h" #include "nsSVGUtils.h" -class nsIAtom; -class nsIContent; -class nsIFrame; -class nsIPresShell; class nsRenderingContext; -class nsStyleContext; class nsSVGPathGeometryFrame; namespace mozilla { @@ -36,7 +31,7 @@ typedef nsSVGContainerFrame nsSVGMarkerFrameBase; class nsSVGMarkerFrame : public nsSVGMarkerFrameBase { friend class nsSVGMarkerAnonChildFrame; - friend nsIFrame* + friend nsContainerFrame* NS_NewSVGMarkerFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); protected: nsSVGMarkerFrame(nsStyleContext* aContext) @@ -147,7 +142,7 @@ typedef nsSVGDisplayContainerFrame nsSVGMarkerAnonChildFrameBase; class nsSVGMarkerAnonChildFrame : public nsSVGMarkerAnonChildFrameBase { - friend nsIFrame* + friend nsContainerFrame* NS_NewSVGMarkerAnonChildFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); diff --git a/layout/svg/nsSVGOuterSVGFrame.cpp b/layout/svg/nsSVGOuterSVGFrame.cpp index 313c8344ae47..6c4254021e4d 100644 --- a/layout/svg/nsSVGOuterSVGFrame.cpp +++ b/layout/svg/nsSVGOuterSVGFrame.cpp @@ -55,7 +55,7 @@ nsSVGOuterSVGFrame::UnregisterForeignObject(nsSVGForeignObjectFrame* aFrame) //---------------------------------------------------------------------- // Implementation -nsIFrame* +nsContainerFrame* NS_NewSVGOuterSVGFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsSVGOuterSVGFrame(aContext); @@ -901,7 +901,7 @@ nsSVGOuterSVGFrame::VerticalScrollbarNotNeeded() const //---------------------------------------------------------------------- // Implementation of nsSVGOuterSVGAnonChildFrame -nsIFrame* +nsContainerFrame* NS_NewSVGOuterSVGAnonChildFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { diff --git a/layout/svg/nsSVGOuterSVGFrame.h b/layout/svg/nsSVGOuterSVGFrame.h index 77511c62ce84..e5d91f771896 100644 --- a/layout/svg/nsSVGOuterSVGFrame.h +++ b/layout/svg/nsSVGOuterSVGFrame.h @@ -21,7 +21,7 @@ typedef nsSVGDisplayContainerFrame nsSVGOuterSVGFrameBase; class nsSVGOuterSVGFrame : public nsSVGOuterSVGFrameBase, public nsISVGSVGFrame { - friend nsIFrame* + friend nsContainerFrame* NS_NewSVGOuterSVGFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); protected: nsSVGOuterSVGFrame(nsStyleContext* aContext); @@ -233,7 +233,7 @@ typedef nsSVGDisplayContainerFrame nsSVGOuterSVGAnonChildFrameBase; class nsSVGOuterSVGAnonChildFrame : public nsSVGOuterSVGAnonChildFrameBase { - friend nsIFrame* + friend nsContainerFrame* NS_NewSVGOuterSVGAnonChildFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp index bf470ba2a513..61cc7a4c02a7 100644 --- a/layout/tables/nsTableCellFrame.cpp +++ b/layout/tables/nsTableCellFrame.cpp @@ -1047,7 +1047,7 @@ nsTableCellFrame::GetCellIndexes(int32_t &aRowIndex, int32_t &aColIndex) return NS_OK; } -nsIFrame* +nsTableCellFrame* NS_NewTableCellFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, bool aIsBorderCollapse) diff --git a/layout/tables/nsTableColGroupFrame.cpp b/layout/tables/nsTableColGroupFrame.cpp index 4d9e55beb664..93a03010cb7a 100644 --- a/layout/tables/nsTableColGroupFrame.cpp +++ b/layout/tables/nsTableColGroupFrame.cpp @@ -457,7 +457,7 @@ void nsTableColGroupFrame::GetContinuousBCBorderWidth(nsMargin& aBorder) /* ----- global methods ----- */ -nsIFrame* +nsTableColGroupFrame* NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsTableColGroupFrame(aContext); diff --git a/layout/tables/nsTableColGroupFrame.h b/layout/tables/nsTableColGroupFrame.h index 93542c19826b..27a7f958b5b2 100644 --- a/layout/tables/nsTableColGroupFrame.h +++ b/layout/tables/nsTableColGroupFrame.h @@ -37,7 +37,8 @@ public: * * @return the frame that was created */ - friend nsIFrame* NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); + friend nsTableColGroupFrame* NS_NewTableColGroupFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext); /** Initialize the colgroup frame with a set of children. * @see nsIFrame::SetInitialChildList diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index ad4258ee05b4..236a568b07af 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -3561,7 +3561,7 @@ nsTableFrame::GetBaseline() const } /* ----- global methods ----- */ -nsIFrame* +nsTableFrame* NS_NewTableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsTableFrame(aContext); diff --git a/layout/tables/nsTableFrame.h b/layout/tables/nsTableFrame.h index 53413ffd93d9..d69755425f10 100644 --- a/layout/tables/nsTableFrame.h +++ b/layout/tables/nsTableFrame.h @@ -122,7 +122,8 @@ public: * * @return the frame that was created */ - friend nsIFrame* NS_NewTableFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); + friend nsTableFrame* NS_NewTableFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext); /** sets defaults for table-specific style. * @see nsIFrame::Init diff --git a/layout/tables/nsTableOuterFrame.cpp b/layout/tables/nsTableOuterFrame.cpp index 4bfcbfa52882..2534b84893dd 100644 --- a/layout/tables/nsTableOuterFrame.cpp +++ b/layout/tables/nsTableOuterFrame.cpp @@ -132,7 +132,7 @@ nsTableCaptionFrame::GetFrameName(nsAString& aResult) const } #endif -nsIFrame* +nsTableCaptionFrame* NS_NewTableCaptionFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsTableCaptionFrame(aContext); @@ -1092,7 +1092,7 @@ nsTableOuterFrame::GetCellAt(uint32_t aRowIdx, uint32_t aColIdx) const } -nsIFrame* +nsTableOuterFrame* NS_NewTableOuterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsTableOuterFrame(aContext); diff --git a/layout/tables/nsTableOuterFrame.h b/layout/tables/nsTableOuterFrame.h index 2493c372e628..11f85cb3420b 100644 --- a/layout/tables/nsTableOuterFrame.h +++ b/layout/tables/nsTableOuterFrame.h @@ -17,9 +17,10 @@ class nsTableCaptionFrame : public nsBlockFrame public: NS_DECL_FRAMEARENA_HELPERS - // nsISupports + friend nsTableCaptionFrame* NS_NewTableCaptionFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext); + // nsIFrame virtual nsIAtom* GetType() const MOZ_OVERRIDE; - friend nsIFrame* NS_NewTableCaptionFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); virtual nsSize ComputeAutoSize(nsRenderingContext *aRenderingContext, nsSize aCBSize, nscoord aAvailableWidth, @@ -64,7 +65,8 @@ public: * * @return the frame that was created */ - friend nsIFrame* NS_NewTableOuterFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); + friend nsTableOuterFrame* NS_NewTableOuterFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext); // nsIFrame overrides - see there for a description diff --git a/layout/tables/nsTableRowFrame.cpp b/layout/tables/nsTableRowFrame.cpp index aafa2f6ffba4..8b644b97da7b 100644 --- a/layout/tables/nsTableRowFrame.cpp +++ b/layout/tables/nsTableRowFrame.cpp @@ -1435,7 +1435,7 @@ nsTableRowFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayI /* ----- global methods ----- */ -nsIFrame* +nsTableRowFrame* NS_NewTableRowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsTableRowFrame(aContext); diff --git a/layout/tables/nsTableRowFrame.h b/layout/tables/nsTableRowFrame.h index 3608f590557a..765a5352e5c2 100644 --- a/layout/tables/nsTableRowFrame.h +++ b/layout/tables/nsTableRowFrame.h @@ -55,7 +55,8 @@ public: * * @return the frame that was created */ - friend nsIFrame* NS_NewTableRowFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); + friend nsTableRowFrame* NS_NewTableRowFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext); virtual nsMargin GetUsedMargin() const MOZ_OVERRIDE; virtual nsMargin GetUsedBorder() const MOZ_OVERRIDE; diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp index 028eb46dd3d3..c50a30db7b19 100644 --- a/layout/tables/nsTableRowGroupFrame.cpp +++ b/layout/tables/nsTableRowGroupFrame.cpp @@ -1584,7 +1584,7 @@ nsTableRowGroupFrame::HasInternalBreakAfter() const } /* ----- global methods ----- */ -nsIFrame* +nsTableRowGroupFrame* NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsTableRowGroupFrame(aContext); diff --git a/layout/tables/nsTableRowGroupFrame.h b/layout/tables/nsTableRowGroupFrame.h index 33f385e811a6..d36e091f11b3 100644 --- a/layout/tables/nsTableRowGroupFrame.h +++ b/layout/tables/nsTableRowGroupFrame.h @@ -65,7 +65,8 @@ public: * * @return the frame that was created */ - friend nsIFrame* NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); + friend nsTableRowGroupFrame* NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, + nsStyleContext* aContext); virtual ~nsTableRowGroupFrame(); virtual void DestroyFrom(nsIFrame* aDestructRoot) MOZ_OVERRIDE; diff --git a/layout/xul/nsDocElementBoxFrame.cpp b/layout/xul/nsDocElementBoxFrame.cpp index 0b7a1864e906..49b29d29f33b 100644 --- a/layout/xul/nsDocElementBoxFrame.cpp +++ b/layout/xul/nsDocElementBoxFrame.cpp @@ -64,7 +64,7 @@ private: //---------------------------------------------------------------------- -nsIFrame* +nsContainerFrame* NS_NewDocElementBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsDocElementBoxFrame (aPresShell, aContext); diff --git a/layout/xul/nsRootBoxFrame.cpp b/layout/xul/nsRootBoxFrame.cpp index fd2044662ec8..73c252820bf8 100644 --- a/layout/xul/nsRootBoxFrame.cpp +++ b/layout/xul/nsRootBoxFrame.cpp @@ -105,7 +105,7 @@ protected: //---------------------------------------------------------------------- -nsIFrame* +nsContainerFrame* NS_NewRootBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { return new (aPresShell) nsRootBoxFrame (aPresShell, aContext);