From a1e67de78a93888474d8fc9568ff272f2bca1cf0 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 19 Jan 2009 13:31:32 -0500 Subject: [PATCH] Bug 473390 part 8. Move the display switching out of the frame constructor and into the frame creation function. r+sr=roc --- layout/base/nsCSSFrameConstructor.cpp | 4 +--- layout/mathml/base/src/nsMathMLParts.h | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 80aa92b0787..54af329752b 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -6546,9 +6546,7 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsFrameConstructorState& aState, newFrame = NS_NewMathMLmrowFrame(mPresShell, aStyleContext); else if (aTag == nsGkAtoms::math) { // root element - const nsStyleDisplay* display = aStyleContext->GetStyleDisplay(); - PRBool isBlock = (NS_STYLE_DISPLAY_BLOCK == display->mDisplay); - newFrame = NS_NewMathMLmathFrame(mPresShell, isBlock, aStyleContext); + newFrame = NS_NewMathMLmathFrame(mPresShell, aStyleContext); } else { return NS_OK; diff --git a/layout/mathml/base/src/nsMathMLParts.h b/layout/mathml/base/src/nsMathMLParts.h index 6e5a6306ad5..2b559b4db04 100644 --- a/layout/mathml/base/src/nsMathMLParts.h +++ b/layout/mathml/base/src/nsMathMLParts.h @@ -72,9 +72,9 @@ nsIFrame* NS_NewMathMLmactionFrame(nsIPresShell* aPresShell, nsStyleContext* aCo nsIFrame* NS_NewMathMLmathBlockFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRUint32 aFlags); nsIFrame* NS_NewMathMLmathInlineFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); -inline nsIFrame* NS_NewMathMLmathFrame(nsIPresShell* aPresShell, PRBool aIsBlock, nsStyleContext* aContext) +inline nsIFrame* NS_NewMathMLmathFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) { - return (aIsBlock) + return (NS_STYLE_DISPLAY_BLOCK == aContext->GetStyleDisplay()->mDisplay) ? NS_NewMathMLmathBlockFrame(aPresShell, aContext, 0) : NS_NewMathMLmathInlineFrame(aPresShell, aContext); }