зеркало из https://github.com/mozilla/pjs.git
Be sure to return the reflow status as complete in the case of invalid markup to avoid a hang due to the frame being reflowed over and over again. Patch by steve.swanson@mackichan.com, b=323737, r+sr=rbs
This commit is contained in:
Родитель
7d3f8950be
Коммит
4cb73368cc
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 <mprescripts/> 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 ...
|
||||
|
|
|
@ -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) {}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
////////////
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче