diff --git a/layout/mathml/base/src/nsIMathMLFrame.h b/layout/mathml/base/src/nsIMathMLFrame.h index 314dc64fcb3d..4131f6d1cd90 100644 --- a/layout/mathml/base/src/nsIMathMLFrame.h +++ b/layout/mathml/base/src/nsIMathMLFrame.h @@ -45,12 +45,11 @@ struct nsPresentationData; struct nsEmbellishData; struct nsHTMLReflowMetrics; -// IID for the nsIMathMLFrame interface (the IID was taken from IIDS.h) -/* a6cf9113-15b3-11d2-932e-00805f8add32 */ -#define NS_IMATHMLFRAME_IID \ -{ 0xa6cf9113, 0x15b3, 0x11d2, \ - { 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 } } - +// a781ed45-4338-43cb-9739-a7a8f8418ff3 +#define NS_IMATHMLFRAME_IID \ +{ 0xa781ed45, 0x4338, 0x43cb, \ + { 0x97, 0x39, 0xa7, 0xa8, 0xf8, 0x41, 0x8f, 0xf3 } } + static NS_DEFINE_IID(kIMathMLFrameIID, NS_IMATHMLFRAME_IID); // Abstract base class that provides additional methods for MathML frames @@ -137,11 +136,17 @@ public: * desired size and your ascent/descent info. Compute your desired size * using the information in your children's rectangles, and include any * space you want for border/padding in the desired size you return. + * + * @param aReflowState [out] forwarded argument from Reflow() + * + * @param aStatus [out] forwarded argument from Reflow() */ NS_IMETHOD - Place(nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize) = 0; + Place(nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) = 0; /* GetEmbellishData/SetEmbellishData : * Get/Set the mEmbellishData member variable. diff --git a/layout/mathml/base/src/nsMathMLContainerFrame.cpp b/layout/mathml/base/src/nsMathMLContainerFrame.cpp index c677e3ea5033..89a390bf7eb3 100644 --- a/layout/mathml/base/src/nsMathMLContainerFrame.cpp +++ b/layout/mathml/base/src/nsMathMLContainerFrame.cpp @@ -84,8 +84,10 @@ NS_IMPL_QUERY_INTERFACE_INHERITED1(nsMathMLContainerFrame, nsHTMLContainerFrame, // error handlers // provide a feedback to the user when a frame with bad markup can not be rendered nsresult -nsMathMLContainerFrame::ReflowError(nsIRenderingContext& aRenderingContext, - nsHTMLReflowMetrics& aDesiredSize) +nsMathMLContainerFrame::ReflowError(nsIRenderingContext& aRenderingContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) { nsresult rv; @@ -106,6 +108,8 @@ nsMathMLContainerFrame::ReflowError(nsIRenderingContext& aRenderingContext, NS_WARNING("GetBoundingMetrics failed"); aDesiredSize.width = aDesiredSize.height = 0; aDesiredSize.ascent = aDesiredSize.descent = 0; + aStatus = NS_FRAME_COMPLETE; + NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); return NS_OK; } @@ -123,6 +127,8 @@ nsMathMLContainerFrame::ReflowError(nsIRenderingContext& aRenderingContext, // Also return our bounding metrics aDesiredSize.mBoundingMetrics = mBoundingMetrics; + aStatus = NS_FRAME_COMPLETE; + NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize); return NS_OK; } diff --git a/layout/mathml/base/src/nsMathMLContainerFrame.h b/layout/mathml/base/src/nsMathMLContainerFrame.h index c77bbd9c026d..e86c479a953e 100644 --- a/layout/mathml/base/src/nsMathMLContainerFrame.h +++ b/layout/mathml/base/src/nsMathMLContainerFrame.h @@ -202,8 +202,10 @@ public: // error handlers to provide a visual feedback to the user when an error // (typically invalid markup) was encountered during reflow. virtual nsresult - ReflowError(nsIRenderingContext& aRenderingContext, - nsHTMLReflowMetrics& aDesiredSize); + ReflowError(nsIRenderingContext& aRenderingContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus); // helper method to reflow a child frame. We are inline frames, and we don't // know our positions until reflow is finished. That's why we ask the diff --git a/layout/mathml/base/src/nsMathMLFrame.h b/layout/mathml/base/src/nsMathMLFrame.h index 7259e345d54c..8600156ff342 100644 --- a/layout/mathml/base/src/nsMathMLFrame.h +++ b/layout/mathml/base/src/nsMathMLFrame.h @@ -105,9 +105,11 @@ public: } NS_IMETHOD - Place(nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize) + Place(nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) { return NS_OK; } diff --git a/layout/mathml/base/src/nsMathMLmactionFrame.cpp b/layout/mathml/base/src/nsMathMLmactionFrame.cpp index 16ceadac9bbf..916be560a78b 100644 --- a/layout/mathml/base/src/nsMathMLmactionFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmactionFrame.cpp @@ -315,9 +315,11 @@ nsMathMLmactionFrame::Reflow(nsPresContext* aPresContext, // Only place the selected child ... NS_IMETHODIMP -nsMathMLmactionFrame::Place(nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize) +nsMathMLmactionFrame::Place(nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) { aDesiredSize.width = aDesiredSize.height = 0; aDesiredSize.ascent = aDesiredSize.descent = 0; diff --git a/layout/mathml/base/src/nsMathMLmactionFrame.h b/layout/mathml/base/src/nsMathMLmactionFrame.h index 5c7d8d61cf4a..1c27271f6dd6 100644 --- a/layout/mathml/base/src/nsMathMLmactionFrame.h +++ b/layout/mathml/base/src/nsMathMLmactionFrame.h @@ -77,9 +77,11 @@ public: const nsDisplayListSet& aLists); NS_IMETHOD - Place(nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize); + Place(nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus); NS_IMETHOD Reflow(nsPresContext* aPresContext, diff --git a/layout/mathml/base/src/nsMathMLmfracFrame.cpp b/layout/mathml/base/src/nsMathMLmfracFrame.cpp index b0ff8b8bdbfb..534c845dcc1f 100644 --- a/layout/mathml/base/src/nsMathMLmfracFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmfracFrame.cpp @@ -264,9 +264,11 @@ nsMathMLmfracFrame::FixInterFrameSpacing(nsHTMLReflowMetrics& aDesiredSize) } NS_IMETHODIMP -nsMathMLmfracFrame::Place(nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize) +nsMathMLmfracFrame::Place(nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) { //////////////////////////////////// // Get the children's desired sizes @@ -280,7 +282,7 @@ nsMathMLmfracFrame::Place(nsIRenderingContext& aRenderingContext, if (!frameNum || !frameDen || frameDen->GetNextSibling()) { // report an error, encourage people to get their markups in order NS_WARNING("invalid markup"); - return ReflowError(aRenderingContext, aDesiredSize); + return ReflowError(aRenderingContext, aDesiredSize, aReflowState, aStatus); } GetReflowAndBoundingMetricsFor(frameNum, sizeNum, bmNum); GetReflowAndBoundingMetricsFor(frameDen, sizeDen, bmDen); diff --git a/layout/mathml/base/src/nsMathMLmfracFrame.h b/layout/mathml/base/src/nsMathMLmfracFrame.h index 5afb0134617b..b201845d309f 100644 --- a/layout/mathml/base/src/nsMathMLmfracFrame.h +++ b/layout/mathml/base/src/nsMathMLmfracFrame.h @@ -112,9 +112,11 @@ public: nsReflowStatus& aStatus); NS_IMETHOD - Place(nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize); + Place(nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus); NS_IMETHOD BuildDisplayList(nsDisplayListBuilder* aBuilder, const nsRect& aDirtyRect, diff --git a/layout/mathml/base/src/nsMathMLmmultiscriptsFrame.cpp b/layout/mathml/base/src/nsMathMLmmultiscriptsFrame.cpp index 0f011a20bece..8af708922a3c 100644 --- a/layout/mathml/base/src/nsMathMLmmultiscriptsFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmmultiscriptsFrame.cpp @@ -141,9 +141,11 @@ nsMathMLmmultiscriptsFrame::ProcessAttributes() } NS_IMETHODIMP -nsMathMLmmultiscriptsFrame::Place(nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize) +nsMathMLmmultiscriptsFrame::Place(nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) { //////////////////////////////////// // Get the children's desired sizes @@ -268,7 +270,7 @@ nsMathMLmmultiscriptsFrame::Place(nsIRenderingContext& aRenderingContext, // duplicate found // report an error, encourage people to get their markups in order NS_WARNING("invalid markup"); - return ReflowError(aRenderingContext, aDesiredSize); + return ReflowError(aRenderingContext, aDesiredSize, aReflowState, aStatus); } mprescriptsFrame = childFrame; firstPrescriptsPair = PR_TRUE; @@ -379,7 +381,7 @@ nsMathMLmmultiscriptsFrame::Place(nsIRenderingContext& aRenderingContext, if ((0 != width) || !baseFrame || !subScriptFrame || !supScriptFrame) { // report an error, encourage people to get their markups in order NS_WARNING("invalid markup"); - return ReflowError(aRenderingContext, aDesiredSize); + return ReflowError(aRenderingContext, aDesiredSize, aReflowState, aStatus); } // we left out the width of prescripts, so ... diff --git a/layout/mathml/base/src/nsMathMLmmultiscriptsFrame.h b/layout/mathml/base/src/nsMathMLmmultiscriptsFrame.h index 33e7c7f864a4..8dc9ecd52371 100644 --- a/layout/mathml/base/src/nsMathMLmmultiscriptsFrame.h +++ b/layout/mathml/base/src/nsMathMLmmultiscriptsFrame.h @@ -55,9 +55,11 @@ public: TransmitAutomaticData(); NS_IMETHOD - Place(nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize); + Place(nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus); protected: nsMathMLmmultiscriptsFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {} diff --git a/layout/mathml/base/src/nsMathMLmoverFrame.cpp b/layout/mathml/base/src/nsMathMLmoverFrame.cpp index 57d185e5c993..7de9598c134c 100644 --- a/layout/mathml/base/src/nsMathMLmoverFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmoverFrame.cpp @@ -249,9 +249,11 @@ i.e.: */ NS_IMETHODIMP -nsMathMLmoverFrame::Place(nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize) +nsMathMLmoverFrame::Place(nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) { if ( NS_MATHML_EMBELLISH_IS_MOVABLELIMITS(mEmbellishData.flags) && !NS_MATHML_IS_DISPLAYSTYLE(mPresentationData.flags)) { @@ -260,6 +262,8 @@ nsMathMLmoverFrame::Place(nsIRenderingContext& aRenderingContext, aRenderingContext, aPlaceOrigin, aDesiredSize, + aReflowState, + aStatus, this); } @@ -276,7 +280,7 @@ nsMathMLmoverFrame::Place(nsIRenderingContext& aRenderingContext, if (!baseFrame || !overFrame || overFrame->GetNextSibling()) { // report an error, encourage people to get their markups in order NS_WARNING("invalid markup"); - return ReflowError(aRenderingContext, aDesiredSize); + return ReflowError(aRenderingContext, aDesiredSize, aReflowState, aStatus); } GetReflowAndBoundingMetricsFor(baseFrame, baseSize, bmBase); GetReflowAndBoundingMetricsFor(overFrame, overSize, bmOver); diff --git a/layout/mathml/base/src/nsMathMLmoverFrame.h b/layout/mathml/base/src/nsMathMLmoverFrame.h index f62e366b1715..a4c187e3d900 100644 --- a/layout/mathml/base/src/nsMathMLmoverFrame.h +++ b/layout/mathml/base/src/nsMathMLmoverFrame.h @@ -52,9 +52,11 @@ public: friend nsIFrame* NS_NewMathMLmoverFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); NS_IMETHOD - Place(nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize); + Place(nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus); NS_IMETHOD InheritAutomaticData(nsIFrame* aParent); diff --git a/layout/mathml/base/src/nsMathMLmrootFrame.cpp b/layout/mathml/base/src/nsMathMLmrootFrame.cpp index bbf2ab111ece..8da3f073f30d 100644 --- a/layout/mathml/base/src/nsMathMLmrootFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmrootFrame.cpp @@ -210,7 +210,7 @@ nsMathMLmrootFrame::Reflow(nsPresContext* aPresContext, if (2 != count) { // report an error, encourage people to get their markups in order NS_WARNING("invalid markup"); - return ReflowError(renderingContext, aDesiredSize); + return ReflowError(renderingContext, aDesiredSize, aReflowState, aStatus); } //////////// diff --git a/layout/mathml/base/src/nsMathMLmsubFrame.cpp b/layout/mathml/base/src/nsMathMLmsubFrame.cpp index eed411203a63..c701fbad2aa4 100644 --- a/layout/mathml/base/src/nsMathMLmsubFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmsubFrame.cpp @@ -82,9 +82,11 @@ nsMathMLmsubFrame::TransmitAutomaticData() } NS_IMETHODIMP -nsMathMLmsubFrame::Place (nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize) +nsMathMLmsubFrame::Place (nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) { // extra spacing after sup/subscript nscoord scriptSpace = NSFloatPointsToTwips(0.5f); // 0.5pt as in plain TeX @@ -105,6 +107,8 @@ nsMathMLmsubFrame::Place (nsIRenderingContext& aRenderingContext, aRenderingContext, aPlaceOrigin, aDesiredSize, + aReflowState, + aStatus, this, subScriptShift, scriptSpace); @@ -113,13 +117,15 @@ nsMathMLmsubFrame::Place (nsIRenderingContext& aRenderingContext, // exported routine that both munder and msub share. // munder uses this when movablelimits is set. nsresult -nsMathMLmsubFrame::PlaceSubScript (nsPresContext* aPresContext, - nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize, - nsIFrame* aFrame, - nscoord aUserSubScriptShift, - nscoord aScriptSpace) +nsMathMLmsubFrame::PlaceSubScript (nsPresContext* aPresContext, + nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus, + nsIFrame* aFrame, + nscoord aUserSubScriptShift, + nscoord aScriptSpace) { // the caller better be a mathml frame nsIMathMLFrame* mathMLFrame; @@ -144,7 +150,9 @@ nsMathMLmsubFrame::PlaceSubScript (nsPresContext* aPresContext, NS_WARNING("invalid markup"); return NS_STATIC_CAST(nsMathMLContainerFrame*, aFrame)->ReflowError(aRenderingContext, - aDesiredSize); + aDesiredSize, + aReflowState, + aStatus); } GetReflowAndBoundingMetricsFor(baseFrame, baseSize, bmBase); GetReflowAndBoundingMetricsFor(subScriptFrame, subScriptSize, bmSubScript); diff --git a/layout/mathml/base/src/nsMathMLmsubFrame.h b/layout/mathml/base/src/nsMathMLmsubFrame.h index fbe5d79bb6c3..fa5d26297d94 100644 --- a/layout/mathml/base/src/nsMathMLmsubFrame.h +++ b/layout/mathml/base/src/nsMathMLmsubFrame.h @@ -55,18 +55,22 @@ public: TransmitAutomaticData(); NS_IMETHOD - Place(nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize); + Place(nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus); static nsresult - PlaceSubScript (nsPresContext* aPresContext, - nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize, - nsIFrame* aForFrame, - nscoord aUserSubScriptShift = 0, - nscoord aScriptSpace = NSFloatPointsToTwips(0.5f)); + PlaceSubScript (nsPresContext* aPresContext, + nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus, + nsIFrame* aForFrame, + nscoord aUserSubScriptShift = 0, + nscoord aScriptSpace = NSFloatPointsToTwips(0.5f)); protected: nsMathMLmsubFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {} diff --git a/layout/mathml/base/src/nsMathMLmsubsupFrame.cpp b/layout/mathml/base/src/nsMathMLmsubsupFrame.cpp index 00f59cacf16f..11ab6de588e9 100644 --- a/layout/mathml/base/src/nsMathMLmsubsupFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmsubsupFrame.cpp @@ -87,9 +87,11 @@ nsMathMLmsubsupFrame::TransmitAutomaticData() } NS_IMETHODIMP -nsMathMLmsubsupFrame::Place(nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize) +nsMathMLmsubsupFrame::Place(nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) { // extra spacing between base and sup/subscript nscoord scriptSpace = 0; @@ -120,6 +122,8 @@ nsMathMLmsubsupFrame::Place(nsIRenderingContext& aRenderingContext, aRenderingContext, aPlaceOrigin, aDesiredSize, + aReflowState, + aStatus, this, subScriptShift, supScriptShift, @@ -129,14 +133,16 @@ nsMathMLmsubsupFrame::Place(nsIRenderingContext& aRenderingContext, // exported routine that both munderover and msubsup share. // munderover uses this when movablelimits is set. nsresult -nsMathMLmsubsupFrame::PlaceSubSupScript(nsPresContext* aPresContext, - nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize, - nsIFrame* aFrame, - nscoord aUserSubScriptShift, - nscoord aUserSupScriptShift, - nscoord aScriptSpace) +nsMathMLmsubsupFrame::PlaceSubSupScript(nsPresContext* aPresContext, + nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus, + nsIFrame* aFrame, + nscoord aUserSubScriptShift, + nscoord aUserSupScriptShift, + nscoord aScriptSpace) { // the caller better be a mathml frame nsIMathMLFrame* mathMLFrame; @@ -167,7 +173,9 @@ nsMathMLmsubsupFrame::PlaceSubSupScript(nsPresContext* aPresContext, NS_WARNING("invalid markup"); return NS_STATIC_CAST(nsMathMLContainerFrame*, aFrame)->ReflowError(aRenderingContext, - aDesiredSize); + aDesiredSize, + aReflowState, + aStatus); } GetReflowAndBoundingMetricsFor(baseFrame, baseSize, bmBase); GetReflowAndBoundingMetricsFor(subScriptFrame, subScriptSize, bmSubScript); diff --git a/layout/mathml/base/src/nsMathMLmsubsupFrame.h b/layout/mathml/base/src/nsMathMLmsubsupFrame.h index c3f38a0c0845..d8e8d005a262 100644 --- a/layout/mathml/base/src/nsMathMLmsubsupFrame.h +++ b/layout/mathml/base/src/nsMathMLmsubsupFrame.h @@ -55,19 +55,23 @@ public: TransmitAutomaticData(); NS_IMETHOD - Place(nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize); + Place(nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus); static nsresult - PlaceSubSupScript(nsPresContext* aPresContext, - nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize, - nsIFrame* aForFrame, - nscoord aUserSubScriptShift = 0, - nscoord aUserSupScriptShift = 0, - nscoord aScriptSpace = NSFloatPointsToTwips(0.5f)); + PlaceSubSupScript(nsPresContext* aPresContext, + nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus, + nsIFrame* aForFrame, + nscoord aUserSubScriptShift = 0, + nscoord aUserSupScriptShift = 0, + nscoord aScriptSpace = NSFloatPointsToTwips(0.5f)); protected: nsMathMLmsubsupFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {} diff --git a/layout/mathml/base/src/nsMathMLmsupFrame.cpp b/layout/mathml/base/src/nsMathMLmsupFrame.cpp index afa7639cf8ac..e01d6ff6f4ce 100644 --- a/layout/mathml/base/src/nsMathMLmsupFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmsupFrame.cpp @@ -82,9 +82,11 @@ nsMathMLmsupFrame::TransmitAutomaticData() } NS_IMETHODIMP -nsMathMLmsupFrame::Place(nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize) +nsMathMLmsupFrame::Place(nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) { // extra spacing after sup/subscript nscoord scriptSpace = NSFloatPointsToTwips(0.5f); // 0.5pt as in plain TeX @@ -105,6 +107,8 @@ nsMathMLmsupFrame::Place(nsIRenderingContext& aRenderingContext, aRenderingContext, aPlaceOrigin, aDesiredSize, + aReflowState, + aStatus, this, supScriptShift, scriptSpace); @@ -113,13 +117,15 @@ nsMathMLmsupFrame::Place(nsIRenderingContext& aRenderingContext, // exported routine that both mover and msup share. // mover uses this when movablelimits is set. nsresult -nsMathMLmsupFrame::PlaceSuperScript(nsPresContext* aPresContext, - nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize, - nsIFrame* aFrame, - nscoord aUserSupScriptShift, - nscoord aScriptSpace) +nsMathMLmsupFrame::PlaceSuperScript(nsPresContext* aPresContext, + nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus, + nsIFrame* aFrame, + nscoord aUserSupScriptShift, + nscoord aScriptSpace) { // the caller better be a mathml frame nsIMathMLFrame* mathMLFrame; @@ -145,7 +151,9 @@ nsMathMLmsupFrame::PlaceSuperScript(nsPresContext* aPresContext, NS_WARNING("invalid markup"); return NS_STATIC_CAST(nsMathMLContainerFrame*, aFrame)->ReflowError(aRenderingContext, - aDesiredSize); + aDesiredSize, + aReflowState, + aStatus); } GetReflowAndBoundingMetricsFor(baseFrame, baseSize, bmBase); GetReflowAndBoundingMetricsFor(supScriptFrame, supScriptSize, bmSupScript); diff --git a/layout/mathml/base/src/nsMathMLmsupFrame.h b/layout/mathml/base/src/nsMathMLmsupFrame.h index 18f6d40ded28..b6e3d0d770db 100644 --- a/layout/mathml/base/src/nsMathMLmsupFrame.h +++ b/layout/mathml/base/src/nsMathMLmsupFrame.h @@ -55,18 +55,22 @@ public: TransmitAutomaticData(); NS_IMETHOD - Place(nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize); + Place(nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus); static nsresult - PlaceSuperScript (nsPresContext* aPresContext, - nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize, - nsIFrame* aForFrame, - nscoord aUserSupScriptShift = 0, - nscoord aScriptSpace = NSFloatPointsToTwips(0.5f)); + PlaceSuperScript (nsPresContext* aPresContext, + nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus, + nsIFrame* aForFrame, + nscoord aUserSupScriptShift = 0, + nscoord aScriptSpace = NSFloatPointsToTwips(0.5f)); protected: nsMathMLmsupFrame(nsStyleContext* aContext) : nsMathMLContainerFrame(aContext) {} diff --git a/layout/mathml/base/src/nsMathMLmunderFrame.cpp b/layout/mathml/base/src/nsMathMLmunderFrame.cpp index 6ec89811bdfb..f51c6e84bf00 100644 --- a/layout/mathml/base/src/nsMathMLmunderFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmunderFrame.cpp @@ -246,9 +246,11 @@ i.e.,: */ NS_IMETHODIMP -nsMathMLmunderFrame::Place(nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize) +nsMathMLmunderFrame::Place(nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) { if ( NS_MATHML_EMBELLISH_IS_MOVABLELIMITS(mEmbellishData.flags) && !NS_MATHML_IS_DISPLAYSTYLE(mPresentationData.flags)) { @@ -257,6 +259,8 @@ nsMathMLmunderFrame::Place(nsIRenderingContext& aRenderingContext, aRenderingContext, aPlaceOrigin, aDesiredSize, + aReflowState, + aStatus, this); } @@ -273,7 +277,7 @@ nsMathMLmunderFrame::Place(nsIRenderingContext& aRenderingContext, if (!baseFrame || !underFrame || underFrame->GetNextSibling()) { // report an error, encourage people to get their markups in order NS_WARNING("invalid markup"); - return ReflowError(aRenderingContext, aDesiredSize); + return ReflowError(aRenderingContext, aDesiredSize, aReflowState, aStatus); } GetReflowAndBoundingMetricsFor(baseFrame, baseSize, bmBase); GetReflowAndBoundingMetricsFor(underFrame, underSize, bmUnder); diff --git a/layout/mathml/base/src/nsMathMLmunderFrame.h b/layout/mathml/base/src/nsMathMLmunderFrame.h index 794f1c0e8388..6394b06dc4c6 100644 --- a/layout/mathml/base/src/nsMathMLmunderFrame.h +++ b/layout/mathml/base/src/nsMathMLmunderFrame.h @@ -52,9 +52,11 @@ public: friend nsIFrame* NS_NewMathMLmunderFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); NS_IMETHOD - Place(nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize); + Place(nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus); NS_IMETHOD InheritAutomaticData(nsIFrame* aParent); diff --git a/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp b/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp index ca386d4e6902..ed249b8cd873 100644 --- a/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp +++ b/layout/mathml/base/src/nsMathMLmunderoverFrame.cpp @@ -283,9 +283,11 @@ i.e.,: */ NS_IMETHODIMP -nsMathMLmunderoverFrame::Place(nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize) +nsMathMLmunderoverFrame::Place(nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) { if ( NS_MATHML_EMBELLISH_IS_MOVABLELIMITS(mEmbellishData.flags) && !NS_MATHML_IS_DISPLAYSTYLE(mPresentationData.flags)) { @@ -294,6 +296,8 @@ nsMathMLmunderoverFrame::Place(nsIRenderingContext& aRenderingContext, aRenderingContext, aPlaceOrigin, aDesiredSize, + aReflowState, + aStatus, this); } @@ -314,7 +318,7 @@ nsMathMLmunderoverFrame::Place(nsIRenderingContext& aRenderingContext, if (!baseFrame || !underFrame || !overFrame || overFrame->GetNextSibling()) { // report an error, encourage people to get their markups in order NS_WARNING("invalid markup"); - return ReflowError(aRenderingContext, aDesiredSize); + return ReflowError(aRenderingContext, aDesiredSize, aReflowState, aStatus); } GetReflowAndBoundingMetricsFor(baseFrame, baseSize, bmBase); GetReflowAndBoundingMetricsFor(underFrame, underSize, bmUnder); diff --git a/layout/mathml/base/src/nsMathMLmunderoverFrame.h b/layout/mathml/base/src/nsMathMLmunderoverFrame.h index bf1c4aae138c..032389683fab 100644 --- a/layout/mathml/base/src/nsMathMLmunderoverFrame.h +++ b/layout/mathml/base/src/nsMathMLmunderoverFrame.h @@ -52,9 +52,11 @@ public: friend nsIFrame* NS_NewMathMLmunderoverFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); NS_IMETHOD - Place(nsIRenderingContext& aRenderingContext, - PRBool aPlaceOrigin, - nsHTMLReflowMetrics& aDesiredSize); + Place(nsIRenderingContext& aRenderingContext, + PRBool aPlaceOrigin, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus); NS_IMETHOD InheritAutomaticData(nsIFrame* aParent);