Move Place() from nsIMathMLFrame to nsMathMLContainerFrame b=363240, r+sr=roc

This commit is contained in:
karlt+@karlt.net 2008-03-17 21:52:48 -07:00
Родитель 821c2fd543
Коммит c18e1d765b
26 изменённых файлов: 64 добавлений и 67 удалений

Просмотреть файл

@ -123,42 +123,6 @@ public:
nsBoundingMetrics& aContainerSize,
nsHTMLReflowMetrics& aDesiredStretchSize) = 0;
/* Place :
* This method is used before returning from Reflow(), or when a MathML frame
* has just been stretched. It is called to fine-tune the positions of the
* child frames, and other elements.
*
* IMPORTANT: For nsMathMLContainerFrames this method uses
* GetReflowAndBoundingMetricsFor() which must have been set up with
* SaveReflowAndBoundingMetricsFor().
*
* The Place() method will use this information to compute the desired size
* of the frame.
*
* @param aPlaceOrigin [in]
* If aPlaceOrigin is false, compute your desired size using the
* information in your children's rectangles. However, upon return,
* the origins of your children should keep their ascent information, i.e.,
* a child rect.x, and rect.y should still act like placeholders for the
* child's descent and ascent.
*
* If aPlaceOrigin is true, reflow is finished. You should position all
* your children, and return your desired size. You should now convert
* the origins of your child frames into the coordinate system
* expected by Gecko (which is relative to the upper-left
* corner of the parent) and use FinishReflowChild() on your children
* to complete post-reflow operations.
*
* @param aDesiredSize [out] parameter where you should return your
* 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.
*/
NS_IMETHOD
Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize) = 0;
/* GetEmbellishData/SetEmbellishData :
* Get/Set the mEmbellishData member variable.
*/

Просмотреть файл

@ -1262,7 +1262,7 @@ private:
}
};
NS_IMETHODIMP
/* virtual */ nsresult
nsMathMLContainerFrame::Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize)

Просмотреть файл

@ -82,11 +82,6 @@ public:
nsBoundingMetrics& aContainerSize,
nsHTMLReflowMetrics& aDesiredStretchSize);
NS_IMETHOD
Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize);
NS_IMETHOD
UpdatePresentationDataFromChildAt(PRInt32 aFirstIndex,
PRInt32 aLastIndex,
@ -198,6 +193,41 @@ public:
// --------------------------------------------------------------------------
// Additional methods
protected:
/* Place :
* This method is used to measure or position child frames and other
* elements. It may be called any number of times with aPlaceOrigin
* false to measure, and the final call of the Reflow process before
* returning from Reflow() or Stretch() will have aPlaceOrigin true
* to position the elements.
*
* IMPORTANT: This method uses GetReflowAndBoundingMetricsFor() which must
* have been set up with SaveReflowAndBoundingMetricsFor().
*
* The Place() method will use this information to compute the desired size
* of the frame.
*
* @param aPlaceOrigin [in]
* If aPlaceOrigin is false, compute your desired size using the
* information from GetReflowAndBoundingMetricsFor. However, child
* frames or other elements should not be repositioned.
*
* If aPlaceOrigin is true, reflow is finished. You should position
* all your children, and return your desired size. You should now
* use FinishReflowChild() on your children to complete post-reflow
* operations.
*
* @param aDesiredSize [out] parameter where you should return your desired
* size and your ascent/descent info. Compute your desired size using
* the information from GetReflowAndBoundingMetricsFor, and include
* any space you want for border/padding in the desired size you
* return.
*/
virtual nsresult
Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize);
// helper to re-sync the automatic data in our children and notify our parent to
// reflow us when changes (e.g., append/insert/remove) happen in our child list
virtual nsresult
@ -205,15 +235,16 @@ public:
// helper to get the preferred size that a container frame should use to fire
// the stretch on its stretchy child frames.
virtual void
void
GetPreferredStretchSize(nsIRenderingContext& aRenderingContext,
PRUint32 aOptions,
nsStretchDirection aStretchDirection,
nsBoundingMetrics& aPreferredStretchSize);
public:
// error handlers to provide a visual feedback to the user when an error
// (typically invalid markup) was encountered during reflow.
virtual nsresult
nsresult
ReflowError(nsIRenderingContext& aRenderingContext,
nsHTMLReflowMetrics& aDesiredSize);
@ -227,6 +258,7 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
protected:
// helper to add the inter-spacing when <math> is the immediate parent.
// Since we don't (yet) handle the root <math> element ourselves, we need to
// take special care of the inter-frame spacing on elements for which <math>
@ -273,6 +305,7 @@ public:
PRUint32 aFlagsValues,
PRUint32 aFlagsToUpdate);
public:
static void
PropagatePresentationDataFromChildAt(nsIFrame* aParentFrame,
PRInt32 aFirstChildIndex,

Просмотреть файл

@ -192,7 +192,7 @@ nsMathMLTokenFrame::Reflow(nsPresContext* aPresContext,
// For token elements, mBoundingMetrics is computed at the ReflowToken
// pass, it is not computed here because our children may be text frames
// that do not implement the GetBoundingMetrics() interface.
nsresult
/* virtual */ nsresult
nsMathMLTokenFrame::Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize)

Просмотреть файл

@ -67,7 +67,7 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD
virtual nsresult
Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize);

Просмотреть файл

@ -298,7 +298,7 @@ nsMathMLmactionFrame::Reflow(nsPresContext* aPresContext,
}
// Only place the selected child ...
NS_IMETHODIMP
/* virtual */ nsresult
nsMathMLmactionFrame::Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize)

Просмотреть файл

@ -77,7 +77,7 @@ public:
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists);
NS_IMETHOD
virtual nsresult
Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize);

Просмотреть файл

@ -278,7 +278,7 @@ nsMathMLmfracFrame::FixInterFrameSpacing(nsHTMLReflowMetrics& aDesiredSize)
return gap;
}
NS_IMETHODIMP
/* virtual */ nsresult
nsMathMLmfracFrame::Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize)

Просмотреть файл

@ -115,7 +115,7 @@ public:
virtual nscoord
GetIntrinsicWidth(nsIRenderingContext* aRenderingContext);
NS_IMETHOD
virtual nsresult
Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize);

Просмотреть файл

@ -140,7 +140,7 @@ nsMathMLmmultiscriptsFrame::ProcessAttributes()
}
}
NS_IMETHODIMP
/* virtual */ nsresult
nsMathMLmmultiscriptsFrame::Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize)

Просмотреть файл

@ -55,7 +55,7 @@ public:
NS_IMETHOD
TransmitAutomaticData();
NS_IMETHOD
virtual nsresult
Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize);

Просмотреть файл

@ -243,7 +243,7 @@ i.e.:
}
*/
NS_IMETHODIMP
/* virtual */ nsresult
nsMathMLmoverFrame::Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize)

Просмотреть файл

@ -52,7 +52,7 @@ class nsMathMLmoverFrame : public nsMathMLContainerFrame {
public:
friend nsIFrame* NS_NewMathMLmoverFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_IMETHOD
virtual nsresult
Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize);

Просмотреть файл

@ -373,7 +373,7 @@ nsMathMLmpaddedFrame::Reflow(nsPresContext* aPresContext,
return rv;
}
NS_IMETHODIMP
/* virtual */ nsresult
nsMathMLmpaddedFrame::Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize)

Просмотреть файл

@ -61,7 +61,7 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD
virtual nsresult
Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize);

Просмотреть файл

@ -163,7 +163,7 @@ nsMathMLmsqrtFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
return rv;
}
NS_IMETHODIMP
/* virtual */ nsresult
nsMathMLmsqrtFrame::Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize)

Просмотреть файл

@ -87,7 +87,7 @@ public:
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
NS_IMETHOD
virtual nsresult
Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize);

Просмотреть файл

@ -81,7 +81,7 @@ nsMathMLmsubFrame::TransmitAutomaticData()
return NS_OK;
}
NS_IMETHODIMP
/* virtual */ nsresult
nsMathMLmsubFrame::Place (nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize)

Просмотреть файл

@ -55,7 +55,7 @@ public:
NS_IMETHOD
TransmitAutomaticData();
NS_IMETHOD
virtual nsresult
Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize);

Просмотреть файл

@ -86,7 +86,7 @@ nsMathMLmsubsupFrame::TransmitAutomaticData()
return NS_OK;
}
NS_IMETHODIMP
/* virtual */ nsresult
nsMathMLmsubsupFrame::Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize)

Просмотреть файл

@ -55,7 +55,7 @@ public:
NS_IMETHOD
TransmitAutomaticData();
NS_IMETHOD
virtual nsresult
Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize);

Просмотреть файл

@ -55,7 +55,7 @@ public:
NS_IMETHOD
TransmitAutomaticData();
NS_IMETHOD
virtual nsresult
Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize);

Просмотреть файл

@ -240,7 +240,7 @@ i.e.,:
}
*/
NS_IMETHODIMP
/* virtual */ nsresult
nsMathMLmunderFrame::Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize)

Просмотреть файл

@ -52,7 +52,7 @@ class nsMathMLmunderFrame : public nsMathMLContainerFrame {
public:
friend nsIFrame* NS_NewMathMLmunderFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_IMETHOD
virtual nsresult
Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize);

Просмотреть файл

@ -276,7 +276,7 @@ i.e.,:
}
*/
NS_IMETHODIMP
/* virtual */ nsresult
nsMathMLmunderoverFrame::Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize)

Просмотреть файл

@ -52,7 +52,7 @@ class nsMathMLmunderoverFrame : public nsMathMLContainerFrame {
public:
friend nsIFrame* NS_NewMathMLmunderoverFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
NS_IMETHOD
virtual nsresult
Place(nsIRenderingContext& aRenderingContext,
PRBool aPlaceOrigin,
nsHTMLReflowMetrics& aDesiredSize);