Bug 409383 - Switch sometimes ends up with multiple child frames. r+sr=roc,a1.9=beltzner

git-svn-id: svn://10.0.0.236/trunk@242298 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
longsonr%gmail.com
2008-01-03 14:30:03 +00:00
parent 54a9bd0356
commit 3342e265a7
4 changed files with 96 additions and 3 deletions

View File

@@ -175,6 +175,8 @@ NS_NewSVGAFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext*
nsIFrame*
NS_NewSVGGlyphFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame* parent, nsStyleContext* aContext);
nsIFrame*
NS_NewSVGSwitchFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext);
nsIFrame*
NS_NewSVGTextFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsStyleContext* aContext);
nsIFrame*
NS_NewSVGTSpanFrame(nsIPresShell* aPresShell, nsIContent* aContent, nsIFrame* parent, nsStyleContext* aContext);
@@ -7347,7 +7349,7 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsFrameConstructorState& aState,
// Are we another child of a switch which already has a child
if (aParentFrame &&
aParentFrame->GetType() == nsGkAtoms::svgSwitch &&
aParentFrame->GetType() == nsGkAtoms::svgSwitchFrame &&
aParentFrame->GetFirstChild(nsnull)) {
*aHaltProcessing = PR_TRUE;
return NS_OK;
@@ -7396,10 +7398,12 @@ nsCSSFrameConstructor::ConstructSVGFrame(nsFrameConstructorState& aState,
newFrame = NS_NewSVGInnerSVGFrame(mPresShell, aContent, aStyleContext);
}
}
else if (aTag == nsGkAtoms::g ||
aTag == nsGkAtoms::svgSwitch) {
else if (aTag == nsGkAtoms::g) {
newFrame = NS_NewSVGGFrame(mPresShell, aContent, aStyleContext);
}
else if (aTag == nsGkAtoms::svgSwitch) {
newFrame = NS_NewSVGSwitchFrame(mPresShell, aContent, aStyleContext);
}
else if (aTag == nsGkAtoms::polygon ||
aTag == nsGkAtoms::polyline ||
aTag == nsGkAtoms::circle ||