зеркало из https://github.com/mozilla/gecko-dev.git
Added a control statement to avoid doing work that will lead nowhere.
This commit is contained in:
Родитель
446b50640e
Коммит
d71c49af3e
|
@ -123,38 +123,38 @@ nsMathMLmiFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
||||||
|
|
||||||
// Insert a new pseudo frame between our children and us, i.e., the new frame
|
// Insert a new pseudo frame between our children and us, i.e., the new frame
|
||||||
// becomes our sole child, and our children become children of the new frame.
|
// becomes our sole child, and our children become children of the new frame.
|
||||||
|
nsIFrame* firstChild = mFrames.FirstChild();
|
||||||
// Get a pseudo style context for the appropriate style font
|
if (firstChild) {
|
||||||
// XXX how important is the PseudoStyleContext?
|
// Get a pseudo style context for the appropriate style font
|
||||||
nsAutoString fontStyle = (1 == aLength)
|
// XXX how important is the PseudoStyleContext?
|
||||||
? ":-moz-math-font-style-italic"
|
nsAutoString fontStyle = (1 == aLength)
|
||||||
: ":-moz-math-font-style-normal";
|
? ":-moz-math-font-style-italic"
|
||||||
nsCOMPtr<nsIAtom> fontAtom(getter_AddRefs(NS_NewAtom(fontStyle)));
|
: ":-moz-math-font-style-normal";
|
||||||
nsCOMPtr<nsIStyleContext> newStyleContext;
|
nsCOMPtr<nsIAtom> fontAtom(getter_AddRefs(NS_NewAtom(fontStyle)));
|
||||||
aPresContext.ResolvePseudoStyleContextFor(mContent, fontAtom, mStyleContext,
|
nsCOMPtr<nsIStyleContext> newStyleContext;
|
||||||
PR_FALSE, getter_AddRefs(newStyleContext));
|
aPresContext.ResolvePseudoStyleContextFor(mContent, fontAtom, mStyleContext,
|
||||||
|
PR_FALSE, getter_AddRefs(newStyleContext));
|
||||||
if (newStyleContext && newStyleContext.get() != mStyleContext) {
|
|
||||||
|
if (newStyleContext && newStyleContext.get() != mStyleContext) {
|
||||||
nsIFrame* newFrame = nsnull;
|
|
||||||
NS_NewMathMLWrapperFrame(&newFrame);
|
nsIFrame* newFrame = nsnull;
|
||||||
NS_ASSERTION(newFrame, "Failed to create new frame");
|
NS_NewMathMLWrapperFrame(&newFrame);
|
||||||
|
NS_ASSERTION(newFrame, "Failed to create new frame");
|
||||||
newFrame->Init(aPresContext, mContent, this, newStyleContext, nsnull);
|
|
||||||
|
newFrame->Init(aPresContext, mContent, this, newStyleContext, nsnull);
|
||||||
// our children become children of the new frame
|
|
||||||
nsIFrame* firstFrame = mFrames.FirstChild();
|
// our children become children of the new frame
|
||||||
nsIFrame* childFrame = firstFrame;
|
nsIFrame* childFrame = firstChild;
|
||||||
while (nsnull != childFrame) {
|
while (childFrame) {
|
||||||
childFrame->SetParent(newFrame);
|
childFrame->SetParent(newFrame);
|
||||||
aPresContext.ReParentStyleContext(childFrame, newStyleContext);
|
aPresContext.ReParentStyleContext(childFrame, newStyleContext);
|
||||||
childFrame->GetNextSibling(&childFrame);
|
childFrame->GetNextSibling(&childFrame);
|
||||||
|
}
|
||||||
|
newFrame->SetInitialChildList(aPresContext, nsnull, firstChild);
|
||||||
|
|
||||||
|
// the new frame becomes our sole child
|
||||||
|
mFrames.SetFrames(newFrame);
|
||||||
}
|
}
|
||||||
newFrame->SetInitialChildList(aPresContext, nsnull, firstFrame);
|
|
||||||
|
|
||||||
// the new frame becomes our sole child
|
|
||||||
mFrames.SetFrames(newFrame);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче