From ecaac9ba3069a3afc4344c97d4fff0dec061892f Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Tue, 27 Dec 2011 21:18:48 +0100 Subject: [PATCH] Bug 515530 - Remove nsHTMLContainerFrame. r=roc --- layout/base/nsBidiPresUtils.cpp | 2 +- layout/base/nsCSSFrameConstructor.cpp | 2 +- layout/doc/obsolete/layout-internals.html | 4 +- layout/forms/nsFieldSetFrame.cpp | 15 +-- layout/forms/nsHTMLButtonControlFrame.cpp | 10 +- layout/forms/nsHTMLButtonControlFrame.h | 6 +- layout/forms/nsListControlFrame.h | 2 +- layout/forms/nsProgressFrame.cpp | 17 ++- layout/forms/nsProgressFrame.h | 10 +- layout/generic/Makefile.in | 1 - layout/generic/nsAbsoluteContainingBlock.cpp | 2 +- layout/generic/nsBlockFrame.h | 6 +- layout/generic/nsBlockReflowContext.cpp | 4 +- layout/generic/nsBulletFrame.cpp | 2 +- layout/generic/nsCanvasFrame.cpp | 8 +- layout/generic/nsCanvasFrame.h | 8 +- layout/generic/nsColumnSetFrame.cpp | 10 +- layout/generic/nsContainerFrame.cpp | 41 +++++- layout/generic/nsContainerFrame.h | 45 +++++++ layout/generic/nsFirstLetterFrame.cpp | 14 +- layout/generic/nsFirstLetterFrame.h | 14 +- layout/generic/nsFrame.cpp | 2 +- layout/generic/nsFrameSetFrame.cpp | 12 +- layout/generic/nsFrameSetFrame.h | 4 +- layout/generic/nsGfxScrollFrame.cpp | 24 ++-- layout/generic/nsGfxScrollFrame.h | 4 +- layout/generic/nsHTMLContainerFrame.cpp | 121 ------------------ layout/generic/nsHTMLContainerFrame.h | 105 --------------- layout/generic/nsImageFrame.cpp | 2 +- layout/generic/nsInlineFrame.cpp | 8 +- layout/generic/nsInlineFrame.h | 12 +- layout/generic/nsLeafFrame.cpp | 2 +- layout/generic/nsLineLayout.cpp | 4 +- layout/generic/nsPageContentFrame.cpp | 2 +- layout/generic/nsQueryFrame.h | 1 - layout/mathml/nsMathMLContainerFrame.cpp | 4 +- layout/mathml/nsMathMLContainerFrame.h | 14 +- layout/tables/nsTableCellFrame.cpp | 8 +- layout/tables/nsTableCellFrame.h | 6 +- layout/tables/nsTableColGroupFrame.h | 8 +- layout/tables/nsTableFrame.cpp | 25 ++-- layout/tables/nsTableFrame.h | 6 +- layout/tables/nsTableOuterFrame.cpp | 12 +- layout/tables/nsTableOuterFrame.h | 6 +- layout/tables/nsTableRowFrame.cpp | 6 +- layout/tables/nsTableRowFrame.h | 6 +- layout/tables/nsTableRowGroupFrame.cpp | 4 +- layout/tables/nsTableRowGroupFrame.h | 6 +- layout/xul/base/src/nsBox.cpp | 10 +- layout/xul/base/src/nsBoxFrame.cpp | 2 +- layout/xul/base/src/nsBoxLayout.cpp | 2 +- layout/xul/base/src/nsDeckFrame.cpp | 2 +- layout/xul/base/src/nsImageBoxFrame.cpp | 2 +- layout/xul/base/src/nsLeafBoxFrame.cpp | 2 +- layout/xul/base/src/nsSplitterFrame.cpp | 2 +- layout/xul/base/src/nsSprocketLayout.cpp | 2 +- .../xul/base/src/tree/src/nsTreeBodyFrame.cpp | 2 +- 57 files changed, 263 insertions(+), 400 deletions(-) delete mode 100644 layout/generic/nsHTMLContainerFrame.cpp delete mode 100644 layout/generic/nsHTMLContainerFrame.h diff --git a/layout/base/nsBidiPresUtils.cpp b/layout/base/nsBidiPresUtils.cpp index 48035f55964..bc8fb0d0b34 100644 --- a/layout/base/nsBidiPresUtils.cpp +++ b/layout/base/nsBidiPresUtils.cpp @@ -49,7 +49,7 @@ #include "nsFrameManager.h" #include "nsBidiUtils.h" #include "nsCSSFrameConstructor.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsInlineFrame.h" #include "nsPlaceholderFrame.h" #include "nsContainerFrame.h" diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index eb03fc6beef..c14addfb50c 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -72,7 +72,7 @@ #include "nsStyleConsts.h" #include "nsTableOuterFrame.h" #include "nsIDOMXULElement.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsINameSpaceManager.h" #include "nsIDOMHTMLSelectElement.h" #include "nsIDOMHTMLLegendElement.h" diff --git a/layout/doc/obsolete/layout-internals.html b/layout/doc/obsolete/layout-internals.html index 1d740ac7f60..0cb72c2fa40 100644 --- a/layout/doc/obsolete/layout-internals.html +++ b/layout/doc/obsolete/layout-internals.html @@ -28,7 +28,7 @@ The table related tags have their own display types like "table-cell",

Block and inline code

The main classes involved in the layout of HTML documents are nsBlockFrame -and nsInlineFrame, both of which inherit from nsHTMLContainerFrame (why?).  +and nsInlineFrame, both of which inherit from nsContainerFrame (why?).  These classes are persistent across reflows and are organized in a hierarchy to constitute the frame model of the Gecko system.  The frame model is derived by applying style and presentation semantics to the content @@ -77,7 +77,7 @@ to text runs and, so, determine where word breaks should occur. Questions What are anonymous blocks (nsBlockFrame.h)?
What is the difference between a span and a band (nsLineLayout)? -
Why do nsBlockFrame and nsInlineFrame both inherit from nsHTMLContainerFrame? +
Why do nsBlockFrame and nsInlineFrame both inherit from nsContainerFrame?

To Do

diff --git a/layout/forms/nsFieldSetFrame.cpp b/layout/forms/nsFieldSetFrame.cpp index e6f7490e12b..c488f7e3a6f 100644 --- a/layout/forms/nsFieldSetFrame.cpp +++ b/layout/forms/nsFieldSetFrame.cpp @@ -38,7 +38,7 @@ // YY need to pass isMultiple before create called //#include "nsFormControlFrame.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsLegendFrame.h" #include "nsIDOMNode.h" #include "nsIDOMHTMLFieldSetElement.h" @@ -65,7 +65,7 @@ class nsLegendFrame; -class nsFieldSetFrame : public nsHTMLContainerFrame { +class nsFieldSetFrame : public nsContainerFrame { public: NS_DECL_FRAMEARENA_HELPERS @@ -138,7 +138,7 @@ NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) NS_IMPL_FRAMEARENA_HELPERS(nsFieldSetFrame) nsFieldSetFrame::nsFieldSetFrame(nsStyleContext* aContext) - : nsHTMLContainerFrame(aContext) + : nsContainerFrame(aContext) { mContentFrame = nsnull; mLegendFrame = nsnull; @@ -149,7 +149,7 @@ void nsFieldSetFrame::DestroyFrom(nsIFrame* aDestructRoot) { DestroyAbsoluteFrames(aDestructRoot); - nsHTMLContainerFrame::DestroyFrom(aDestructRoot); + nsContainerFrame::DestroyFrom(aDestructRoot); } nsIAtom* @@ -173,7 +173,7 @@ nsFieldSetFrame::SetInitialChildList(ChildListID aListID, } // Queue up the frames for the content frame - return nsHTMLContainerFrame::SetInitialChildList(kPrincipalList, aChildList); + return nsContainerFrame::SetInitialChildList(kPrincipalList, aChildList); } class nsDisplayFieldSetBorderBackground : public nsDisplayItem { @@ -399,9 +399,8 @@ nsFieldSetFrame::ComputeSize(nsRenderingContext *aRenderingContext, bool aShrinkWrap) { nsSize result = - nsHTMLContainerFrame::ComputeSize(aRenderingContext, aCBSize, - aAvailableWidth, - aMargin, aBorder, aPadding, aShrinkWrap); + nsContainerFrame::ComputeSize(aRenderingContext, aCBSize, aAvailableWidth, + aMargin, aBorder, aPadding, aShrinkWrap); // Fieldsets never shrink below their min width. nscoord minWidth = GetMinWidth(aRenderingContext); diff --git a/layout/forms/nsHTMLButtonControlFrame.cpp b/layout/forms/nsHTMLButtonControlFrame.cpp index cfeeb8891ad..6e03435f358 100644 --- a/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/layout/forms/nsHTMLButtonControlFrame.cpp @@ -38,7 +38,7 @@ #include "nsHTMLButtonControlFrame.h" #include "nsCOMPtr.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsIFormControlFrame.h" #include "nsHTMLParts.h" #include "nsIFormControl.h" @@ -76,7 +76,7 @@ NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) NS_IMPL_FRAMEARENA_HELPERS(nsHTMLButtonControlFrame) nsHTMLButtonControlFrame::nsHTMLButtonControlFrame(nsStyleContext* aContext) - : nsHTMLContainerFrame(aContext) + : nsContainerFrame(aContext) { } @@ -89,7 +89,7 @@ nsHTMLButtonControlFrame::DestroyFrom(nsIFrame* aDestructRoot) { nsFormControlFrame::RegUnRegAccessKey(static_cast(this), false); DestroyAbsoluteFrames(aDestructRoot); - nsHTMLContainerFrame::DestroyFrom(aDestructRoot); + nsContainerFrame::DestroyFrom(aDestructRoot); } NS_IMETHODIMP @@ -98,7 +98,7 @@ nsHTMLButtonControlFrame::Init( nsIFrame* aParent, nsIFrame* aPrevInFlow) { - nsresult rv = nsHTMLContainerFrame::Init(aContent, aParent, aPrevInFlow); + nsresult rv = nsContainerFrame::Init(aContent, aParent, aPrevInFlow); if (NS_SUCCEEDED(rv)) { mRenderer.SetFrame(this, PresContext()); } @@ -107,7 +107,7 @@ nsHTMLButtonControlFrame::Init( NS_QUERYFRAME_HEAD(nsHTMLButtonControlFrame) NS_QUERYFRAME_ENTRY(nsIFormControlFrame) -NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame) +NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame) #ifdef ACCESSIBILITY already_AddRefed diff --git a/layout/forms/nsHTMLButtonControlFrame.h b/layout/forms/nsHTMLButtonControlFrame.h index de806f0aaab..a5a0012ad8e 100644 --- a/layout/forms/nsHTMLButtonControlFrame.h +++ b/layout/forms/nsHTMLButtonControlFrame.h @@ -39,7 +39,7 @@ #define nsHTMLButtonControlFrame_h___ #include "nsCOMPtr.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsIFormControlFrame.h" #include "nsHTMLParts.h" @@ -54,7 +54,7 @@ class nsRenderingContext; class nsPresContext; -class nsHTMLButtonControlFrame : public nsHTMLContainerFrame, +class nsHTMLButtonControlFrame : public nsContainerFrame, public nsIFormControlFrame { public: @@ -127,7 +127,7 @@ public: virtual bool IsFrameOfType(PRUint32 aFlags) const { - return nsHTMLContainerFrame::IsFrameOfType(aFlags & + return nsContainerFrame::IsFrameOfType(aFlags & ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock)); } diff --git a/layout/forms/nsListControlFrame.h b/layout/forms/nsListControlFrame.h index 245eabfc360..c5e08f48b55 100644 --- a/layout/forms/nsListControlFrame.h +++ b/layout/forms/nsListControlFrame.h @@ -145,7 +145,7 @@ public: virtual already_AddRefed CreateAccessible(); #endif - // nsHTMLContainerFrame + // nsContainerFrame virtual PRIntn GetSkipSides() const; // nsIListControlFrame diff --git a/layout/forms/nsProgressFrame.cpp b/layout/forms/nsProgressFrame.cpp index fefa6095ca3..fe6c175c0d5 100644 --- a/layout/forms/nsProgressFrame.cpp +++ b/layout/forms/nsProgressFrame.cpp @@ -63,7 +63,7 @@ NS_NewProgressFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) NS_IMPL_FRAMEARENA_HELPERS(nsProgressFrame) nsProgressFrame::nsProgressFrame(nsStyleContext* aContext) - : nsHTMLContainerFrame(aContext) + : nsContainerFrame(aContext) , mBarDiv(nsnull) { } @@ -80,7 +80,7 @@ nsProgressFrame::DestroyFrom(nsIFrame* aDestructRoot) "need to call RegUnregAccessKey only for the first."); nsFormControlFrame::RegUnRegAccessKey(static_cast(this), false); nsContentUtils::DestroyAnonymousContent(&mBarDiv); - nsHTMLContainerFrame::DestroyFrom(aDestructRoot); + nsContainerFrame::DestroyFrom(aDestructRoot); } nsresult @@ -123,9 +123,17 @@ nsProgressFrame::AppendAnonymousContentTo(nsBaseContentList& aElements, NS_QUERYFRAME_HEAD(nsProgressFrame) NS_QUERYFRAME_ENTRY(nsProgressFrame) NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator) -NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame) +NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame) +NS_IMETHODIMP +nsProgressFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, + const nsRect& aDirtyRect, + const nsDisplayListSet& aLists) +{ + return BuildDisplayListForInline(aBuilder, aDirtyRect, aLists); +} + NS_IMETHODIMP nsProgressFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -252,8 +260,7 @@ nsProgressFrame::AttributeChanged(PRInt32 aNameSpaceID, Invalidate(GetVisualOverflowRectRelativeToSelf()); } - return nsHTMLContainerFrame::AttributeChanged(aNameSpaceID, aAttribute, - aModType); + return nsContainerFrame::AttributeChanged(aNameSpaceID, aAttribute, aModType); } nsSize diff --git a/layout/forms/nsProgressFrame.h b/layout/forms/nsProgressFrame.h index e2247944e23..2f68046184c 100644 --- a/layout/forms/nsProgressFrame.h +++ b/layout/forms/nsProgressFrame.h @@ -38,13 +38,13 @@ #ifndef nsProgressFrame_h___ #define nsProgressFrame_h___ -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsIAnonymousContentCreator.h" #include "nsCOMPtr.h" class nsBaseContentList; -class nsProgressFrame : public nsHTMLContainerFrame, +class nsProgressFrame : public nsContainerFrame, public nsIAnonymousContentCreator { public: @@ -57,6 +57,10 @@ public: virtual void DestroyFrom(nsIFrame* aDestructRoot); + NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder, + const nsRect& aDirtyRect, + const nsDisplayListSet& aLists); + NS_IMETHOD Reflow(nsPresContext* aCX, nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowState& aReflowState, @@ -89,7 +93,7 @@ public: virtual bool IsFrameOfType(PRUint32 aFlags) const { - return nsHTMLContainerFrame::IsFrameOfType(aFlags & + return nsContainerFrame::IsFrameOfType(aFlags & ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock)); } diff --git a/layout/generic/Makefile.in b/layout/generic/Makefile.in index 68f8a184cf3..aa81c77c93b 100644 --- a/layout/generic/Makefile.in +++ b/layout/generic/Makefile.in @@ -95,7 +95,6 @@ CPPSRCS = \ nsFrameUtil.cpp \ nsGfxScrollFrame.cpp \ nsHTMLCanvasFrame.cpp \ - nsHTMLContainerFrame.cpp \ nsCanvasFrame.cpp \ nsHTMLReflowMetrics.cpp \ nsHTMLReflowState.cpp \ diff --git a/layout/generic/nsAbsoluteContainingBlock.cpp b/layout/generic/nsAbsoluteContainingBlock.cpp index c3ac2c08344..ef898ecd296 100644 --- a/layout/generic/nsAbsoluteContainingBlock.cpp +++ b/layout/generic/nsAbsoluteContainingBlock.cpp @@ -44,7 +44,7 @@ #include "nsAbsoluteContainingBlock.h" #include "nsContainerFrame.h" #include "nsIPresShell.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsHTMLParts.h" #include "nsPresContext.h" #include "nsFrameManager.h" diff --git a/layout/generic/nsBlockFrame.h b/layout/generic/nsBlockFrame.h index 2ea8e50f9b6..03629902a0b 100644 --- a/layout/generic/nsBlockFrame.h +++ b/layout/generic/nsBlockFrame.h @@ -44,7 +44,7 @@ #ifndef nsBlockFrame_h___ #define nsBlockFrame_h___ -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsHTMLParts.h" #include "nsAbsoluteContainingBlock.h" #include "nsLineBox.h" @@ -123,7 +123,7 @@ class nsIntervalSet; // (including
frames) #define NS_BLOCK_HAS_CLEAR_CHILDREN NS_FRAME_STATE_BIT(27) -#define nsBlockFrameSuper nsHTMLContainerFrame +#define nsBlockFrameSuper nsContainerFrame /* * Base class for block and inline frames. @@ -330,7 +330,7 @@ public: protected: nsBlockFrame(nsStyleContext* aContext) - : nsHTMLContainerFrame(aContext) + : nsContainerFrame(aContext) , mMinWidth(NS_INTRINSIC_WIDTH_UNKNOWN) , mPrefWidth(NS_INTRINSIC_WIDTH_UNKNOWN) { diff --git a/layout/generic/nsBlockReflowContext.cpp b/layout/generic/nsBlockReflowContext.cpp index 65cfef9ff56..3ed89cc2ce1 100644 --- a/layout/generic/nsBlockReflowContext.cpp +++ b/layout/generic/nsBlockReflowContext.cpp @@ -46,7 +46,7 @@ #include "nsFrameManager.h" #include "nsIContent.h" #include "nsStyleContext.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsBlockFrame.h" #include "nsLineBox.h" #include "nsIDOMHTMLTableCellElement.h" @@ -330,7 +330,7 @@ nsBlockReflowContext::ReflowBlock(const nsRect& aSpace, // which detaches the placeholder from the float. /* XXX promote DeleteChildsNextInFlow to nsIFrame to elminate this cast */ aState.mOverflowTracker->Finish(mFrame); - static_cast(kidNextInFlow->GetParent()) + static_cast(kidNextInFlow->GetParent()) ->DeleteNextInFlowChild(mPresContext, kidNextInFlow, true); } } diff --git a/layout/generic/nsBulletFrame.cpp b/layout/generic/nsBulletFrame.cpp index ba0e33b9152..49120c65839 100644 --- a/layout/generic/nsBulletFrame.cpp +++ b/layout/generic/nsBulletFrame.cpp @@ -41,7 +41,7 @@ #include "nsBulletFrame.h" #include "nsGkAtoms.h" #include "nsHTMLParts.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsGenericHTMLElement.h" #include "nsPresContext.h" #include "nsIPresShell.h" diff --git a/layout/generic/nsCanvasFrame.cpp b/layout/generic/nsCanvasFrame.cpp index 0751636d754..45c9b9c714e 100644 --- a/layout/generic/nsCanvasFrame.cpp +++ b/layout/generic/nsCanvasFrame.cpp @@ -40,7 +40,7 @@ #include "nsCanvasFrame.h" #include "nsIServiceManager.h" #include "nsHTMLParts.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsCSSRendering.h" #include "nsPresContext.h" #include "nsStyleContext.h" @@ -74,7 +74,7 @@ NS_IMPL_FRAMEARENA_HELPERS(nsCanvasFrame) NS_QUERYFRAME_HEAD(nsCanvasFrame) NS_QUERYFRAME_ENTRY(nsCanvasFrame) -NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame) +NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame) void nsCanvasFrame::DestroyFrom(nsIFrame* aDestructRoot) @@ -86,7 +86,7 @@ nsCanvasFrame::DestroyFrom(nsIFrame* aDestructRoot) sf->RemoveScrollPositionListener(this); } - nsHTMLContainerFrame::DestroyFrom(aDestructRoot); + nsContainerFrame::DestroyFrom(aDestructRoot); } void @@ -124,7 +124,7 @@ nsCanvasFrame::SetInitialChildList(ChildListID aListID, NS_ASSERTION(aListID != kPrincipalList || aChildList.IsEmpty() || aChildList.OnlyChild(), "Primary child list can have at most one frame in it"); - return nsHTMLContainerFrame::SetInitialChildList(aListID, aChildList); + return nsContainerFrame::SetInitialChildList(aListID, aChildList); } NS_IMETHODIMP diff --git a/layout/generic/nsCanvasFrame.h b/layout/generic/nsCanvasFrame.h index 12d2152cd57..0aaeee552a3 100644 --- a/layout/generic/nsCanvasFrame.h +++ b/layout/generic/nsCanvasFrame.h @@ -40,7 +40,7 @@ #ifndef nsCanvasFrame_h___ #define nsCanvasFrame_h___ -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsIScrollPositionListener.h" #include "nsDisplayList.h" #include "nsGkAtoms.h" @@ -56,12 +56,12 @@ class nsEvent; * It only supports having a single child frame which must be an area * frame */ -class nsCanvasFrame : public nsHTMLContainerFrame, +class nsCanvasFrame : public nsContainerFrame, public nsIScrollPositionListener { public: nsCanvasFrame(nsStyleContext* aContext) - : nsHTMLContainerFrame(aContext), + : nsContainerFrame(aContext), mDoPaintFocus(false), mAddedScrollPositionListener(false) {} @@ -90,7 +90,7 @@ public: nsReflowStatus& aStatus); virtual bool IsFrameOfType(PRUint32 aFlags) const { - return nsHTMLContainerFrame::IsFrameOfType(aFlags & + return nsContainerFrame::IsFrameOfType(aFlags & ~(nsIFrame::eCanContainOverflowContainers)); } diff --git a/layout/generic/nsColumnSetFrame.cpp b/layout/generic/nsColumnSetFrame.cpp index 2ffca49c447..7e29e102626 100644 --- a/layout/generic/nsColumnSetFrame.cpp +++ b/layout/generic/nsColumnSetFrame.cpp @@ -38,7 +38,7 @@ /* rendering object for css3 multi-column layout */ -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsIContent.h" #include "nsIFrame.h" #include "nsISupports.h" @@ -54,7 +54,7 @@ using namespace mozilla; -class nsColumnSetFrame : public nsHTMLContainerFrame { +class nsColumnSetFrame : public nsContainerFrame { public: NS_DECL_FRAMEARENA_HELPERS @@ -200,7 +200,7 @@ NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint3 NS_IMPL_FRAMEARENA_HELPERS(nsColumnSetFrame) nsColumnSetFrame::nsColumnSetFrame(nsStyleContext* aContext) - : nsHTMLContainerFrame(aContext), mLastBalanceHeight(NS_INTRINSICSIZE), + : nsContainerFrame(aContext), mLastBalanceHeight(NS_INTRINSICSIZE), mLastFrameStatus(NS_FRAME_COMPLETE) { } @@ -209,7 +209,7 @@ void nsColumnSetFrame::DestroyFrom(nsIFrame* aDestructRoot) { DestroyAbsoluteFrames(aDestructRoot); - nsHTMLContainerFrame::DestroyFrom(aDestructRoot); + nsContainerFrame::DestroyFrom(aDestructRoot); } nsIAtom* @@ -305,7 +305,7 @@ nsColumnSetFrame::SetInitialChildList(ChildListID aListID, NS_ASSERTION(aChildList.OnlyChild(), "initial child list must have exactly one child"); // Queue up the frames for the content frame - return nsHTMLContainerFrame::SetInitialChildList(kPrincipalList, aChildList); + return nsContainerFrame::SetInitialChildList(kPrincipalList, aChildList); } static nscoord diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp index 062afa4068d..d2f869a1be9 100644 --- a/layout/generic/nsContainerFrame.cpp +++ b/layout/generic/nsContainerFrame.cpp @@ -40,7 +40,7 @@ /* base class #1 for rendering objects that have child lists */ #include "nsContainerFrame.h" -#include "nsHTMLContainerFrame.h" + #include "nsIContent.h" #include "nsIDocument.h" #include "nsPresContext.h" @@ -50,7 +50,6 @@ #include "nsGUIEvent.h" #include "nsStyleConsts.h" #include "nsIView.h" -#include "nsHTMLContainerFrame.h" #include "nsFrameManager.h" #include "nsIPresShell.h" #include "nsCOMPtr.h" @@ -485,7 +484,7 @@ nsContainerFrame::CreateViewForFrame(nsIFrame* aFrame, aFrame->SetView(view); NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, - ("nsHTMLContainerFrame::CreateViewForFrame: frame=%p view=%p", + ("nsContainerFrame::CreateViewForFrame: frame=%p view=%p", aFrame)); return NS_OK; } @@ -1298,6 +1297,42 @@ nsContainerFrame::DestroyOverflowList(nsPresContext* aPresContext, } } +/* + * Create a next-in-flow for aFrame. Will return the newly created + * frame in aNextInFlowResult if and only if a new frame is + * created; otherwise nsnull is returned in aNextInFlowResult. + */ +nsresult +nsContainerFrame::CreateNextInFlow(nsPresContext* aPresContext, + nsIFrame* aFrame, + nsIFrame*& aNextInFlowResult) +{ + NS_PRECONDITION(GetType() != nsGkAtoms::blockFrame, + "you should have called nsBlockFrame::CreateContinuationFor instead"); + NS_PRECONDITION(mFrames.ContainsFrame(aFrame), "expected an in-flow child frame"); + + aNextInFlowResult = nsnull; + + nsIFrame* nextInFlow = aFrame->GetNextInFlow(); + if (nsnull == nextInFlow) { + // Create a continuation frame for the child frame and insert it + // into our child list. + nsresult rv = aPresContext->PresShell()->FrameConstructor()-> + CreateContinuingFrame(aPresContext, aFrame, this, &nextInFlow); + if (NS_FAILED(rv)) { + return rv; + } + mFrames.InsertFrame(nsnull, aFrame, nextInFlow); + + NS_FRAME_LOG(NS_FRAME_TRACE_NEW_FRAMES, + ("nsContainerFrame::CreateNextInFlow: frame=%p nextInFlow=%p", + aFrame, nextInFlow)); + + aNextInFlowResult = nextInFlow; + } + return NS_OK; +} + /** * Remove and delete aNextInFlow and its next-in-flows. Updates the sibling and flow * pointers diff --git a/layout/generic/nsContainerFrame.h b/layout/generic/nsContainerFrame.h index d29e6d461fc..b8e5282a216 100644 --- a/layout/generic/nsContainerFrame.h +++ b/layout/generic/nsContainerFrame.h @@ -58,6 +58,19 @@ class nsOverflowContinuationTracker; +// Some macros for container classes to do sanity checking on +// width/height/x/y values computed during reflow. +// NOTE: AppUnitsPerCSSPixel value hardwired here to remove the +// dependency on nsDeviceContext.h. It doesn't matter if it's a +// little off. +#ifdef DEBUG +#define CRAZY_W (1000000*60) +#define CRAZY_H CRAZY_W + +#define CRAZY_WIDTH(_x) (((_x) < -CRAZY_W) || ((_x) > CRAZY_W)) +#define CRAZY_HEIGHT(_y) (((_y) < -CRAZY_H) || ((_y) > CRAZY_H)) +#endif + /** * Implementation of a container frame. */ @@ -98,6 +111,23 @@ public: // nsContainerFrame methods + /** + * Helper method to create next-in-flows if necessary. If aFrame + * already has a next-in-flow then this method does + * nothing. Otherwise, a new continuation frame is created and + * linked into the flow. In addition, the new frame is inserted + * into the principal child list after aFrame. + * @note calling this method on a block frame is illegal. Use + * nsBlockFrame::CreateContinuationFor() instead. + * @param aNextInFlowResult will contain the next-in-flow + * if and only if one is created. If a next-in-flow already + * exists aNextInFlowResult is set to nsnull. + * @return NS_OK if a next-in-flow already exists or is successfully created. + */ + nsresult CreateNextInFlow(nsPresContext* aPresContext, + nsIFrame* aFrame, + nsIFrame*& aNextInFlowResult); + /** * Delete aNextInFlow and its next-in-flows. * @param aDeletingEmptyFrames if set, then the reflow for aNextInFlow's @@ -366,6 +396,21 @@ protected: const nsDisplayListSet& aLists, PRUint32 aFlags = 0); + /** + * A version of BuildDisplayList that use DISPLAY_CHILD_INLINE. + * Intended as a convenience for derived classes. + */ + nsresult BuildDisplayListForInline(nsDisplayListBuilder* aBuilder, + const nsRect& aDirtyRect, + const nsDisplayListSet& aLists) { + nsresult rv = DisplayBorderBackgroundOutline(aBuilder, aLists); + NS_ENSURE_SUCCESS(rv, rv); + rv = BuildDisplayListForNonBlockChildren(aBuilder, aDirtyRect, aLists, + DISPLAY_CHILD_INLINE); + NS_ENSURE_SUCCESS(rv, rv); + return rv; + } + // ========================================================================== /* Overflow Frames are frames that did not fit and must be pulled by diff --git a/layout/generic/nsFirstLetterFrame.cpp b/layout/generic/nsFirstLetterFrame.cpp index c0fc5af0a80..d856ca5d1f1 100644 --- a/layout/generic/nsFirstLetterFrame.cpp +++ b/layout/generic/nsFirstLetterFrame.cpp @@ -62,7 +62,7 @@ NS_IMPL_FRAMEARENA_HELPERS(nsFirstLetterFrame) NS_QUERYFRAME_HEAD(nsFirstLetterFrame) NS_QUERYFRAME_ENTRY(nsFirstLetterFrame) -NS_QUERYFRAME_TAIL_INHERITING(nsFirstLetterFrameSuper) +NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame) #ifdef NS_DEBUG NS_IMETHODIMP @@ -84,6 +84,14 @@ nsFirstLetterFrame::GetSkipSides() const return 0; } +NS_IMETHODIMP +nsFirstLetterFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, + const nsRect& aDirtyRect, + const nsDisplayListSet& aLists) +{ + return BuildDisplayListForInline(aBuilder, aDirtyRect, aLists); +} + NS_IMETHODIMP nsFirstLetterFrame::Init(nsIContent* aContent, nsIFrame* aParent, @@ -103,7 +111,7 @@ nsFirstLetterFrame::Init(nsIContent* aContent, } } - return nsFirstLetterFrameSuper::Init(aContent, aParent, aPrevInFlow); + return nsContainerFrame::Init(aContent, aParent, aPrevInFlow); } NS_IMETHODIMP @@ -179,7 +187,7 @@ nsFirstLetterFrame::ComputeSize(nsRenderingContext *aRenderingContext, // inline frame. return nsSize(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE); } - return nsFirstLetterFrameSuper::ComputeSize(aRenderingContext, + return nsContainerFrame::ComputeSize(aRenderingContext, aCBSize, aAvailableWidth, aMargin, aBorder, aPadding, aShrinkWrap); } diff --git a/layout/generic/nsFirstLetterFrame.h b/layout/generic/nsFirstLetterFrame.h index d5747570063..29084019d7f 100644 --- a/layout/generic/nsFirstLetterFrame.h +++ b/layout/generic/nsFirstLetterFrame.h @@ -40,17 +40,19 @@ /* rendering object for CSS :first-letter pseudo-element */ -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" -#define nsFirstLetterFrameSuper nsHTMLContainerFrame - -class nsFirstLetterFrame : public nsFirstLetterFrameSuper { +class nsFirstLetterFrame : public nsContainerFrame { public: NS_DECL_QUERYFRAME_TARGET(nsFirstLetterFrame) NS_DECL_QUERYFRAME NS_DECL_FRAMEARENA_HELPERS - nsFirstLetterFrame(nsStyleContext* aContext) : nsHTMLContainerFrame(aContext) {} + nsFirstLetterFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {} + + NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder, + const nsRect& aDirtyRect, + const nsDisplayListSet& aLists); NS_IMETHOD Init(nsIContent* aContent, nsIFrame* aParent, @@ -66,7 +68,7 @@ public: { if (!GetStyleDisplay()->IsFloating()) aFlags = aFlags & ~(nsIFrame::eLineParticipant); - return nsFirstLetterFrameSuper::IsFrameOfType(aFlags & + return nsContainerFrame::IsFrameOfType(aFlags & ~(nsIFrame::eBidiInlineContainer)); } diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 56da35c346d..b5f78934dd3 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -112,7 +112,7 @@ #include "nsUnicharUtils.h" #include "nsLayoutErrors.h" #include "nsContentErrors.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsBoxLayoutState.h" #include "nsBlockFrame.h" #include "nsDisplayList.h" diff --git a/layout/generic/nsFrameSetFrame.cpp b/layout/generic/nsFrameSetFrame.cpp index 23715ca659c..1da3d528f1b 100644 --- a/layout/generic/nsFrameSetFrame.cpp +++ b/layout/generic/nsFrameSetFrame.cpp @@ -41,7 +41,7 @@ #include "nsFrameSetFrame.h" #include "nsGenericHTMLElement.h" #include "nsLeafFrame.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsPresContext.h" #include "nsIPresShell.h" #include "nsIComponentManager.h" @@ -202,7 +202,7 @@ bool nsHTMLFramesetFrame::gDragInProgress = false; #define DEFAULT_BORDER_WIDTH_PX 6 nsHTMLFramesetFrame::nsHTMLFramesetFrame(nsStyleContext* aContext) - : nsHTMLContainerFrame(aContext) + : nsContainerFrame(aContext) { mNumRows = 0; mRowSizes = nsnull; @@ -244,7 +244,7 @@ nsHTMLFramesetFrame::~nsHTMLFramesetFrame() NS_QUERYFRAME_HEAD(nsHTMLFramesetFrame) NS_QUERYFRAME_ENTRY(nsHTMLFramesetFrame) -NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame) +NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame) // static int @@ -285,7 +285,7 @@ nsHTMLFramesetFrame::Init(nsIContent* aContent, nsIFrame* aParent, nsIFrame* aPrevInFlow) { - nsHTMLContainerFrame::Init(aContent, aParent, aPrevInFlow); + nsContainerFrame::Init(aContent, aParent, aPrevInFlow); // find the highest ancestor that is a frameset nsresult rv = NS_OK; nsIFrame* parentFrame = GetParent(); @@ -484,7 +484,7 @@ nsHTMLFramesetFrame::SetInitialChildList(ChildListID aListID, return NS_OK; } - return nsHTMLContainerFrame::SetInitialChildList(aListID, aChildList); + return nsContainerFrame::SetInitialChildList(aListID, aChildList); } // XXX should this try to allocate twips based on an even pixel boundary? @@ -827,7 +827,7 @@ nsHTMLFramesetFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, const nsDisplayListSet& aLists) { - nsresult rv = nsHTMLContainerFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists); + nsresult rv = BuildDisplayListForInline(aBuilder, aDirtyRect, aLists); NS_ENSURE_SUCCESS(rv, rv); if (mDragger && aBuilder->IsForEventDelivery()) { diff --git a/layout/generic/nsFrameSetFrame.h b/layout/generic/nsFrameSetFrame.h index 9e2d1f87abb..f6d1d8e1070 100644 --- a/layout/generic/nsFrameSetFrame.h +++ b/layout/generic/nsFrameSetFrame.h @@ -41,7 +41,7 @@ #define nsHTMLFrameset_h___ #include "nsGkAtoms.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsColor.h" #include "nsIObserver.h" #include "nsWeakPtr.h" @@ -98,7 +98,7 @@ struct nsFramesetDrag { /******************************************************************************* * nsHTMLFramesetFrame ******************************************************************************/ -class nsHTMLFramesetFrame : public nsHTMLContainerFrame +class nsHTMLFramesetFrame : public nsContainerFrame { public: NS_DECL_QUERYFRAME_TARGET(nsHTMLFramesetFrame) diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 2f81d04da19..1e8e2e42f96 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -46,7 +46,7 @@ #include "nsIView.h" #include "nsIScrollable.h" #include "nsIViewManager.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsGfxScrollFrame.h" #include "nsGkAtoms.h" #include "nsINameSpaceManager.h" @@ -100,7 +100,7 @@ NS_NewHTMLScrollFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, bool a NS_IMPL_FRAMEARENA_HELPERS(nsHTMLScrollFrame) nsHTMLScrollFrame::nsHTMLScrollFrame(nsIPresShell* aShell, nsStyleContext* aContext, bool aIsRoot) - : nsHTMLContainerFrame(aContext), + : nsContainerFrame(aContext), mInner(this, aIsRoot) { } @@ -123,14 +123,14 @@ nsHTMLScrollFrame::DestroyFrom(nsIFrame* aDestructRoot) { mInner.Destroy(); DestroyAbsoluteFrames(aDestructRoot); - nsHTMLContainerFrame::DestroyFrom(aDestructRoot); + nsContainerFrame::DestroyFrom(aDestructRoot); } NS_IMETHODIMP nsHTMLScrollFrame::SetInitialChildList(ChildListID aListID, nsFrameList& aChildList) { - nsresult rv = nsHTMLContainerFrame::SetInitialChildList(aListID, aChildList); + nsresult rv = nsContainerFrame::SetInitialChildList(aListID, aChildList); mInner.ReloadChildFrames(); return rv; } @@ -226,21 +226,21 @@ nsHTMLScrollFrame::InvalidateInternal(const nsRect& aDamageRect, nsRect thebesLayerDamage = damage + GetScrollPosition() - mInner.mScrollPosAtLastPaint; if (parentDamage.IsEqualInterior(thebesLayerDamage)) { // This single call will take care of both rects - nsHTMLContainerFrame::InvalidateInternal(parentDamage, 0, 0, aForChild, aFlags); + nsContainerFrame::InvalidateInternal(parentDamage, 0, 0, aForChild, aFlags); } else { // Invalidate rects separately if (!(aFlags & INVALIDATE_NO_THEBES_LAYERS)) { - nsHTMLContainerFrame::InvalidateInternal(thebesLayerDamage, 0, 0, aForChild, - aFlags | INVALIDATE_ONLY_THEBES_LAYERS); + nsContainerFrame::InvalidateInternal(thebesLayerDamage, 0, 0, aForChild, + aFlags | INVALIDATE_ONLY_THEBES_LAYERS); } if (!(aFlags & INVALIDATE_ONLY_THEBES_LAYERS) && !parentDamage.IsEmpty()) { - nsHTMLContainerFrame::InvalidateInternal(parentDamage, 0, 0, aForChild, - aFlags | INVALIDATE_NO_THEBES_LAYERS); + nsContainerFrame::InvalidateInternal(parentDamage, 0, 0, aForChild, + aFlags | INVALIDATE_NO_THEBES_LAYERS); } } } else { if (!parentDamage.IsEmpty()) { - nsHTMLContainerFrame::InvalidateInternal(parentDamage, 0, 0, aForChild, aFlags); + nsContainerFrame::InvalidateInternal(parentDamage, 0, 0, aForChild, aFlags); } } @@ -272,7 +272,7 @@ nsHTMLScrollFrame::InvalidateInternal(const nsRect& aDamageRect, } } - nsHTMLContainerFrame::InvalidateInternal(aDamageRect, aX, aY, aForChild, aFlags); + nsContainerFrame::InvalidateInternal(aDamageRect, aX, aY, aForChild, aFlags); } /** @@ -987,7 +987,7 @@ NS_QUERYFRAME_HEAD(nsHTMLScrollFrame) NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator) NS_QUERYFRAME_ENTRY(nsIScrollableFrame) NS_QUERYFRAME_ENTRY(nsIStatefulFrame) -NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame) +NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame) //----------nsXULScrollFrame------------------------------------------- diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h index 7a0451dd4f7..87977520b41 100644 --- a/layout/generic/nsGfxScrollFrame.h +++ b/layout/generic/nsGfxScrollFrame.h @@ -40,7 +40,7 @@ #ifndef nsGfxScrollFrame_h___ #define nsGfxScrollFrame_h___ -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsIAnonymousContentCreator.h" #include "nsBoxFrame.h" #include "nsDisplayList.h" @@ -341,7 +341,7 @@ public: * Scroll frames don't support incremental changes, i.e. you can't replace * or remove the scrolled frame */ -class nsHTMLScrollFrame : public nsHTMLContainerFrame, +class nsHTMLScrollFrame : public nsContainerFrame, public nsIScrollableFrame, public nsIAnonymousContentCreator, public nsIStatefulFrame { diff --git a/layout/generic/nsHTMLContainerFrame.cpp b/layout/generic/nsHTMLContainerFrame.cpp deleted file mode 100644 index 0fd9df86a19..00000000000 --- a/layout/generic/nsHTMLContainerFrame.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Michael Ventnor - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* base class #2 for rendering objects that have child lists */ - -#include "nsHTMLContainerFrame.h" -#include "nsFirstLetterFrame.h" -#include "nsRenderingContext.h" -#include "nsPresContext.h" -#include "nsIPresShell.h" -#include "nsStyleContext.h" -#include "nsStyleConsts.h" -#include "nsIContent.h" -#include "nsGkAtoms.h" -#include "nsLayoutUtils.h" -#include "nsCSSAnonBoxes.h" -#include "nsILinkHandler.h" -#include "nsGUIEvent.h" -#include "nsIDocument.h" -#include "nsIURL.h" -#include "nsPlaceholderFrame.h" -#include "nsHTMLParts.h" -#include "nsIView.h" -#include "nsIViewManager.h" -#include "nsIDOMEvent.h" -#include "nsWidgetsCID.h" -#include "nsCOMPtr.h" -#include "gfxFont.h" -#include "nsCSSFrameConstructor.h" -#include "nsDisplayList.h" -#include "nsBlockFrame.h" -#include "nsLineBox.h" -#include "nsDisplayList.h" -#include "nsCSSRendering.h" - -NS_IMETHODIMP -nsHTMLContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, - const nsRect& aDirtyRect, - const nsDisplayListSet& aLists) { - nsresult rv = DisplayBorderBackgroundOutline(aBuilder, aLists); - NS_ENSURE_SUCCESS(rv, rv); - - rv = BuildDisplayListForNonBlockChildren(aBuilder, aDirtyRect, aLists, - DISPLAY_CHILD_INLINE); - NS_ENSURE_SUCCESS(rv, rv); - - return NS_OK; -} - -/* - * Create a next-in-flow for aFrame. Will return the newly created - * frame in aNextInFlowResult if and only if a new frame is - * created; otherwise nsnull is returned in aNextInFlowResult. - */ -nsresult -nsHTMLContainerFrame::CreateNextInFlow(nsPresContext* aPresContext, - nsIFrame* aFrame, - nsIFrame*& aNextInFlowResult) -{ - NS_PRECONDITION(GetType() != nsGkAtoms::blockFrame, - "you should have called nsBlockFrame::CreateContinuationFor instead"); - NS_PRECONDITION(mFrames.ContainsFrame(aFrame), "expected an in-flow child frame"); - - aNextInFlowResult = nsnull; - - nsIFrame* nextInFlow = aFrame->GetNextInFlow(); - if (nsnull == nextInFlow) { - // Create a continuation frame for the child frame and insert it - // into our child list. - nsresult rv = aPresContext->PresShell()->FrameConstructor()-> - CreateContinuingFrame(aPresContext, aFrame, this, &nextInFlow); - if (NS_FAILED(rv)) { - return rv; - } - mFrames.InsertFrame(nsnull, aFrame, nextInFlow); - - NS_FRAME_LOG(NS_FRAME_TRACE_NEW_FRAMES, - ("nsHTMLContainerFrame::CreateNextInFlow: frame=%p nextInFlow=%p", - aFrame, nextInFlow)); - - aNextInFlowResult = nextInFlow; - } - return NS_OK; -} - -NS_IMPL_FRAMEARENA_HELPERS(nsHTMLContainerFrame) diff --git a/layout/generic/nsHTMLContainerFrame.h b/layout/generic/nsHTMLContainerFrame.h deleted file mode 100644 index 0e025bf0177..00000000000 --- a/layout/generic/nsHTMLContainerFrame.h +++ /dev/null @@ -1,105 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* base class #2 for rendering objects that have child lists */ - -#ifndef nsHTMLContainerFrame_h___ -#define nsHTMLContainerFrame_h___ - -#include "nsContainerFrame.h" -#include "nsDisplayList.h" -#include "gfxPoint.h" - -class nsString; -class nsAbsoluteFrame; -class nsPlaceholderFrame; -struct nsStyleDisplay; -struct nsStylePosition; -struct nsHTMLReflowMetrics; -struct nsHTMLReflowState; -class nsLineBox; - -// Some macros for container classes to do sanity checking on -// width/height/x/y values computed during reflow. -// NOTE: AppUnitsPerCSSPixel value hardwired here to remove the -// dependency on nsDeviceContext.h. It doesn't matter if it's a -// little off. -#ifdef DEBUG -#define CRAZY_W (1000000*60) -#define CRAZY_H CRAZY_W - -#define CRAZY_WIDTH(_x) (((_x) < -CRAZY_W) || ((_x) > CRAZY_W)) -#define CRAZY_HEIGHT(_y) (((_y) < -CRAZY_H) || ((_y) > CRAZY_H)) -#endif - -// Base class for html container frames that provides common -// functionality. -class nsHTMLContainerFrame : public nsContainerFrame { -public: - NS_DECL_FRAMEARENA_HELPERS - - /** - * Helper method to create next-in-flows if necessary. If aFrame - * already has a next-in-flow then this method does - * nothing. Otherwise, a new continuation frame is created and - * linked into the flow. In addition, the new frame is inserted - * into the principal child list after aFrame. - * @note calling this method on a block frame is illegal. Use - * nsBlockFrame::CreateContinuationFor() instead. - * @param aNextInFlowResult will contain the next-in-flow - * if and only if one is created. If a next-in-flow already - * exists aNextInFlowResult is set to nsnull. - * @return NS_OK if a next-in-flow already exists or is successfully created. - */ - nsresult CreateNextInFlow(nsPresContext* aPresContext, - nsIFrame* aFrame, - nsIFrame*& aNextInFlowResult); - - /** - * Displays the standard border, background and outline for the frame - * and calls DisplayTextDecorationsAndChildren. This is suitable for - * inline frames or frames that behave like inlines. - */ - NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder, - const nsRect& aDirtyRect, - const nsDisplayListSet& aLists); - -protected: - nsHTMLContainerFrame(nsStyleContext *aContext) : nsContainerFrame(aContext) {} -}; - -#endif /* nsHTMLContainerFrame_h___ */ diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index 412ca862d45..ca5da70dc3e 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -67,7 +67,7 @@ #include "nsISupportsPriority.h" #include "nsIServiceManager.h" #include "nsNetUtil.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "prprf.h" #include "nsCSSRendering.h" #include "nsILink.h" diff --git a/layout/generic/nsInlineFrame.cpp b/layout/generic/nsInlineFrame.cpp index 73875e5daac..51c393c0a3b 100644 --- a/layout/generic/nsInlineFrame.cpp +++ b/layout/generic/nsInlineFrame.cpp @@ -75,7 +75,7 @@ NS_IMPL_FRAMEARENA_HELPERS(nsInlineFrame) NS_QUERYFRAME_HEAD(nsInlineFrame) NS_QUERYFRAME_ENTRY(nsInlineFrame) -NS_QUERYFRAME_TAIL_INHERITING(nsInlineFrameSuper) +NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame) #ifdef DEBUG NS_IMETHODIMP @@ -185,9 +185,9 @@ nsInlineFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, const nsDisplayListSet& aLists) { - nsresult rv = nsHTMLContainerFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists); + nsresult rv = BuildDisplayListForInline(aBuilder, aDirtyRect, aLists); NS_ENSURE_SUCCESS(rv, rv); - + // The sole purpose of this is to trigger display of the selection // window for Named Anchors, which don't have any children and // normally don't have any size, but in Editor we use CSS to display @@ -924,7 +924,7 @@ void nsInlineFrame::DestroyFrom(nsIFrame* aDestructRoot) { DestroyAbsoluteFrames(aDestructRoot); - nsInlineFrameSuper::DestroyFrom(aDestructRoot); + nsContainerFrame::DestroyFrom(aDestructRoot); } #ifdef ACCESSIBILITY diff --git a/layout/generic/nsInlineFrame.h b/layout/generic/nsInlineFrame.h index d4df43fe89d..924c3561c8c 100644 --- a/layout/generic/nsInlineFrame.h +++ b/layout/generic/nsInlineFrame.h @@ -40,13 +40,9 @@ #ifndef nsInlineFrame_h___ #define nsInlineFrame_h___ -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsLineLayout.h" -class nsAnonymousBlockFrame; - -#define nsInlineFrameSuper nsHTMLContainerFrame - /** In Bidi left (or right) margin/padding/border should be applied to left * (or right) most frame (or a continuation frame). * This state value shows if this frame is left (or right) most continuation @@ -64,7 +60,7 @@ class nsAnonymousBlockFrame; * This class manages a list of child frames that are inline frames. Working with * nsLineLayout, the class will reflow and place inline frames on a line. */ -class nsInlineFrame : public nsInlineFrameSuper +class nsInlineFrame : public nsContainerFrame { public: NS_DECL_QUERYFRAME_TARGET(nsInlineFrame) @@ -89,7 +85,7 @@ public: virtual bool IsFrameOfType(PRUint32 aFlags) const { - return nsInlineFrameSuper::IsFrameOfType(aFlags & + return nsContainerFrame::IsFrameOfType(aFlags & ~(nsIFrame::eBidiInlineContainer | nsIFrame::eLineParticipant)); } @@ -162,7 +158,7 @@ protected: } }; - nsInlineFrame(nsStyleContext* aContext) : nsInlineFrameSuper(aContext) {} + nsInlineFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {} virtual PRIntn GetSkipSides() const; diff --git a/layout/generic/nsLeafFrame.cpp b/layout/generic/nsLeafFrame.cpp index 56a0a5c4202..2f2e7c30afd 100644 --- a/layout/generic/nsLeafFrame.cpp +++ b/layout/generic/nsLeafFrame.cpp @@ -39,7 +39,7 @@ #include "nsCOMPtr.h" #include "nsLeafFrame.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsHTMLParts.h" #include "nsPresContext.h" diff --git a/layout/generic/nsLineLayout.cpp b/layout/generic/nsLineLayout.cpp index fd9475523ff..e1c2908c492 100644 --- a/layout/generic/nsLineLayout.cpp +++ b/layout/generic/nsLineLayout.cpp @@ -52,7 +52,7 @@ #include "nsBlockFrame.h" #include "nsInlineFrame.h" #include "nsStyleConsts.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsFloatManager.h" #include "nsStyleContext.h" #include "nsPresContext.h" @@ -999,7 +999,7 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame, // Remove all of the childs next-in-flows. Make sure that we ask // the right parent to do the removal (it's possible that the // parent is not this because we are executing pullup code) - nsHTMLContainerFrame* parent = static_cast + nsContainerFrame* parent = static_cast (kidNextInFlow->GetParent()); parent->DeleteNextInFlowChild(mPresContext, kidNextInFlow, true); } diff --git a/layout/generic/nsPageContentFrame.cpp b/layout/generic/nsPageContentFrame.cpp index ed1be6848e4..bed3e694a92 100644 --- a/layout/generic/nsPageContentFrame.cpp +++ b/layout/generic/nsPageContentFrame.cpp @@ -38,7 +38,7 @@ #include "nsPageFrame.h" #include "nsPlaceholderFrame.h" #include "nsCSSFrameConstructor.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsHTMLParts.h" #include "nsIContent.h" #include "nsPresContext.h" diff --git a/layout/generic/nsQueryFrame.h b/layout/generic/nsQueryFrame.h index 35536496796..83b14dc0342 100644 --- a/layout/generic/nsQueryFrame.h +++ b/layout/generic/nsQueryFrame.h @@ -103,7 +103,6 @@ public: nsGroupBoxFrame_id, nsHTMLButtonControlFrame_id, nsHTMLCanvasFrame_id, - nsHTMLContainerFrame_id, nsHTMLFramesetBlankFrame_id, nsHTMLFramesetBorderFrame_id, nsHTMLFramesetFrame_id, diff --git a/layout/mathml/nsMathMLContainerFrame.cpp b/layout/mathml/nsMathMLContainerFrame.cpp index 2c719c31fca..46d2ef115b8 100644 --- a/layout/mathml/nsMathMLContainerFrame.cpp +++ b/layout/mathml/nsMathMLContainerFrame.cpp @@ -74,7 +74,7 @@ NS_IMPL_FRAMEARENA_HELPERS(nsMathMLContainerFrame) NS_QUERYFRAME_HEAD(nsMathMLContainerFrame) NS_QUERYFRAME_ENTRY(nsMathMLFrame) -NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame) +NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame) // ============================================================================= @@ -898,7 +898,7 @@ nsMathMLContainerFrame::ReflowChild(nsIFrame* aChildFrame, NS_ASSERTION(!inlineFrame, "Inline frames should be wrapped in blocks"); #endif - nsresult rv = nsHTMLContainerFrame:: + nsresult rv = nsContainerFrame:: ReflowChild(aChildFrame, aPresContext, aDesiredSize, aReflowState, 0, 0, NS_FRAME_NO_MOVE_FRAME, aStatus); diff --git a/layout/mathml/nsMathMLContainerFrame.h b/layout/mathml/nsMathMLContainerFrame.h index 343f8ed28f9..b09ca0f3994 100644 --- a/layout/mathml/nsMathMLContainerFrame.h +++ b/layout/mathml/nsMathMLContainerFrame.h @@ -44,7 +44,7 @@ #define nsMathMLContainerFrame_h___ #include "nsCOMPtr.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsBlockFrame.h" #include "nsInlineFrame.h" #include "nsMathMLAtoms.h" @@ -66,11 +66,11 @@ #define STRETCH_CONSIDER_ACTUAL_SIZE 0x00000001 // just use our current size #define STRETCH_CONSIDER_EMBELLISHMENTS 0x00000002 // size calculations include embellishments -class nsMathMLContainerFrame : public nsHTMLContainerFrame, +class nsMathMLContainerFrame : public nsContainerFrame, public nsMathMLFrame { friend class nsMathMLmfencedFrame; public: - nsMathMLContainerFrame(nsStyleContext* aContext) : nsHTMLContainerFrame(aContext) {} + nsMathMLContainerFrame(nsStyleContext* aContext) : nsContainerFrame(aContext) {} NS_DECL_QUERYFRAME NS_DECL_FRAMEARENA_HELPERS @@ -108,12 +108,12 @@ public: SetIncrementScriptLevel(PRInt32 aChildIndex, bool aIncrement); // -------------------------------------------------------------------------- - // Overloaded nsHTMLContainerFrame methods -- see documentation in nsIFrame.h + // Overloaded nsContainerFrame methods -- see documentation in nsIFrame.h virtual bool IsFrameOfType(PRUint32 aFlags) const { return !(aFlags & nsIFrame::eLineParticipant) && - nsHTMLContainerFrame::IsFrameOfType(aFlags & + nsContainerFrame::IsFrameOfType(aFlags & ~(nsIFrame::eMathML | nsIFrame::eExcludesIgnorableWhitespace)); } @@ -154,7 +154,7 @@ public: WillReflow(nsPresContext* aPresContext) { mPresentationData.flags &= ~NS_MATHML_ERROR; - return nsHTMLContainerFrame::WillReflow(aPresContext); + return nsContainerFrame::WillReflow(aPresContext); } NS_IMETHOD @@ -164,7 +164,7 @@ public: { mPresentationData.flags &= ~NS_MATHML_STRETCH_DONE; - return nsHTMLContainerFrame::DidReflow(aPresContext, aReflowState, aStatus); + return nsContainerFrame::DidReflow(aPresContext, aReflowState, aStatus); } NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder, diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp index 0ee8e6f7fb3..4da9c1f2a5b 100644 --- a/layout/tables/nsTableCellFrame.cpp +++ b/layout/tables/nsTableCellFrame.cpp @@ -71,7 +71,7 @@ using namespace mozilla; nsTableCellFrame::nsTableCellFrame(nsStyleContext* aContext) : - nsHTMLContainerFrame(aContext) + nsContainerFrame(aContext) { mColIndex = 0; mPriorAvailWidth = 0; @@ -106,7 +106,7 @@ nsTableCellFrame::Init(nsIContent* aContent, nsIFrame* aPrevInFlow) { // Let the base class do its initialization - nsresult rv = nsHTMLContainerFrame::Init(aContent, aParent, aPrevInFlow); + nsresult rv = nsContainerFrame::Init(aContent, aParent, aPrevInFlow); if (aPrevInFlow) { // Set the column index @@ -746,7 +746,7 @@ nsTableCellFrame::GetPrefWidth(nsRenderingContext *aRenderingContext) nsTableCellFrame::IntrinsicWidthOffsets(nsRenderingContext* aRenderingContext) { IntrinsicWidthOffsetData result = - nsHTMLContainerFrame::IntrinsicWidthOffsets(aRenderingContext); + nsContainerFrame::IntrinsicWidthOffsets(aRenderingContext); result.hMargin = 0; result.hPctMargin = 0; @@ -987,7 +987,7 @@ NS_QUERYFRAME_HEAD(nsTableCellFrame) NS_QUERYFRAME_ENTRY(nsTableCellFrame) NS_QUERYFRAME_ENTRY(nsITableCellLayout) NS_QUERYFRAME_ENTRY(nsIPercentHeightObserver) -NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame) +NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame) #ifdef ACCESSIBILITY already_AddRefed diff --git a/layout/tables/nsTableCellFrame.h b/layout/tables/nsTableCellFrame.h index c1fab106ff6..ea38332e857 100644 --- a/layout/tables/nsTableCellFrame.h +++ b/layout/tables/nsTableCellFrame.h @@ -39,7 +39,7 @@ #include "nsITableCellLayout.h" #include "nscore.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsTableRowFrame.h" // need to actually include this here to inline GetRowIndex #include "nsStyleContext.h" #include "nsIPercentHeightObserver.h" @@ -67,7 +67,7 @@ class nsTableFrame; * * @author sclark */ -class nsTableCellFrame : public nsHTMLContainerFrame, +class nsTableCellFrame : public nsContainerFrame, public nsITableCellLayout, public nsIPercentHeightObserver { @@ -241,7 +241,7 @@ public: nsPoint aPt); protected: - /** implement abstract method on nsHTMLContainerFrame */ + /** implement abstract method on nsContainerFrame */ virtual PRIntn GetSkipSides() const; /** diff --git a/layout/tables/nsTableColGroupFrame.h b/layout/tables/nsTableColGroupFrame.h index a0c90415957..3c67ec4a6ce 100644 --- a/layout/tables/nsTableColGroupFrame.h +++ b/layout/tables/nsTableColGroupFrame.h @@ -38,7 +38,7 @@ #define nsTableColGroupFrame_h__ #include "nscore.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsTableColFrame.h" #include "nsTablePainter.h" @@ -56,7 +56,7 @@ enum nsTableColGroupType { * * @author sclark */ -class nsTableColGroupFrame : public nsHTMLContainerFrame +class nsTableColGroupFrame : public nsContainerFrame { public: NS_DECL_FRAMEARENA_HELPERS @@ -233,7 +233,7 @@ protected: void InsertColsReflow(PRInt32 aColIndex, const nsFrameList::Slice& aCols); - /** implement abstract method on nsHTMLContainerFrame */ + /** implement abstract method on nsContainerFrame */ virtual PRIntn GetSkipSides() const; // data members @@ -247,7 +247,7 @@ protected: }; inline nsTableColGroupFrame::nsTableColGroupFrame(nsStyleContext *aContext) -: nsHTMLContainerFrame(aContext), mColCount(0), mStartColIndex(0) +: nsContainerFrame(aContext), mColCount(0), mStartColIndex(0) { SetColType(eColGroupContent); } diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index f13483b115b..44950341ef8 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -184,7 +184,7 @@ nsTableFrame::GetType() const nsTableFrame::nsTableFrame(nsStyleContext* aContext) - : nsHTMLContainerFrame(aContext), + : nsContainerFrame(aContext), mCellMap(nsnull), mTableLayoutStrategy(nsnull) { @@ -198,7 +198,7 @@ nsTableFrame::nsTableFrame(nsStyleContext* aContext) NS_QUERYFRAME_HEAD(nsTableFrame) NS_QUERYFRAME_ENTRY(nsITableLayout) -NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame) +NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame) NS_IMETHODIMP nsTableFrame::Init(nsIContent* aContent, @@ -208,7 +208,7 @@ nsTableFrame::Init(nsIContent* aContent, nsresult rv; // Let the base class do its processing - rv = nsHTMLContainerFrame::Init(aContent, aParent, aPrevInFlow); + rv = nsContainerFrame::Init(aContent, aParent, aPrevInFlow); // see if border collapse is on, if so set it const nsStyleTableBorder* tableStyle = GetStyleTableBorder(); @@ -260,7 +260,7 @@ void nsTableFrame::DestroyFrom(nsIFrame* aDestructRoot) { mColGroups.DestroyFramesFrom(aDestructRoot); - nsHTMLContainerFrame::DestroyFrom(aDestructRoot); + nsContainerFrame::DestroyFrom(aDestructRoot); } // Make sure any views are positioned properly @@ -1060,13 +1060,13 @@ nsTableFrame::GetChildList(ChildListID aListID) const if (aListID == kColGroupList) { return mColGroups; } - return nsHTMLContainerFrame::GetChildList(aListID); + return nsContainerFrame::GetChildList(aListID); } void nsTableFrame::GetChildLists(nsTArray* aLists) const { - nsHTMLContainerFrame::GetChildLists(aLists); + nsContainerFrame::GetChildLists(aLists); mColGroups.AppendIfNonempty(aLists, kColGroupList); } @@ -1469,7 +1469,7 @@ nsTableFrame::MarkIntrinsicWidthsDirty() // XXXldb Call SetBCDamageArea? - nsHTMLContainerFrame::MarkIntrinsicWidthsDirty(); + nsContainerFrame::MarkIntrinsicWidthsDirty(); } /* virtual */ nscoord @@ -1498,7 +1498,7 @@ nsTableFrame::GetPrefWidth(nsRenderingContext *aRenderingContext) nsTableFrame::IntrinsicWidthOffsets(nsRenderingContext* aRenderingContext) { IntrinsicWidthOffsetData result = - nsHTMLContainerFrame::IntrinsicWidthOffsets(aRenderingContext); + nsContainerFrame::IntrinsicWidthOffsets(aRenderingContext); result.hMargin = 0; result.hPctMargin = 0; @@ -1521,9 +1521,8 @@ nsTableFrame::ComputeSize(nsRenderingContext *aRenderingContext, bool aShrinkWrap) { nsSize result = - nsHTMLContainerFrame::ComputeSize(aRenderingContext, aCBSize, - aAvailableWidth, - aMargin, aBorder, aPadding, aShrinkWrap); + nsContainerFrame::ComputeSize(aRenderingContext, aCBSize, aAvailableWidth, + aMargin, aBorder, aPadding, aShrinkWrap); // Tables never shrink below their min width. nscoord minWidth = GetMinWidth(aRenderingContext); @@ -2322,7 +2321,7 @@ nsTableFrame::RemoveFrame(ChildListID aListID, nsTableFrame::GetUsedBorder() const { if (!IsBorderCollapse()) - return nsHTMLContainerFrame::GetUsedBorder(); + return nsContainerFrame::GetUsedBorder(); return GetIncludedOuterBCBorder(); } @@ -2331,7 +2330,7 @@ nsTableFrame::GetUsedBorder() const nsTableFrame::GetUsedPadding() const { if (!IsBorderCollapse()) - return nsHTMLContainerFrame::GetUsedPadding(); + return nsContainerFrame::GetUsedPadding(); return nsMargin(0,0,0,0); } diff --git a/layout/tables/nsTableFrame.h b/layout/tables/nsTableFrame.h index 9df26667e63..271c8ece6e1 100644 --- a/layout/tables/nsTableFrame.h +++ b/layout/tables/nsTableFrame.h @@ -38,7 +38,7 @@ #define nsTableFrame_h__ #include "nscore.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsStyleCoord.h" #include "nsStyleConsts.h" #include "nsITableLayout.h" @@ -128,7 +128,7 @@ private: * The principal child list contains row group frames. There is also an * additional child list, kColGroupList, which contains the col group frames. */ -class nsTableFrame : public nsHTMLContainerFrame, public nsITableLayout +class nsTableFrame : public nsContainerFrame, public nsITableLayout { public: NS_DECL_QUERYFRAME @@ -518,7 +518,7 @@ protected: void InitChildReflowState(nsHTMLReflowState& aReflowState); - /** implement abstract method on nsHTMLContainerFrame */ + /** implement abstract method on nsContainerFrame */ virtual PRIntn GetSkipSides() const; public: diff --git a/layout/tables/nsTableOuterFrame.cpp b/layout/tables/nsTableOuterFrame.cpp index a5710f7ed8d..488e4d2bf87 100644 --- a/layout/tables/nsTableOuterFrame.cpp +++ b/layout/tables/nsTableOuterFrame.cpp @@ -83,7 +83,7 @@ nsTableOuterFrame::GetBaseline() const nsIFrame* kid = mFrames.FirstChild(); if (!kid) { NS_NOTREACHED("no inner table"); - return nsHTMLContainerFrame::GetBaseline(); + return nsContainerFrame::GetBaseline(); } return kid->GetBaseline() + kid->GetPosition().y; @@ -173,7 +173,7 @@ NS_IMPL_FRAMEARENA_HELPERS(nsTableCaptionFrame) /* ----------- nsTableOuterFrame ---------- */ nsTableOuterFrame::nsTableOuterFrame(nsStyleContext* aContext): - nsHTMLContainerFrame(aContext) + nsContainerFrame(aContext) { } @@ -183,7 +183,7 @@ nsTableOuterFrame::~nsTableOuterFrame() NS_QUERYFRAME_HEAD(nsTableOuterFrame) NS_QUERYFRAME_ENTRY(nsITableLayout) -NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame) +NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame) #ifdef ACCESSIBILITY already_AddRefed @@ -204,7 +204,7 @@ nsTableOuterFrame::DestroyFrom(nsIFrame* aDestructRoot) { DestroyAbsoluteFrames(aDestructRoot); mCaptionFrames.DestroyFramesFrom(aDestructRoot); - nsHTMLContainerFrame::DestroyFrom(aDestructRoot); + nsContainerFrame::DestroyFrom(aDestructRoot); } nsFrameList @@ -214,13 +214,13 @@ nsTableOuterFrame::GetChildList(ChildListID aListID) const return mCaptionFrames; } - return nsHTMLContainerFrame::GetChildList(aListID); + return nsContainerFrame::GetChildList(aListID); } void nsTableOuterFrame::GetChildLists(nsTArray* aLists) const { - nsHTMLContainerFrame::GetChildLists(aLists); + nsContainerFrame::GetChildLists(aLists); mCaptionFrames.AppendIfNonempty(aLists, kCaptionList); } diff --git a/layout/tables/nsTableOuterFrame.h b/layout/tables/nsTableOuterFrame.h index 7fb7d8ae557..5580214910e 100644 --- a/layout/tables/nsTableOuterFrame.h +++ b/layout/tables/nsTableOuterFrame.h @@ -38,7 +38,7 @@ #define nsTableOuterFrame_h__ #include "nscore.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsBlockFrame.h" #include "nsITableLayout.h" #include "nsTableFrame.h" @@ -82,7 +82,7 @@ protected: * the nsTableOuterFrame contains 0 or one caption frame, and a nsTableFrame * pseudo-frame (referred to as the "inner frame'). */ -class nsTableOuterFrame : public nsHTMLContainerFrame, public nsITableLayout +class nsTableOuterFrame : public nsContainerFrame, public nsITableLayout { public: NS_DECL_QUERYFRAME @@ -188,7 +188,7 @@ protected: /** Always returns 0, since the outer table frame has no border of its own * The inner table frame can answer this question in a meaningful way. - * @see nsHTMLContainerFrame::GetSkipSides */ + * @see nsContainerFrame::GetSkipSides */ virtual PRIntn GetSkipSides() const; PRUint8 GetCaptionSide(); // NS_STYLE_CAPTION_SIDE_* or NO_SIDE diff --git a/layout/tables/nsTableRowFrame.cpp b/layout/tables/nsTableRowFrame.cpp index eeb0b012269..40f1fa64bb7 100644 --- a/layout/tables/nsTableRowFrame.cpp +++ b/layout/tables/nsTableRowFrame.cpp @@ -148,10 +148,10 @@ nsTableRowFrame::SetPctHeight(float aPctValue, NS_QUERYFRAME_HEAD(nsTableRowFrame) NS_QUERYFRAME_ENTRY(nsTableRowFrame) -NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame) +NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame) nsTableRowFrame::nsTableRowFrame(nsStyleContext* aContext) - : nsHTMLContainerFrame(aContext) + : nsContainerFrame(aContext) { mBits.mRowIndex = mBits.mFirstInserted = 0; ResetHeight(0); @@ -169,7 +169,7 @@ nsTableRowFrame::Init(nsIContent* aContent, nsresult rv; // Let the base class do its initialization - rv = nsHTMLContainerFrame::Init(aContent, aParent, aPrevInFlow); + rv = nsContainerFrame::Init(aContent, aParent, aPrevInFlow); NS_ASSERTION(NS_STYLE_DISPLAY_TABLE_ROW == GetStyleDisplay()->mDisplay, "wrong display on table row frame"); diff --git a/layout/tables/nsTableRowFrame.h b/layout/tables/nsTableRowFrame.h index 8c9e1e1e67c..77a5fdc7481 100644 --- a/layout/tables/nsTableRowFrame.h +++ b/layout/tables/nsTableRowFrame.h @@ -38,7 +38,7 @@ #define nsTableRowFrame_h__ #include "nscore.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsTablePainter.h" class nsTableFrame; @@ -64,7 +64,7 @@ struct nsTableCellReflowState; * @see nsTableRowGroupFrame * @see nsTableCellFrame */ -class nsTableRowFrame : public nsHTMLContainerFrame +class nsTableRowFrame : public nsContainerFrame { public: NS_DECL_QUERYFRAME_TARGET(nsTableRowFrame) @@ -267,7 +267,7 @@ protected: bool aBorderCollapse, nsTableCellReflowState& aReflowState); - /** implement abstract method on nsHTMLContainerFrame */ + /** implement abstract method on nsContainerFrame */ virtual PRIntn GetSkipSides() const; // row-specific methods diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp index a1638f304fb..5aa1e7f5844 100644 --- a/layout/tables/nsTableRowGroupFrame.cpp +++ b/layout/tables/nsTableRowGroupFrame.cpp @@ -56,7 +56,7 @@ using namespace mozilla; nsTableRowGroupFrame::nsTableRowGroupFrame(nsStyleContext* aContext): - nsHTMLContainerFrame(aContext) + nsContainerFrame(aContext) { SetRepeatable(false); } @@ -67,7 +67,7 @@ nsTableRowGroupFrame::~nsTableRowGroupFrame() NS_QUERYFRAME_HEAD(nsTableRowGroupFrame) NS_QUERYFRAME_ENTRY(nsTableRowGroupFrame) -NS_QUERYFRAME_TAIL_INHERITING(nsHTMLContainerFrame) +NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame) PRInt32 nsTableRowGroupFrame::GetRowCount() diff --git a/layout/tables/nsTableRowGroupFrame.h b/layout/tables/nsTableRowGroupFrame.h index daddb91fa07..f9e12788e79 100644 --- a/layout/tables/nsTableRowGroupFrame.h +++ b/layout/tables/nsTableRowGroupFrame.h @@ -38,7 +38,7 @@ #define nsTableRowGroupFrame_h__ #include "nscore.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsIAtom.h" #include "nsILineIterator.h" #include "nsTablePainter.h" @@ -92,7 +92,7 @@ struct nsRowGroupReflowState { * @see nsTableRowFrame */ class nsTableRowGroupFrame - : public nsHTMLContainerFrame + : public nsContainerFrame , public nsILineIterator { public: @@ -363,7 +363,7 @@ protected: bool aBorderCollapse, nsHTMLReflowState& aReflowState); - /** implement abstract method on nsHTMLContainerFrame */ + /** implement abstract method on nsContainerFrame */ virtual PRIntn GetSkipSides() const; void PlaceChild(nsPresContext* aPresContext, diff --git a/layout/xul/base/src/nsBox.cpp b/layout/xul/base/src/nsBox.cpp index c6814f52594..76a069be9d0 100644 --- a/layout/xul/base/src/nsBox.cpp +++ b/layout/xul/base/src/nsBox.cpp @@ -43,7 +43,7 @@ #include "nsPresContext.h" #include "nsCOMPtr.h" #include "nsIContent.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsINameSpaceManager.h" #include "nsGkAtoms.h" #include "nsFrameManager.h" @@ -616,12 +616,8 @@ nsBox::SyncLayout(nsBoxLayoutState& aState) if (view) { // Make sure the frame's view is properly sized and positioned and has // things like opacity correct - nsHTMLContainerFrame::SyncFrameViewAfterReflow( - presContext, - this, - view, - visualOverflow, - flags); + nsContainerFrame::SyncFrameViewAfterReflow(presContext, this, view, + visualOverflow, flags); } return NS_OK; diff --git a/layout/xul/base/src/nsBoxFrame.cpp b/layout/xul/base/src/nsBoxFrame.cpp index 254aec7c00e..c929cd3d763 100644 --- a/layout/xul/base/src/nsBoxFrame.cpp +++ b/layout/xul/base/src/nsBoxFrame.cpp @@ -84,7 +84,7 @@ #include "nsIScrollableFrame.h" #include "nsWidgetsCID.h" #include "nsCSSAnonBoxes.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsIDOMDocument.h" #include "nsIDOMElement.h" #include "nsITheme.h" diff --git a/layout/xul/base/src/nsBoxLayout.cpp b/layout/xul/base/src/nsBoxLayout.cpp index fd04a8ed51a..20f80f6ec1d 100644 --- a/layout/xul/base/src/nsBoxLayout.cpp +++ b/layout/xul/base/src/nsBoxLayout.cpp @@ -45,7 +45,7 @@ #include "nsBox.h" #include "nsCOMPtr.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsBoxLayout.h" void diff --git a/layout/xul/base/src/nsDeckFrame.cpp b/layout/xul/base/src/nsDeckFrame.cpp index 68d6a13b4ea..8de8ceb8fff 100644 --- a/layout/xul/base/src/nsDeckFrame.cpp +++ b/layout/xul/base/src/nsDeckFrame.cpp @@ -56,7 +56,7 @@ #include "nsBoxLayoutState.h" #include "nsStackLayout.h" #include "nsDisplayList.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" nsIFrame* NS_NewDeckFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) diff --git a/layout/xul/base/src/nsImageBoxFrame.cpp b/layout/xul/base/src/nsImageBoxFrame.cpp index fa6a186feb7..ca07631f137 100644 --- a/layout/xul/base/src/nsImageBoxFrame.cpp +++ b/layout/xul/base/src/nsImageBoxFrame.cpp @@ -61,7 +61,7 @@ #include "nsILinkHandler.h" #include "nsIURL.h" #include "nsILoadGroup.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "prprf.h" #include "nsCSSRendering.h" #include "nsIDOMHTMLImageElement.h" diff --git a/layout/xul/base/src/nsLeafBoxFrame.cpp b/layout/xul/base/src/nsLeafBoxFrame.cpp index d5906cedf12..520d97a3163 100644 --- a/layout/xul/base/src/nsLeafBoxFrame.cpp +++ b/layout/xul/base/src/nsLeafBoxFrame.cpp @@ -53,7 +53,7 @@ #include "nsBoxLayoutState.h" #include "nsWidgetsCID.h" #include "nsIViewManager.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsDisplayList.h" // diff --git a/layout/xul/base/src/nsSplitterFrame.cpp b/layout/xul/base/src/nsSplitterFrame.cpp index 26871781af3..3f40703f2d1 100644 --- a/layout/xul/base/src/nsSplitterFrame.cpp +++ b/layout/xul/base/src/nsSplitterFrame.cpp @@ -63,7 +63,7 @@ #include "nsBoxLayoutState.h" #include "nsIXBLService.h" #include "nsIServiceManager.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsGUIEvent.h" #include "nsAutoPtr.h" #include "nsContentCID.h" diff --git a/layout/xul/base/src/nsSprocketLayout.cpp b/layout/xul/base/src/nsSprocketLayout.cpp index 60b1a5960f4..4cb73dede84 100644 --- a/layout/xul/base/src/nsSprocketLayout.cpp +++ b/layout/xul/base/src/nsSprocketLayout.cpp @@ -50,7 +50,7 @@ #include "nsCOMPtr.h" #include "nsIContent.h" #include "nsIPresShell.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsBoxFrame.h" #include "nsBoxFrame.h" diff --git a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp index b19c2583a5c..68682cbcb77 100644 --- a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp +++ b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp @@ -77,7 +77,7 @@ #include "nsCSSRendering.h" #include "nsIXULTemplateBuilder.h" #include "nsXPIDLString.h" -#include "nsHTMLContainerFrame.h" +#include "nsContainerFrame.h" #include "nsIView.h" #include "nsIViewManager.h" #include "nsWidgetsCID.h"