diff --git a/layout/mathml/base/src/nsMathMLContainerFrame.cpp b/layout/mathml/base/src/nsMathMLContainerFrame.cpp index dedd990b7491..3f65d30de33c 100644 --- a/layout/mathml/base/src/nsMathMLContainerFrame.cpp +++ b/layout/mathml/base/src/nsMathMLContainerFrame.cpp @@ -123,18 +123,19 @@ nsMathMLContainerFrame::IsOnlyWhitespace(nsIFrame* aFrame) } void -nsMathMLContainerFrame::ReflowEmptyChild(nsIFrame* aFrame) +nsMathMLContainerFrame::ReflowEmptyChild(nsIPresContext& aPresContext, + nsIFrame* aFrame) { // nsHTMLReflowMetrics emptySize(nsnull); // nsHTMLReflowState emptyReflowState(aPresContext, aReflowState, aFrame, nsSize(0,0)); // nsresult rv = ReflowChild(aFrame, aPresContext, emptySize, emptyReflowState, aStatus); // 0-size the frame - aFrame->SetRect(nsRect(0,0,0,0)); + aFrame->SetRect(&aPresContext, nsRect(0,0,0,0)); - // 0-size the view + // 0-size the view, if any nsIView* view = nsnull; - aFrame->GetView(&view); + aFrame->GetView(&aPresContext, &view); if (view) { nsCOMPtr vm; view->GetViewManager(*getter_AddRefs(vm)); @@ -404,7 +405,7 @@ nsMathMLContainerFrame::Reflow(nsIPresContext& aPresContext, ////////////// // WHITESPACE: don't forget that whitespace doesn't count in MathML! if (IsOnlyWhitespace(childFrame)) { - ReflowEmptyChild(childFrame); + ReflowEmptyChild(aPresContext, childFrame); } else { nsHTMLReflowState childReflowState(aPresContext, aReflowState, childFrame, availSize); @@ -417,7 +418,8 @@ nsMathMLContainerFrame::Reflow(nsIPresContext& aPresContext, // At this stage, the origin points of the children have no use, so we will use the // origins as placeholders to store the child's ascent and descent. Before return, // we should set the origins so as to overwrite what we are storing there now. - childFrame->SetRect(nsRect(childDesiredSize.descent, childDesiredSize.ascent, + childFrame->SetRect(&aPresContext, + nsRect(childDesiredSize.descent, childDesiredSize.ascent, childDesiredSize.width, childDesiredSize.height)); aDesiredSize.width += childDesiredSize.width; @@ -455,7 +457,8 @@ nsMathMLContainerFrame::Reflow(nsIPresContext& aPresContext, if (NS_SUCCEEDED(rv) && nsnull != aMathMLFrame) { aMathMLFrame->Stretch(aPresContext, stretchDir, parentSize, childSize); // store the updated metrics - childFrame->SetRect(nsRect(childSize.descent, childSize.ascent, + childFrame->SetRect(&aPresContext, + nsRect(childSize.descent, childSize.ascent, childSize.width, childSize.height)); } @@ -479,7 +482,7 @@ nsMathMLContainerFrame::Reflow(nsIPresContext& aPresContext, while (nsnull != childFrame) { childFrame->GetRect(rect); offset.y = aDesiredSize.ascent - rect.y; - childFrame->MoveTo(offset.x,offset.y); + childFrame->MoveTo(&aPresContext, offset.x,offset.y); offset.x += rect.width; rv = childFrame->GetNextSibling(&childFrame); NS_ASSERTION(NS_SUCCEEDED(rv),"failed to get next child"); diff --git a/layout/mathml/base/src/nsMathMLContainerFrame.h b/layout/mathml/base/src/nsMathMLContainerFrame.h index d8ee707831db..f5e366898fde 100644 --- a/layout/mathml/base/src/nsMathMLContainerFrame.h +++ b/layout/mathml/base/src/nsMathMLContainerFrame.h @@ -115,7 +115,8 @@ public: IsOnlyWhitespace(nsIFrame* aFrame); static void - ReflowEmptyChild(nsIFrame* aFrame); + ReflowEmptyChild(nsIPresContext& aPresContext, + nsIFrame* aFrame); protected: diff --git a/layout/mathml/base/src/nsMathMLmfracFrame.cpp b/layout/mathml/base/src/nsMathMLmfracFrame.cpp index fa47e9425d7c..89574d2b5cdf 100644 --- a/layout/mathml/base/src/nsMathMLmfracFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmfracFrame.cpp @@ -182,7 +182,7 @@ nsMathMLmfracFrame::Reflow(nsIPresContext& aPresContext, ////////////// // WHITESPACE: don't forget that whitespace doesn't count in MathML! if (IsOnlyWhitespace(childFrame)) { - ReflowEmptyChild(childFrame); + ReflowEmptyChild(aPresContext, childFrame); } else if (2 > count) { @@ -238,8 +238,8 @@ nsMathMLmfracFrame::Reflow(nsIPresContext& aPresContext, rect[0].y = 0; rect[1].y = aDesiredSize.height - rect[1].height; - child[0]->SetRect(rect[0]); - child[1]->SetRect(rect[1]); + child[0]->SetRect(&aPresContext, rect[0]); + child[1]->SetRect(&aPresContext, rect[1]); SetLineOrigin(nsPoint(0,rect[0].height)); // position the fraction bar if (nsnull != aDesiredSize.maxElementSize) { diff --git a/layout/mathml/base/src/nsMathMLmmultiscriptsFrame.cpp b/layout/mathml/base/src/nsMathMLmmultiscriptsFrame.cpp index 094ae13fd802..f87c4eceebd6 100644 --- a/layout/mathml/base/src/nsMathMLmmultiscriptsFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmmultiscriptsFrame.cpp @@ -93,7 +93,7 @@ nsMathMLmmultiscriptsFrame::Reflow(nsIPresContext& aPresContext, ////////////// // WHITESPACE: don't forget that whitespace doesn't count in MathML! if (IsOnlyWhitespace(childFrame)) { - ReflowEmptyChild(childFrame); + ReflowEmptyChild(aPresContext, childFrame); } else { nsCOMPtr childContent; @@ -150,7 +150,8 @@ nsMathMLmmultiscriptsFrame::Reflow(nsIPresContext& aPresContext, // At this stage, the origin points of the children have no use, so we will use the // origins to store the child's ascent and descent. At the next pass, we should // set the origins so as to overwrite what we are storing there now - childFrame->SetRect(nsRect(childDesiredSize.descent, childDesiredSize.ascent, + childFrame->SetRect(&aPresContext, + nsRect(childDesiredSize.descent, childDesiredSize.ascent, childDesiredSize.width, childDesiredSize.height)); isSubscript = !isSubscript; count++; @@ -198,7 +199,7 @@ nsMathMLmmultiscriptsFrame::Reflow(nsIPresContext& aPresContext, childFrame->GetRect(rect[0]); rect[0].x = offset; rect[0].y = aDesiredSize.height - subHeight; - childFrame->SetRect(rect[0]); + childFrame->SetRect(&aPresContext, rect[0]); offset += rect[0].width; } else if (mprescriptsFrame != childFrame) { @@ -219,8 +220,8 @@ nsMathMLmmultiscriptsFrame::Reflow(nsIPresContext& aPresContext, rect[0].x = offset + (width - rect[0].width) / 2; // centering rect[1].x = offset + (width - rect[1].width) / 2; - child[0]->SetRect(rect[0]); - child[1]->SetRect(rect[1]); + child[0]->SetRect(&aPresContext, rect[0]); + child[1]->SetRect(&aPresContext, rect[1]); offset += width; } } diff --git a/layout/mathml/base/src/nsMathMLmoFrame.cpp b/layout/mathml/base/src/nsMathMLmoFrame.cpp index 18b3cede3f73..177921fe1525 100644 --- a/layout/mathml/base/src/nsMathMLmoFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmoFrame.cpp @@ -358,7 +358,7 @@ nsMathMLmoFrame::Stretch(nsIPresContext& aPresContext, while (nsnull != childFrame) { if (!IsOnlyWhitespace(childFrame)) { childFrame->GetRect(rect); - childFrame->MoveTo(dx, rect.y + mCharOffset.y); + childFrame->MoveTo(&aPresContext, dx, rect.y + mCharOffset.y); dx += rect.width; } childFrame->GetNextSibling(&childFrame); diff --git a/layout/mathml/base/src/nsMathMLmoverFrame.cpp b/layout/mathml/base/src/nsMathMLmoverFrame.cpp index 21be9efbc507..f4d110015d29 100644 --- a/layout/mathml/base/src/nsMathMLmoverFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmoverFrame.cpp @@ -89,7 +89,7 @@ nsMathMLmoverFrame::Reflow(nsIPresContext& aPresContext, ////////////// // WHITESPACE: don't forget that whitespace doesn't count in MathML! if (IsOnlyWhitespace(childFrame)) { - ReflowEmptyChild(childFrame); + ReflowEmptyChild(aPresContext, childFrame); } else if (2 > count) { nsHTMLReflowState childReflowState(aPresContext, aReflowState, @@ -140,8 +140,8 @@ nsMathMLmoverFrame::Reflow(nsIPresContext& aPresContext, aDesiredSize.ascent -= leading; rect[0].y -= leading; // - child[0]->SetRect(rect[0]); - child[1]->SetRect(rect[1]); + child[0]->SetRect(&aPresContext, rect[0]); + child[1]->SetRect(&aPresContext, rect[1]); if (nsnull != aDesiredSize.maxElementSize) { aDesiredSize.maxElementSize->width = aDesiredSize.width; diff --git a/layout/mathml/base/src/nsMathMLmsubFrame.cpp b/layout/mathml/base/src/nsMathMLmsubFrame.cpp index b9fb0181571e..e0b30bef2a76 100644 --- a/layout/mathml/base/src/nsMathMLmsubFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmsubFrame.cpp @@ -89,7 +89,7 @@ nsMathMLmsubFrame::Reflow(nsIPresContext& aPresContext, ////////////// // WHITESPACE: don't forget that whitespace doesn't count in MathML! if (IsOnlyWhitespace(childFrame)) { - ReflowEmptyChild(childFrame); + ReflowEmptyChild(aPresContext, childFrame); } else if (2 > count) { nsHTMLReflowState childReflowState(aPresContext, aReflowState, @@ -151,8 +151,8 @@ subscriptOffset = PR_MAX(subscriptOffset,fmAscent-(xHeight*4)/5); rect[1].y = aDesiredSize.height - rect[1].height; aDesiredSize.descent = aDesiredSize.height - aDesiredSize.ascent; - child[0]->SetRect(rect[0]); - child[1]->SetRect(rect[1]); + child[0]->SetRect(&aPresContext, rect[0]); + child[1]->SetRect(&aPresContext, rect[1]); if (nsnull != aDesiredSize.maxElementSize) { aDesiredSize.maxElementSize->width = aDesiredSize.width; diff --git a/layout/mathml/base/src/nsMathMLmsubsupFrame.cpp b/layout/mathml/base/src/nsMathMLmsubsupFrame.cpp index bf1382c4c31a..2b16c1051a98 100644 --- a/layout/mathml/base/src/nsMathMLmsubsupFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmsubsupFrame.cpp @@ -90,7 +90,7 @@ nsMathMLmsubsupFrame::Reflow(nsIPresContext& aPresContext, ////////////// // WHITESPACE: don't forget that whitespace doesn't count in MathML! if (IsOnlyWhitespace(childFrame)) { - ReflowEmptyChild(childFrame); + ReflowEmptyChild(aPresContext, childFrame); } else if (3 > count) { nsHTMLReflowState childReflowState(aPresContext, aReflowState, @@ -159,9 +159,9 @@ subscriptOffset = PR_MAX(subscriptOffset,fmAscent-(xHeight*4)/5); rect[1].y = aDesiredSize.height - rect[1].height; rect[0].y = aDesiredSize.height - subHeight; - child[0]->SetRect(rect[0]); - child[1]->SetRect(rect[1]); - child[2]->SetRect(rect[2]); + child[0]->SetRect(&aPresContext, rect[0]); + child[1]->SetRect(&aPresContext, rect[1]); + child[2]->SetRect(&aPresContext, rect[2]); if (nsnull != aDesiredSize.maxElementSize) { aDesiredSize.maxElementSize->width = aDesiredSize.width; diff --git a/layout/mathml/base/src/nsMathMLmsupFrame.cpp b/layout/mathml/base/src/nsMathMLmsupFrame.cpp index 0c5b381a641b..d9d8638805e4 100644 --- a/layout/mathml/base/src/nsMathMLmsupFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmsupFrame.cpp @@ -89,7 +89,7 @@ nsMathMLmsupFrame::Reflow(nsIPresContext& aPresContext, ////////////// // WHITESPACE: don't forget that whitespace doesn't count in MathML! if (IsOnlyWhitespace(childFrame)) { - ReflowEmptyChild(childFrame); + ReflowEmptyChild(aPresContext, childFrame); } else if (2 > count) { @@ -138,8 +138,8 @@ nsMathMLmsupFrame::Reflow(nsIPresContext& aPresContext, rect[0].y = aDesiredSize.height - rect[0].height; aDesiredSize.ascent = aDesiredSize.height - aDesiredSize.descent; - child[0]->SetRect(rect[0]); - child[1]->SetRect(rect[1]); + child[0]->SetRect(&aPresContext, rect[0]); + child[1]->SetRect(&aPresContext, rect[1]); if (nsnull != aDesiredSize.maxElementSize) { aDesiredSize.maxElementSize->width = aDesiredSize.width; diff --git a/layout/mathml/base/src/nsMathMLmunderFrame.cpp b/layout/mathml/base/src/nsMathMLmunderFrame.cpp index 42054f0d5b73..6700f14bbf20 100644 --- a/layout/mathml/base/src/nsMathMLmunderFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmunderFrame.cpp @@ -89,7 +89,7 @@ nsMathMLmunderFrame::Reflow(nsIPresContext& aPresContext, ////////////// // WHITESPACE: don't forget that whitespace doesn't count in MathML! if (IsOnlyWhitespace(childFrame)) { - ReflowEmptyChild(childFrame); + ReflowEmptyChild(aPresContext, childFrame); } else if (2 > count) { nsHTMLReflowState childReflowState(aPresContext, aReflowState, @@ -151,8 +151,8 @@ nsMathMLmunderFrame::Reflow(nsIPresContext& aPresContext, aDesiredSize.descent -= leading; rect[1].y -= leading; // - child[0]->SetRect(rect[0]); - child[1]->SetRect(rect[1]); + child[0]->SetRect(&aPresContext, rect[0]); + child[1]->SetRect(&aPresContext, rect[1]); if (nsnull != aDesiredSize.maxElementSize) { aDesiredSize.maxElementSize->width = aDesiredSize.width; diff --git a/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp b/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp index 5fbe76825d51..c75e8d9694b9 100644 --- a/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp @@ -91,7 +91,7 @@ nsMathMLmunderoverFrame::Reflow(nsIPresContext& aPresContext, ////////////// // WHITESPACE: don't forget that whitespace doesn't count in MathML! if (IsOnlyWhitespace(childFrame)) { - ReflowEmptyChild(childFrame); + ReflowEmptyChild(aPresContext, childFrame); } else if (3 > count) { nsHTMLReflowState childReflowState(aPresContext, aReflowState, @@ -151,9 +151,9 @@ nsMathMLmunderoverFrame::Reflow(nsIPresContext& aPresContext, rect[0].y -= leading; rect[1].y -= 2*leading; // - child[0]->SetRect(rect[0]); - child[1]->SetRect(rect[1]); - child[2]->SetRect(rect[2]); + child[0]->SetRect(&aPresContext, rect[0]); + child[1]->SetRect(&aPresContext, rect[1]); + child[2]->SetRect(&aPresContext, rect[2]); if (nsnull != aDesiredSize.maxElementSize) { aDesiredSize.maxElementSize->width = aDesiredSize.width;