<mspace> is a leaf frame. Don't create bogus child frames inside <mspace> having invalid markup with child content. b=323741, r+sr=roc

This commit is contained in:
rbs%maths.uq.edu.au 2006-01-21 02:46:19 +00:00
parent d6b2459e61
commit 03a32f07c9
3 changed files with 23 additions and 8 deletions

View File

@ -7272,7 +7272,9 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsFrameConstructorState& aState,
newFrame = NS_NewMathMLmphantomFrame(mPresShell);
else if (aTag == nsMathMLAtoms::mpadded_)
newFrame = NS_NewMathMLmpaddedFrame(mPresShell);
else if (aTag == nsMathMLAtoms::mspace_)
else if (aTag == nsMathMLAtoms::mspace_ ||
aTag == nsMathMLAtoms::none ||
aTag == nsMathMLAtoms::mprescripts_)
newFrame = NS_NewMathMLmspaceFrame(mPresShell);
else if (aTag == nsMathMLAtoms::mfenced_)
newFrame = NS_NewMathMLmfencedFrame(mPresShell);
@ -7286,10 +7288,8 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsFrameConstructorState& aState,
newFrame = NS_NewMathMLmrootFrame(mPresShell);
else if (aTag == nsMathMLAtoms::maction_)
newFrame = NS_NewMathMLmactionFrame(mPresShell);
else if (aTag == nsMathMLAtoms::mrow_ ||
aTag == nsMathMLAtoms::merror_ ||
aTag == nsMathMLAtoms::none ||
aTag == nsMathMLAtoms::mprescripts_ )
else if (aTag == nsMathMLAtoms::mrow_ ||
aTag == nsMathMLAtoms::merror_)
newFrame = NS_NewMathMLmrowFrame(mPresShell);
// CONSTRUCTION of MTABLE elements
else if (aTag == nsMathMLAtoms::mtable_ &&
@ -7393,8 +7393,10 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsFrameConstructorState& aState,
// MathML frames are inline frames, so just process their kids
nsFrameItems childItems;
rv = ProcessChildren(aState, aContent, newFrame, PR_TRUE,
childItems, PR_FALSE);
if (!newFrame->IsLeaf()) {
rv = ProcessChildren(aState, aContent, newFrame, PR_TRUE,
childItems, PR_FALSE);
}
CreateAnonymousFrames(aTag, aState, aContent, newFrame, PR_FALSE,
childItems);
@ -7403,7 +7405,12 @@ nsCSSFrameConstructor::ConstructMathMLFrame(nsFrameConstructorState& aState,
newFrame->SetInitialChildList(aState.mPresContext, nsnull,
childItems.childList);
return CreateInsertionPointChildren(aState, newFrame, aContent);
if (!newFrame->IsLeaf()) {
rv = CreateInsertionPointChildren(aState, newFrame, aContent);
}
return rv;
}
else {
return NS_ERROR_OUT_OF_MEMORY;

View File

@ -66,6 +66,12 @@ nsMathMLmspaceFrame::~nsMathMLmspaceFrame()
{
}
PRBool
nsMathMLmspaceFrame::IsLeaf() const
{
return PR_TRUE;
}
void
nsMathMLmspaceFrame::ProcessAttributes(nsPresContext* aPresContext)
{

View File

@ -49,6 +49,8 @@ class nsMathMLmspaceFrame : public nsMathMLContainerFrame {
public:
friend nsIFrame* NS_NewMathMLmspaceFrame(nsIPresShell* aPresShell);
virtual PRBool IsLeaf() const;
NS_IMETHOD
Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,