diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 22ef7dae4270..87e1f2a5ea55 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -5061,8 +5061,8 @@ nsCSSFrameConstructor::FlushAccumulatedBlock(nsFrameConstructorState& aState, // MathML frame so that Get(Absolute/Float)ContainingBlockFor know that this // is not a suitable block. nsContainerFrame* blockFrame = - NS_NewMathMLmathBlockFrame(mPresShell, blockContext, - NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT); + NS_NewMathMLmathBlockFrame(mPresShell, blockContext); + blockFrame->AddStateBits(NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT); InitAndRestoreFrame(aState, aContent, aParentFrame, blockFrame); ReparentFrames(this, blockFrame, aBlockItems); @@ -5102,7 +5102,7 @@ nsCSSFrameConstructor::FindMathMLData(Element* aElement, static const FrameConstructionData sBlockMathData = FCDATA_DECL(FCDATA_FORCE_NULL_ABSPOS_CONTAINER | FCDATA_WRAP_KIDS_IN_BLOCKS, - NS_CreateNewMathMLmathBlockFrame); + NS_NewMathMLmathBlockFrame); return &sBlockMathData; } diff --git a/layout/forms/nsSelectsAreaFrame.cpp b/layout/forms/nsSelectsAreaFrame.cpp index cb30e430f317..dd613ae9fd2b 100644 --- a/layout/forms/nsSelectsAreaFrame.cpp +++ b/layout/forms/nsSelectsAreaFrame.cpp @@ -17,7 +17,7 @@ NS_NewSelectsAreaFrame(nsIPresShell* aShell, nsStyleContext* aContext, nsFrameSt // We need NS_BLOCK_FLOAT_MGR to ensure that the options inside the select // aren't expanded by right floats outside the select. - it->SetFlags(aFlags | NS_BLOCK_FLOAT_MGR); + it->AddStateBits(aFlags | NS_BLOCK_FLOAT_MGR); return it; } diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 912ddfb71511..cdf4ae78722e 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -6799,8 +6799,9 @@ nsBlockFrame::Init(nsIContent* aContent, { if (aPrevInFlow) { // Copy over the inherited block frame bits from the prev-in-flow. - SetFlags(aPrevInFlow->GetStateBits() & - (NS_BLOCK_FLAGS_MASK & ~NS_BLOCK_FLAGS_NON_INHERITED_MASK)); + RemoveStateBits(NS_BLOCK_FLAGS_MASK); + AddStateBits(aPrevInFlow->GetStateBits() & + (NS_BLOCK_FLAGS_MASK & ~NS_BLOCK_FLAGS_NON_INHERITED_MASK)); } nsContainerFrame::Init(aContent, aParent, aPrevInFlow); diff --git a/layout/generic/nsBlockFrame.h b/layout/generic/nsBlockFrame.h index 6adcecb98d6c..6f7ccb47023f 100644 --- a/layout/generic/nsBlockFrame.h +++ b/layout/generic/nsBlockFrame.h @@ -396,11 +396,6 @@ protected: bool* aInOverflowLines, FrameLines** aOverflowLines); - void SetFlags(nsFrameState aFlags) { - mState &= ~NS_BLOCK_FLAGS_MASK; - mState |= aFlags; - } - /** move the frames contained by aLine by aDeltaBCoord * if aLine is a block, its child floats are added to the state manager */ diff --git a/layout/mathml/nsMathMLContainerFrame.cpp b/layout/mathml/nsMathMLContainerFrame.cpp index fcf2576d0f47..ad1b13efded8 100644 --- a/layout/mathml/nsMathMLContainerFrame.cpp +++ b/layout/mathml/nsMathMLContainerFrame.cpp @@ -1583,12 +1583,9 @@ nsMathMLContainerFrame::ReportInvalidChildError(nsIAtom* aChildTag) //========================== nsContainerFrame* -NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, - nsFrameState aFlags) +NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { - nsMathMLmathBlockFrame* it = new (aPresShell) nsMathMLmathBlockFrame(aContext); - it->SetFlags(aFlags); - return it; + return new (aPresShell) nsMathMLmathBlockFrame(aContext); } NS_IMPL_FRAMEARENA_HELPERS(nsMathMLmathBlockFrame) diff --git a/layout/mathml/nsMathMLContainerFrame.h b/layout/mathml/nsMathMLContainerFrame.h index 53599f401cee..be71e00cc87d 100644 --- a/layout/mathml/nsMathMLContainerFrame.h +++ b/layout/mathml/nsMathMLContainerFrame.h @@ -418,7 +418,7 @@ public: NS_DECL_FRAMEARENA_HELPERS friend nsContainerFrame* NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, - nsStyleContext* aContext, nsFrameState aFlags); + nsStyleContext* aContext); // beware, mFrames is not set by nsBlockFrame // cannot use mFrames{.FirstChild()|.etc} since the block code doesn't set mFrames @@ -481,7 +481,8 @@ protected: explicit nsMathMLmathBlockFrame(nsStyleContext* aContext) : nsBlockFrame(aContext) { // We should always have a float manager. Not that things can really try // to float out of us anyway, but we need one for line layout. - AddStateBits(NS_BLOCK_FLOAT_MGR); + // Bug 1301881: Do we still need to set NS_BLOCK_FLOAT_MGR? + // AddStateBits(NS_BLOCK_FLOAT_MGR); } virtual ~nsMathMLmathBlockFrame() {} }; diff --git a/layout/mathml/nsMathMLParts.h b/layout/mathml/nsMathMLParts.h index c3907e6696ca..5d4285ee9093 100644 --- a/layout/mathml/nsMathMLParts.h +++ b/layout/mathml/nsMathMLParts.h @@ -36,10 +36,6 @@ nsIFrame* NS_NewMathMLmactionFrame(nsIPresShell* aPresShell, nsStyleContext* aCo nsIFrame* NS_NewMathMLmencloseFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsIFrame* NS_NewMathMLsemanticsFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -nsContainerFrame* NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, nsFrameState aFlags); +nsContainerFrame* NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); nsContainerFrame* NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -inline nsContainerFrame* NS_CreateNewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) -{ - return NS_NewMathMLmathBlockFrame(aPresShell, aContext, nsFrameState(0)); -} #endif /* nsMathMLParts_h___ */ diff --git a/layout/xul/nsXULLabelFrame.cpp b/layout/xul/nsXULLabelFrame.cpp index 26619b1810a9..22b8754617c6 100644 --- a/layout/xul/nsXULLabelFrame.cpp +++ b/layout/xul/nsXULLabelFrame.cpp @@ -16,8 +16,8 @@ nsIFrame* NS_NewXULLabelFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { nsXULLabelFrame* it = new (aPresShell) nsXULLabelFrame(aContext); - - it->SetFlags(NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT); + + it->AddStateBits(NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT); return it; }