зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1301630 - Remove nsBlockFrame::SetFlags(). r=bz
Per bug 1299753 comment 20, SetFlags() is designed for flag propagation to continuations during block reflow. To avoid misuse, I expand SetFlags() directly in the only reasonable caller nsBlackFrame::Init(), and replace other usages by AddStateBits(). MozReview-Commit-ID: GsbE2Z0Rps1 --HG-- extra : rebase_source : 72a64e9218870d638f67d1b586f533cd7d16c491
This commit is contained in:
Родитель
21f8f5eff5
Коммит
2884834832
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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() {}
|
||||
};
|
||||
|
|
|
@ -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___ */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче