Change to nsIFrame API
This commit is contained in:
@@ -65,6 +65,34 @@ struct nsReflowMetrics {
|
|||||||
*/
|
*/
|
||||||
#define NS_UNCONSTRAINEDSIZE NS_MAXSIZE
|
#define NS_UNCONSTRAINEDSIZE NS_MAXSIZE
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reflow status returned by the reflow methods.
|
||||||
|
*
|
||||||
|
* NS_FRAME_COMPLETE bit flag means the frame maps all its content. If this bit
|
||||||
|
* isn't set it means the frame doesn't map all its content, and that the parent
|
||||||
|
* frame should create a continuing frame.
|
||||||
|
*
|
||||||
|
* NS_FRAME_REFLOW_NEXTINFLOW bit flag means that the next-in-flow is dirty, and
|
||||||
|
* also needs to be reflowed. This status only makes sense for a frame that is
|
||||||
|
* not complete, i.e. you wouldn't set both NS_FRAME_COMPLETE and
|
||||||
|
* NS_FRAME_REFLOW_NEXTINFLOW
|
||||||
|
*
|
||||||
|
* @see #ResizeReflow()
|
||||||
|
* @see #IncrementalReflow()
|
||||||
|
* @see #CreateContinuingFrame()
|
||||||
|
*/
|
||||||
|
typedef PRUint32 nsReflowStatus;
|
||||||
|
|
||||||
|
#define NS_FRAME_COMPLETE 0x01
|
||||||
|
#define NS_FRAME_REFLOW_NEXTINFLOW 0x02
|
||||||
|
|
||||||
|
#define NS_FRAME_IS_COMPLETE(status)\
|
||||||
|
(((status) & NS_FRAME_COMPLETE) == NS_FRAME_COMPLETE)
|
||||||
|
#define NS_FRAME_IS_NOT_COMPLETE(status)\
|
||||||
|
(((status) & NS_FRAME_COMPLETE) == 0)
|
||||||
|
|
||||||
|
#define NS_FRAME_NOT_COMPLETE 0
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A frame in the layout model. This interface is supported by all frame
|
* A frame in the layout model. This interface is supported by all frame
|
||||||
* objects.
|
* objects.
|
||||||
@@ -172,17 +200,6 @@ public:
|
|||||||
nsIFrame** aFrame,
|
nsIFrame** aFrame,
|
||||||
PRInt32& aCursor) = 0;
|
PRInt32& aCursor) = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* Reflow status returned by the reflow methods. frNotComplete means you didn't
|
|
||||||
* map all your content, and so your parent should create a continuing frame
|
|
||||||
* for you.
|
|
||||||
*
|
|
||||||
* @see #ResizeReflow()
|
|
||||||
* @see #IncrementalReflow()
|
|
||||||
* @see #CreateContinuingFrame()
|
|
||||||
*/
|
|
||||||
enum ReflowStatus {frComplete, frNotComplete};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resize reflow. The frame is given a maximum size and asked for its desired
|
* Resize reflow. The frame is given a maximum size and asked for its desired
|
||||||
* size. This is the frame's opportunity to reflow its children.
|
* size. This is the frame's opportunity to reflow its children.
|
||||||
@@ -208,7 +225,7 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus) = 0;
|
nsReflowStatus& aStatus) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Post-processing reflow method invoked when justification is enabled.
|
* Post-processing reflow method invoked when justification is enabled.
|
||||||
@@ -246,7 +263,7 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus) = 0;
|
nsReflowStatus& aStatus) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This call is invoked when content is appended to the content tree.
|
* This call is invoked when content is appended to the content tree.
|
||||||
|
|||||||
@@ -65,12 +65,12 @@ public:
|
|||||||
*
|
*
|
||||||
* @see nsISpaceManager#Translate()
|
* @see nsISpaceManager#Translate()
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext,
|
||||||
nsISpaceManager* aSpaceManager,
|
nsISpaceManager* aSpaceManager,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
nsIFrame::ReflowStatus& aStatus) = 0;
|
nsReflowStatus& aStatus) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Incremental reflow. The reflow command contains information about the
|
* Incremental reflow. The reflow command contains information about the
|
||||||
@@ -101,12 +101,12 @@ public:
|
|||||||
* @param aReflowCommand the reflow command contains information about the
|
* @param aReflowCommand the reflow command contains information about the
|
||||||
* type of change.
|
* type of change.
|
||||||
*/
|
*/
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsISpaceManager* aSpaceManager,
|
nsISpaceManager* aSpaceManager,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
nsIFrame::ReflowStatus& aStatus) = 0;
|
nsReflowStatus& aStatus) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* nsIRunaround_h___ */
|
#endif /* nsIRunaround_h___ */
|
||||||
|
|||||||
@@ -402,7 +402,7 @@ PRBool nsContainerFrame::ChildIsPseudoFrame(const nsIFrame* aChild) const
|
|||||||
PRBool result;
|
PRBool result;
|
||||||
|
|
||||||
aChild->GetContent(childContent);
|
aChild->GetContent(childContent);
|
||||||
result = PRBool(childContent == mContent);
|
result = childContent == mContent;
|
||||||
NS_RELEASE(childContent);
|
NS_RELEASE(childContent);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -415,18 +415,17 @@ PRBool nsContainerFrame::ChildIsPseudoFrame(const nsIFrame* aChild) const
|
|||||||
* child is complete and it has next-in-flows (it was a splittable child)
|
* child is complete and it has next-in-flows (it was a splittable child)
|
||||||
* then delete the next-in-flows.
|
* then delete the next-in-flows.
|
||||||
*/
|
*/
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
||||||
nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
nsIPresContext* aPresContext,
|
||||||
nsIPresContext* aPresContext,
|
nsReflowMetrics& aDesiredSize,
|
||||||
nsReflowMetrics& aDesiredSize,
|
const nsSize& aMaxSize,
|
||||||
const nsSize& aMaxSize,
|
nsSize* aMaxElementSize)
|
||||||
nsSize* aMaxElementSize)
|
|
||||||
{
|
{
|
||||||
ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
aKidFrame->ResizeReflow(aPresContext, aDesiredSize, aMaxSize, aMaxElementSize, status);
|
aKidFrame->ResizeReflow(aPresContext, aDesiredSize, aMaxSize, aMaxElementSize, status);
|
||||||
|
|
||||||
if (frComplete == status) {
|
if (NS_FRAME_IS_COMPLETE(status)) {
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
aKidFrame->GetNextInFlow(kidNextInFlow);
|
aKidFrame->GetNextInFlow(kidNextInFlow);
|
||||||
@@ -452,16 +451,15 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
|||||||
* used to reflow the child; otherwise interface nsIFrame is used. If the
|
* used to reflow the child; otherwise interface nsIFrame is used. If the
|
||||||
* child is splittable then runaround is done using continuing frames.
|
* child is splittable then runaround is done using continuing frames.
|
||||||
*/
|
*/
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
||||||
nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
nsIPresContext* aPresContext,
|
||||||
nsIPresContext* aPresContext,
|
nsISpaceManager* aSpaceManager,
|
||||||
nsISpaceManager* aSpaceManager,
|
const nsSize& aMaxSize,
|
||||||
const nsSize& aMaxSize,
|
nsRect& aDesiredRect,
|
||||||
nsRect& aDesiredRect,
|
nsSize* aMaxElementSize)
|
||||||
nsSize* aMaxElementSize)
|
|
||||||
{
|
{
|
||||||
nsIRunaround* reflowRunaround;
|
nsIRunaround* reflowRunaround;
|
||||||
ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
// Get the band for this y-offset and see whether there are any floaters
|
// Get the band for this y-offset and see whether there are any floaters
|
||||||
// that have changed the left/right edges.
|
// that have changed the left/right edges.
|
||||||
@@ -556,7 +554,7 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
|||||||
aDesiredRect.height = desiredSize.height;
|
aDesiredRect.height = desiredSize.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frComplete == status) {
|
if (NS_FRAME_IS_COMPLETE(status)) {
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
aKidFrame->GetNextInFlow(kidNextInFlow);
|
aKidFrame->GetNextInFlow(kidNextInFlow);
|
||||||
@@ -802,7 +800,7 @@ void nsContainerFrame::PushChildren(nsIFrame* aFromChild,
|
|||||||
nsIFrame* lastChildNextInFlow;
|
nsIFrame* lastChildNextInFlow;
|
||||||
|
|
||||||
lastChild->GetNextInFlow(lastChildNextInFlow);
|
lastChild->GetNextInFlow(lastChildNextInFlow);
|
||||||
nextInFlow->mLastContentIsComplete = PRBool(nsnull == lastChildNextInFlow);
|
nextInFlow->mLastContentIsComplete = (nsnull == lastChildNextInFlow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nextInFlow->mChildCount += numChildren;
|
nextInFlow->mChildCount += numChildren;
|
||||||
@@ -994,7 +992,7 @@ void nsContainerFrame::AppendChildren(nsIFrame* aChild, PRBool aSetParent)
|
|||||||
nsIFrame* nextInFlow;
|
nsIFrame* nextInFlow;
|
||||||
|
|
||||||
lastChild->GetNextInFlow(nextInFlow);
|
lastChild->GetNextInFlow(nextInFlow);
|
||||||
mLastContentIsComplete = PRBool(nsnull == nextInFlow);
|
mLastContentIsComplete = (nsnull == nextInFlow);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
@@ -1333,7 +1331,7 @@ void nsContainerFrame::PreReflowCheck()
|
|||||||
VerifyLastIsComplete();
|
VerifyLastIsComplete();
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsContainerFrame::PostReflowCheck(ReflowStatus aStatus)
|
void nsContainerFrame::PostReflowCheck(nsReflowStatus aStatus)
|
||||||
{
|
{
|
||||||
PRInt32 len = LengthOf(mFirstChild) ;
|
PRInt32 len = LengthOf(mFirstChild) ;
|
||||||
NS_ASSERTION(len == mChildCount, "bad child count");
|
NS_ASSERTION(len == mChildCount, "bad child count");
|
||||||
|
|||||||
@@ -215,11 +215,11 @@ protected:
|
|||||||
* Reflow a child frame and return the status of the reflow. If the child
|
* Reflow a child frame and return the status of the reflow. If the child
|
||||||
* is complete and it has next-in-flows, then delete the next-in-flows.
|
* is complete and it has next-in-flows, then delete the next-in-flows.
|
||||||
*/
|
*/
|
||||||
ReflowStatus ReflowChild(nsIFrame* aKidFrame,
|
nsReflowStatus ReflowChild(nsIFrame* aKidFrame,
|
||||||
nsIPresContext* aPresContext,
|
nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize);
|
nsSize* aMaxElementSize);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reflow a child frame and return the status of the reflow. If the child
|
* Reflow a child frame and return the status of the reflow. If the child
|
||||||
@@ -236,12 +236,12 @@ protected:
|
|||||||
*
|
*
|
||||||
* @see nsIRunaround
|
* @see nsIRunaround
|
||||||
*/
|
*/
|
||||||
ReflowStatus ReflowChild(nsIFrame* aKidFrame,
|
nsReflowStatus ReflowChild(nsIFrame* aKidFrame,
|
||||||
nsIPresContext* aPresContext,
|
nsIPresContext* aPresContext,
|
||||||
nsISpaceManager* aSpaceManager,
|
nsISpaceManager* aSpaceManager,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsSize* aMaxElementSize);
|
nsSize* aMaxElementSize);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves any frames on both the prev-in-flow's overflow list and the receiver's
|
* Moves any frames on both the prev-in-flow's overflow list and the receiver's
|
||||||
@@ -378,7 +378,7 @@ protected:
|
|||||||
* is frNotComplete then the next-in-flow content offsets are
|
* is frNotComplete then the next-in-flow content offsets are
|
||||||
* validated as well
|
* validated as well
|
||||||
*/
|
*/
|
||||||
void PostReflowCheck(ReflowStatus aStatus);
|
void PostReflowCheck(nsReflowStatus aStatus);
|
||||||
|
|
||||||
void CheckNextInFlowOffsets();
|
void CheckNextInFlowOffsets();
|
||||||
|
|
||||||
|
|||||||
@@ -932,7 +932,7 @@ NS_METHOD nsFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
aDesiredSize.width = 0;
|
aDesiredSize.width = 0;
|
||||||
aDesiredSize.height = 0;
|
aDesiredSize.height = 0;
|
||||||
@@ -942,7 +942,7 @@ NS_METHOD nsFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
aMaxElementSize->width = 0;
|
aMaxElementSize->width = 0;
|
||||||
aMaxElementSize->height = 0;
|
aMaxElementSize->height = 0;
|
||||||
}
|
}
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -956,7 +956,7 @@ NS_METHOD nsFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
NS_PRECONDITION(aReflowCommand.GetTarget() == this, "bad target");
|
NS_PRECONDITION(aReflowCommand.GetTarget() == this, "bad target");
|
||||||
|
|
||||||
@@ -972,7 +972,7 @@ NS_METHOD nsFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
aDesiredSize.height = 0;
|
aDesiredSize.height = 0;
|
||||||
aDesiredSize.ascent = 0;
|
aDesiredSize.ascent = 0;
|
||||||
aDesiredSize.descent = 0;
|
aDesiredSize.descent = 0;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1330,7 +1330,7 @@ PRBool IsInRange(nsIContent * aStartContent,
|
|||||||
nsIContent * aContent) {
|
nsIContent * aContent) {
|
||||||
// Start and End Content is the same, so check against the start
|
// Start and End Content is the same, so check against the start
|
||||||
if (aStartContent == aEndContent) {
|
if (aStartContent == aEndContent) {
|
||||||
return PRBool(aContent == aStartContent);
|
return aContent == aStartContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check to see if it is equal to the start or the end
|
// Check to see if it is equal to the start or the end
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD JustifyReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD JustifyReflow(nsIPresContext* aPresContext,
|
||||||
nscoord aAvailableSpace);
|
nscoord aAvailableSpace);
|
||||||
@@ -105,7 +105,8 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD ContentAppended(nsIPresShell* aShell,
|
NS_IMETHOD ContentAppended(nsIPresShell* aShell,
|
||||||
nsIPresContext* aPresContext,
|
nsIPresContext* aPresContext,
|
||||||
nsIContent* aContainer);
|
nsIContent* aContainer);
|
||||||
|
|||||||
@@ -417,7 +417,7 @@ PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight)
|
|||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
mRootFrame->VerifyTree();
|
mRootFrame->VerifyTree();
|
||||||
#endif
|
#endif
|
||||||
nsIFrame::ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
mRootFrame->ResizeReflow(mPresContext, desiredSize, maxSize, nsnull, status);
|
mRootFrame->ResizeReflow(mPresContext, desiredSize, maxSize, nsnull, status);
|
||||||
mRootFrame->SizeTo(desiredSize.width, desiredSize.height);
|
mRootFrame->SizeTo(desiredSize.width, desiredSize.height);
|
||||||
|
|||||||
@@ -76,19 +76,18 @@ void nsReflowCommand::Dispatch(nsReflowMetrics& aDesiredSize,
|
|||||||
if (nsnull != root) {
|
if (nsnull != root) {
|
||||||
mPath.RemoveElementAt(mPath.Count() - 1);
|
mPath.RemoveElementAt(mPath.Count() - 1);
|
||||||
|
|
||||||
nsIFrame::ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
root->IncrementalReflow(mPresContext, aDesiredSize, aMaxSize, *this, status);
|
root->IncrementalReflow(mPresContext, aDesiredSize, aMaxSize, *this, status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pass the reflow command to the next frame in the hierarchy
|
// Pass the reflow command to the next frame in the hierarchy
|
||||||
nsIFrame::ReflowStatus nsReflowCommand::Next(nsReflowMetrics& aDesiredSize,
|
nsReflowStatus nsReflowCommand::Next(nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsIFrame*& aNextFrame)
|
nsIFrame*& aNextFrame)
|
||||||
{
|
{
|
||||||
PRInt32 count = mPath.Count();
|
PRInt32 count = mPath.Count();
|
||||||
nsIFrame::ReflowStatus result = nsIFrame::frComplete;
|
nsReflowStatus result = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
NS_ASSERTION(count > 0, "empty path vector");
|
NS_ASSERTION(count > 0, "empty path vector");
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
@@ -107,13 +106,13 @@ nsIFrame::ReflowStatus nsReflowCommand::Next(nsReflowMetrics& aDesiredSize,
|
|||||||
|
|
||||||
// Pass the reflow command to the next frame in the hierarchy. Check
|
// Pass the reflow command to the next frame in the hierarchy. Check
|
||||||
// whether it wants to use nsIRunaround or nsIFrame
|
// whether it wants to use nsIRunaround or nsIFrame
|
||||||
nsIFrame::ReflowStatus nsReflowCommand::Next(nsISpaceManager* aSpaceManager,
|
nsReflowStatus nsReflowCommand::Next(nsISpaceManager* aSpaceManager,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsIFrame*& aNextFrame)
|
nsIFrame*& aNextFrame)
|
||||||
{
|
{
|
||||||
PRInt32 count = mPath.Count();
|
PRInt32 count = mPath.Count();
|
||||||
nsIFrame::ReflowStatus result = nsIFrame::frComplete;
|
nsReflowStatus result = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
NS_ASSERTION(count > 0, "empty path vector");
|
NS_ASSERTION(count > 0, "empty path vector");
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
|
|||||||
@@ -77,9 +77,9 @@ public:
|
|||||||
|
|
||||||
// Pass the reflow command to the next frame in the hierarchy. Returns the
|
// Pass the reflow command to the next frame in the hierarchy. Returns the
|
||||||
// status and the next frame to which the command was dispatched
|
// status and the next frame to which the command was dispatched
|
||||||
nsIFrame::ReflowStatus Next(nsReflowMetrics& aDesiredSize,
|
nsReflowStatus Next(nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsIFrame*& aNextFrame);
|
nsIFrame*& aNextFrame);
|
||||||
|
|
||||||
// Pass the reflow command to the next frame in the hierarchy. Returns the
|
// Pass the reflow command to the next frame in the hierarchy. Returns the
|
||||||
// status and the next frame to which the command was dispatched
|
// status and the next frame to which the command was dispatched
|
||||||
@@ -87,10 +87,10 @@ public:
|
|||||||
// Use this version if you have a space manager. This function will check if
|
// Use this version if you have a space manager. This function will check if
|
||||||
// the caller supports nsIRunaround and call either the nsIFrame or the
|
// the caller supports nsIRunaround and call either the nsIFrame or the
|
||||||
// nsIRunaround IncrementalReflow() function
|
// nsIRunaround IncrementalReflow() function
|
||||||
nsIFrame::ReflowStatus Next(nsISpaceManager* aSpaceManager,
|
nsReflowStatus Next(nsISpaceManager* aSpaceManager,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsIFrame*& aNextFrame);
|
nsIFrame*& aNextFrame);
|
||||||
|
|
||||||
nsIFrame* GetNext() const;
|
nsIFrame* GetNext() const;
|
||||||
|
|
||||||
|
|||||||
@@ -41,12 +41,12 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Return the first frame in our current flow.
|
* Return the first frame in our current flow.
|
||||||
*/
|
*/
|
||||||
nsIFrame* GetFirstInFlow() const;
|
nsIFrame* GetFirstInFlow() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the last frame in our current flow.
|
* Return the last frame in our current flow.
|
||||||
*/
|
*/
|
||||||
nsIFrame* GetLastInFlow() const;
|
nsIFrame* GetLastInFlow() const;
|
||||||
|
|
||||||
NS_IMETHOD AppendToFlow(nsIFrame* aAfterFrame);
|
NS_IMETHOD AppendToFlow(nsIFrame* aAfterFrame);
|
||||||
NS_IMETHOD PrependToFlow(nsIFrame* aAfterFrame);
|
NS_IMETHOD PrependToFlow(nsIFrame* aAfterFrame);
|
||||||
@@ -54,8 +54,8 @@ public:
|
|||||||
NS_IMETHOD BreakFromPrevFlow();
|
NS_IMETHOD BreakFromPrevFlow();
|
||||||
NS_IMETHOD BreakFromNextFlow();
|
NS_IMETHOD BreakFromNextFlow();
|
||||||
|
|
||||||
nsIFrame * GetPrevInFlow();
|
nsIFrame* GetPrevInFlow();
|
||||||
nsIFrame * GetNextInFlow();
|
nsIFrame* GetNextInFlow();
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -92,10 +92,10 @@ class SimpleContainer : public nsContainerFrame
|
|||||||
public:
|
public:
|
||||||
SimpleContainer(nsIContent* aContent);
|
SimpleContainer(nsIContent* aContent);
|
||||||
|
|
||||||
ReflowStatus IncrementalReflow(nsIPresContext* aPresContext,
|
nsReflowStatus IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand);
|
nsReflowCommand& aReflowCommand);
|
||||||
|
|
||||||
void SetFirstChild(nsIFrame* aChild, PRInt32 aChildCount);
|
void SetFirstChild(nsIFrame* aChild, PRInt32 aChildCount);
|
||||||
nsIFrame* GetOverflowList() {return mOverflowList;}
|
nsIFrame* GetOverflowList() {return mOverflowList;}
|
||||||
@@ -113,14 +113,14 @@ SimpleContainer::SimpleContainer(nsIContent* aContent)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
SimpleContainer::IncrementalReflow(nsIPresContext* aPresContext,
|
SimpleContainer::IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand)
|
nsReflowCommand& aReflowCommand)
|
||||||
{
|
{
|
||||||
NS_NOTYETIMPLEMENTED("incremental reflow");
|
NS_NOTYETIMPLEMENTED("incremental reflow");
|
||||||
return frComplete;
|
return NS_FRAME_COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sets mFirstChild and mChildCount, but not mContentOffset, mContentLength,
|
// Sets mFirstChild and mChildCount, but not mContentOffset, mContentLength,
|
||||||
|
|||||||
@@ -428,7 +428,7 @@ nsBlockFrame::ReflowInlineChild(nsIFrame* aKidFrame,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
aStatus = ReflowChild(aKidFrame, aPresContext, aDesiredSize, aMaxSize,
|
aStatus = ReflowChild(aKidFrame, aPresContext, aDesiredSize, aMaxSize,
|
||||||
aMaxElementSize);
|
aMaxElementSize);
|
||||||
@@ -442,7 +442,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame,
|
|||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
aStatus = ReflowChild(aKidFrame, aPresContext, aSpaceManager,
|
aStatus = ReflowChild(aKidFrame, aPresContext, aSpaceManager,
|
||||||
aMaxSize, aDesiredRect, aMaxElementSize);
|
aMaxSize, aDesiredRect, aMaxElementSize);
|
||||||
@@ -1072,10 +1072,10 @@ nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
nsBlockReflowState state;
|
nsBlockReflowState state;
|
||||||
rv = InitializeState(aPresContext, aMaxSize, aMaxElementSize, state);
|
rv = InitializeState(aPresContext, aMaxSize, aMaxElementSize, state);
|
||||||
if (NS_OK == rv) {
|
if (NS_OK == rv) {
|
||||||
@@ -1127,7 +1127,7 @@ nsresult
|
|||||||
nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState,
|
nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
VerifyLines(PR_TRUE);
|
VerifyLines(PR_TRUE);
|
||||||
@@ -1164,15 +1164,15 @@ nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState,
|
|||||||
ComputeDesiredRect(aState, aMaxSize, aDesiredRect);
|
ComputeDesiredRect(aState, aMaxSize, aDesiredRect);
|
||||||
|
|
||||||
// Set return status
|
// Set return status
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
||||||
rv = NS_OK;
|
rv = NS_OK;
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
// Verify that the line layout code pulled everything up when it
|
// Verify that the line layout code pulled everything up when it
|
||||||
// indicates a complete reflow.
|
// indicates a complete reflow.
|
||||||
if (frComplete == aStatus) {
|
if (NS_FRAME_IS_COMPLETE(aStatus)) {
|
||||||
nsBlockFrame* nextBlock = (nsBlockFrame*) mNextInFlow;
|
nsBlockFrame* nextBlock = (nsBlockFrame*) mNextInFlow;
|
||||||
while (nsnull != nextBlock) {
|
while (nsnull != nextBlock) {
|
||||||
NS_ASSERTION((nsnull == nextBlock->mLines) &&
|
NS_ASSERTION((nsnull == nextBlock->mLines) &&
|
||||||
@@ -1266,15 +1266,15 @@ nsBlockFrame::GetReflowMetrics(nsIPresContext* aPresContext,
|
|||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
NS_METHOD
|
NS_METHOD
|
||||||
nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext,
|
nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext,
|
||||||
nsISpaceManager* aSpaceManager,
|
nsISpaceManager* aSpaceManager,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
nsIFrame::ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
nsBlockReflowState state;
|
nsBlockReflowState state;
|
||||||
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
||||||
aMaxElementSize, state);
|
aMaxElementSize, state);
|
||||||
@@ -1331,12 +1331,12 @@ nsresult nsBlockFrame::IncrementalReflowAfter(nsBlockReflowState& aState,
|
|||||||
}
|
}
|
||||||
|
|
||||||
NS_METHOD
|
NS_METHOD
|
||||||
nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsISpaceManager* aSpaceManager,
|
nsISpaceManager* aSpaceManager,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
nsIFrame::ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
VerifyLines(PR_TRUE);
|
VerifyLines(PR_TRUE);
|
||||||
@@ -1344,7 +1344,7 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
nsBlockReflowState state;
|
nsBlockReflowState state;
|
||||||
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
||||||
nsnull, state);
|
nsnull, state);
|
||||||
@@ -1428,10 +1428,10 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
ComputeDesiredRect(state, aMaxSize, aDesiredRect);
|
ComputeDesiredRect(state, aMaxSize, aDesiredRect);
|
||||||
|
|
||||||
// Set return status
|
// Set return status
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
||||||
rv = NS_OK;
|
rv = NS_OK;
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now that reflow has finished, remove the cached pointer
|
// Now that reflow has finished, remove the cached pointer
|
||||||
|
|||||||
@@ -185,18 +185,18 @@ public:
|
|||||||
NS_IMETHOD VerifyTree() const;
|
NS_IMETHOD VerifyTree() const;
|
||||||
|
|
||||||
// nsIRunaround
|
// nsIRunaround
|
||||||
NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext,
|
||||||
nsISpaceManager* aSpaceManager,
|
nsISpaceManager* aSpaceManager,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
nsIFrame::ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsISpaceManager* aSpaceManager,
|
nsISpaceManager* aSpaceManager,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
nsIFrame::ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
// nsIFloaterContainer
|
// nsIFloaterContainer
|
||||||
virtual PRBool AddFloater(nsIPresContext* aPresContext,
|
virtual PRBool AddFloater(nsIPresContext* aPresContext,
|
||||||
@@ -212,7 +212,7 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
nsresult ReflowBlockChild(nsIFrame* aKidFrame,
|
nsresult ReflowBlockChild(nsIFrame* aKidFrame,
|
||||||
nsIPresContext* aPresContext,
|
nsIPresContext* aPresContext,
|
||||||
@@ -220,7 +220,7 @@ public:
|
|||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
nsLineData* GetFirstLine();
|
nsLineData* GetFirstLine();
|
||||||
|
|
||||||
@@ -245,7 +245,7 @@ protected:
|
|||||||
nsresult DoResizeReflow(nsBlockReflowState& aState,
|
nsresult DoResizeReflow(nsBlockReflowState& aState,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
void ComputeDesiredRect(nsBlockReflowState& aState,
|
void ComputeDesiredRect(nsBlockReflowState& aState,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
|
|||||||
@@ -428,7 +428,7 @@ nsBlockFrame::ReflowInlineChild(nsIFrame* aKidFrame,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
aStatus = ReflowChild(aKidFrame, aPresContext, aDesiredSize, aMaxSize,
|
aStatus = ReflowChild(aKidFrame, aPresContext, aDesiredSize, aMaxSize,
|
||||||
aMaxElementSize);
|
aMaxElementSize);
|
||||||
@@ -442,7 +442,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame,
|
|||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
aStatus = ReflowChild(aKidFrame, aPresContext, aSpaceManager,
|
aStatus = ReflowChild(aKidFrame, aPresContext, aSpaceManager,
|
||||||
aMaxSize, aDesiredRect, aMaxElementSize);
|
aMaxSize, aDesiredRect, aMaxElementSize);
|
||||||
@@ -1072,10 +1072,10 @@ nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
nsBlockReflowState state;
|
nsBlockReflowState state;
|
||||||
rv = InitializeState(aPresContext, aMaxSize, aMaxElementSize, state);
|
rv = InitializeState(aPresContext, aMaxSize, aMaxElementSize, state);
|
||||||
if (NS_OK == rv) {
|
if (NS_OK == rv) {
|
||||||
@@ -1127,7 +1127,7 @@ nsresult
|
|||||||
nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState,
|
nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
VerifyLines(PR_TRUE);
|
VerifyLines(PR_TRUE);
|
||||||
@@ -1164,15 +1164,15 @@ nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState,
|
|||||||
ComputeDesiredRect(aState, aMaxSize, aDesiredRect);
|
ComputeDesiredRect(aState, aMaxSize, aDesiredRect);
|
||||||
|
|
||||||
// Set return status
|
// Set return status
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
||||||
rv = NS_OK;
|
rv = NS_OK;
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
// Verify that the line layout code pulled everything up when it
|
// Verify that the line layout code pulled everything up when it
|
||||||
// indicates a complete reflow.
|
// indicates a complete reflow.
|
||||||
if (frComplete == aStatus) {
|
if (NS_FRAME_IS_COMPLETE(aStatus)) {
|
||||||
nsBlockFrame* nextBlock = (nsBlockFrame*) mNextInFlow;
|
nsBlockFrame* nextBlock = (nsBlockFrame*) mNextInFlow;
|
||||||
while (nsnull != nextBlock) {
|
while (nsnull != nextBlock) {
|
||||||
NS_ASSERTION((nsnull == nextBlock->mLines) &&
|
NS_ASSERTION((nsnull == nextBlock->mLines) &&
|
||||||
@@ -1266,15 +1266,15 @@ nsBlockFrame::GetReflowMetrics(nsIPresContext* aPresContext,
|
|||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
NS_METHOD
|
NS_METHOD
|
||||||
nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext,
|
nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext,
|
||||||
nsISpaceManager* aSpaceManager,
|
nsISpaceManager* aSpaceManager,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
nsIFrame::ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
nsBlockReflowState state;
|
nsBlockReflowState state;
|
||||||
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
||||||
aMaxElementSize, state);
|
aMaxElementSize, state);
|
||||||
@@ -1331,12 +1331,12 @@ nsresult nsBlockFrame::IncrementalReflowAfter(nsBlockReflowState& aState,
|
|||||||
}
|
}
|
||||||
|
|
||||||
NS_METHOD
|
NS_METHOD
|
||||||
nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsISpaceManager* aSpaceManager,
|
nsISpaceManager* aSpaceManager,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
nsIFrame::ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
VerifyLines(PR_TRUE);
|
VerifyLines(PR_TRUE);
|
||||||
@@ -1344,7 +1344,7 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
nsBlockReflowState state;
|
nsBlockReflowState state;
|
||||||
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
||||||
nsnull, state);
|
nsnull, state);
|
||||||
@@ -1428,10 +1428,10 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
ComputeDesiredRect(state, aMaxSize, aDesiredRect);
|
ComputeDesiredRect(state, aMaxSize, aDesiredRect);
|
||||||
|
|
||||||
// Set return status
|
// Set return status
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
||||||
rv = NS_OK;
|
rv = NS_OK;
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now that reflow has finished, remove the cached pointer
|
// Now that reflow has finished, remove the cached pointer
|
||||||
|
|||||||
@@ -428,7 +428,7 @@ nsBlockFrame::ReflowInlineChild(nsIFrame* aKidFrame,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
aStatus = ReflowChild(aKidFrame, aPresContext, aDesiredSize, aMaxSize,
|
aStatus = ReflowChild(aKidFrame, aPresContext, aDesiredSize, aMaxSize,
|
||||||
aMaxElementSize);
|
aMaxElementSize);
|
||||||
@@ -442,7 +442,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame,
|
|||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
aStatus = ReflowChild(aKidFrame, aPresContext, aSpaceManager,
|
aStatus = ReflowChild(aKidFrame, aPresContext, aSpaceManager,
|
||||||
aMaxSize, aDesiredRect, aMaxElementSize);
|
aMaxSize, aDesiredRect, aMaxElementSize);
|
||||||
@@ -1072,10 +1072,10 @@ nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
nsBlockReflowState state;
|
nsBlockReflowState state;
|
||||||
rv = InitializeState(aPresContext, aMaxSize, aMaxElementSize, state);
|
rv = InitializeState(aPresContext, aMaxSize, aMaxElementSize, state);
|
||||||
if (NS_OK == rv) {
|
if (NS_OK == rv) {
|
||||||
@@ -1127,7 +1127,7 @@ nsresult
|
|||||||
nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState,
|
nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
VerifyLines(PR_TRUE);
|
VerifyLines(PR_TRUE);
|
||||||
@@ -1164,15 +1164,15 @@ nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState,
|
|||||||
ComputeDesiredRect(aState, aMaxSize, aDesiredRect);
|
ComputeDesiredRect(aState, aMaxSize, aDesiredRect);
|
||||||
|
|
||||||
// Set return status
|
// Set return status
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
||||||
rv = NS_OK;
|
rv = NS_OK;
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
// Verify that the line layout code pulled everything up when it
|
// Verify that the line layout code pulled everything up when it
|
||||||
// indicates a complete reflow.
|
// indicates a complete reflow.
|
||||||
if (frComplete == aStatus) {
|
if (NS_FRAME_IS_COMPLETE(aStatus)) {
|
||||||
nsBlockFrame* nextBlock = (nsBlockFrame*) mNextInFlow;
|
nsBlockFrame* nextBlock = (nsBlockFrame*) mNextInFlow;
|
||||||
while (nsnull != nextBlock) {
|
while (nsnull != nextBlock) {
|
||||||
NS_ASSERTION((nsnull == nextBlock->mLines) &&
|
NS_ASSERTION((nsnull == nextBlock->mLines) &&
|
||||||
@@ -1266,15 +1266,15 @@ nsBlockFrame::GetReflowMetrics(nsIPresContext* aPresContext,
|
|||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
NS_METHOD
|
NS_METHOD
|
||||||
nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext,
|
nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext,
|
||||||
nsISpaceManager* aSpaceManager,
|
nsISpaceManager* aSpaceManager,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
nsIFrame::ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
nsBlockReflowState state;
|
nsBlockReflowState state;
|
||||||
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
||||||
aMaxElementSize, state);
|
aMaxElementSize, state);
|
||||||
@@ -1331,12 +1331,12 @@ nsresult nsBlockFrame::IncrementalReflowAfter(nsBlockReflowState& aState,
|
|||||||
}
|
}
|
||||||
|
|
||||||
NS_METHOD
|
NS_METHOD
|
||||||
nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsISpaceManager* aSpaceManager,
|
nsISpaceManager* aSpaceManager,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
nsIFrame::ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
VerifyLines(PR_TRUE);
|
VerifyLines(PR_TRUE);
|
||||||
@@ -1344,7 +1344,7 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
nsBlockReflowState state;
|
nsBlockReflowState state;
|
||||||
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
||||||
nsnull, state);
|
nsnull, state);
|
||||||
@@ -1428,10 +1428,10 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
ComputeDesiredRect(state, aMaxSize, aDesiredRect);
|
ComputeDesiredRect(state, aMaxSize, aDesiredRect);
|
||||||
|
|
||||||
// Set return status
|
// Set return status
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
||||||
rv = NS_OK;
|
rv = NS_OK;
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now that reflow has finished, remove the cached pointer
|
// Now that reflow has finished, remove the cached pointer
|
||||||
|
|||||||
@@ -431,7 +431,7 @@ nsHTMLContainerFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// Ignore all other reflow commands
|
// Ignore all other reflow commands
|
||||||
status = frComplete;
|
status = NS_FRAME_COMPLETE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -65,6 +65,34 @@ struct nsReflowMetrics {
|
|||||||
*/
|
*/
|
||||||
#define NS_UNCONSTRAINEDSIZE NS_MAXSIZE
|
#define NS_UNCONSTRAINEDSIZE NS_MAXSIZE
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reflow status returned by the reflow methods.
|
||||||
|
*
|
||||||
|
* NS_FRAME_COMPLETE bit flag means the frame maps all its content. If this bit
|
||||||
|
* isn't set it means the frame doesn't map all its content, and that the parent
|
||||||
|
* frame should create a continuing frame.
|
||||||
|
*
|
||||||
|
* NS_FRAME_REFLOW_NEXTINFLOW bit flag means that the next-in-flow is dirty, and
|
||||||
|
* also needs to be reflowed. This status only makes sense for a frame that is
|
||||||
|
* not complete, i.e. you wouldn't set both NS_FRAME_COMPLETE and
|
||||||
|
* NS_FRAME_REFLOW_NEXTINFLOW
|
||||||
|
*
|
||||||
|
* @see #ResizeReflow()
|
||||||
|
* @see #IncrementalReflow()
|
||||||
|
* @see #CreateContinuingFrame()
|
||||||
|
*/
|
||||||
|
typedef PRUint32 nsReflowStatus;
|
||||||
|
|
||||||
|
#define NS_FRAME_COMPLETE 0x01
|
||||||
|
#define NS_FRAME_REFLOW_NEXTINFLOW 0x02
|
||||||
|
|
||||||
|
#define NS_FRAME_IS_COMPLETE(status)\
|
||||||
|
(((status) & NS_FRAME_COMPLETE) == NS_FRAME_COMPLETE)
|
||||||
|
#define NS_FRAME_IS_NOT_COMPLETE(status)\
|
||||||
|
(((status) & NS_FRAME_COMPLETE) == 0)
|
||||||
|
|
||||||
|
#define NS_FRAME_NOT_COMPLETE 0
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A frame in the layout model. This interface is supported by all frame
|
* A frame in the layout model. This interface is supported by all frame
|
||||||
* objects.
|
* objects.
|
||||||
@@ -172,17 +200,6 @@ public:
|
|||||||
nsIFrame** aFrame,
|
nsIFrame** aFrame,
|
||||||
PRInt32& aCursor) = 0;
|
PRInt32& aCursor) = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* Reflow status returned by the reflow methods. frNotComplete means you didn't
|
|
||||||
* map all your content, and so your parent should create a continuing frame
|
|
||||||
* for you.
|
|
||||||
*
|
|
||||||
* @see #ResizeReflow()
|
|
||||||
* @see #IncrementalReflow()
|
|
||||||
* @see #CreateContinuingFrame()
|
|
||||||
*/
|
|
||||||
enum ReflowStatus {frComplete, frNotComplete};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resize reflow. The frame is given a maximum size and asked for its desired
|
* Resize reflow. The frame is given a maximum size and asked for its desired
|
||||||
* size. This is the frame's opportunity to reflow its children.
|
* size. This is the frame's opportunity to reflow its children.
|
||||||
@@ -208,7 +225,7 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus) = 0;
|
nsReflowStatus& aStatus) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Post-processing reflow method invoked when justification is enabled.
|
* Post-processing reflow method invoked when justification is enabled.
|
||||||
@@ -246,7 +263,7 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus) = 0;
|
nsReflowStatus& aStatus) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This call is invoked when content is appended to the content tree.
|
* This call is invoked when content is appended to the content tree.
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ PRBool nsInlineFrame::ReflowMappedChildrenFrom(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
for (nsIFrame* kidFrame = aChildFrame; nsnull != kidFrame; ) {
|
for (nsIFrame* kidFrame = aChildFrame; nsnull != kidFrame; ) {
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
// Reflow the child into the available space
|
// Reflow the child into the available space
|
||||||
status = ReflowChild(kidFrame, aPresContext, kidSize, aState.availSize,
|
status = ReflowChild(kidFrame, aPresContext, kidSize, aState.availSize,
|
||||||
@@ -256,8 +256,8 @@ PRBool nsInlineFrame::ReflowMappedChildrenFrom(nsIPresContext* aPresContext,
|
|||||||
prevKidFrame = kidFrame;
|
prevKidFrame = kidFrame;
|
||||||
|
|
||||||
// Is the child complete?
|
// Is the child complete?
|
||||||
mLastContentIsComplete = PRBool(status == frComplete);
|
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status);
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// No, the child isn't complete
|
// No, the child isn't complete
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
@@ -358,7 +358,7 @@ PRBool nsInlineFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
while (nsnull != nextInFlow) {
|
while (nsnull != nextInFlow) {
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
// Get the next child
|
// Get the next child
|
||||||
nsIFrame* kidFrame = nextInFlow->mFirstChild;
|
nsIFrame* kidFrame = nextInFlow->mFirstChild;
|
||||||
@@ -443,8 +443,8 @@ PRBool nsInlineFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
prevLastContentIsComplete = mLastContentIsComplete;
|
prevLastContentIsComplete = mLastContentIsComplete;
|
||||||
|
|
||||||
// Is the child we just pulled up complete?
|
// Is the child we just pulled up complete?
|
||||||
mLastContentIsComplete = PRBool(status == frComplete);
|
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status);
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// No the child isn't complete
|
// No the child isn't complete
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
@@ -523,18 +523,17 @@ PRBool nsInlineFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
*
|
*
|
||||||
* @param aPresContext presentation context to use
|
* @param aPresContext presentation context to use
|
||||||
* @param aState current inline state
|
* @param aState current inline state
|
||||||
* @return frComplete if all content has been mapped and frNotComplete
|
* @return NS_FRAME_COMPLETE if all content has been mapped and 0 if we
|
||||||
* if we should be continued
|
* should be continued
|
||||||
*/
|
*/
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
||||||
nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
nsInlineState& aState)
|
||||||
nsInlineState& aState)
|
|
||||||
{
|
{
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
VerifyLastIsComplete();
|
VerifyLastIsComplete();
|
||||||
#endif
|
#endif
|
||||||
nsIFrame* kidPrevInFlow = nsnull;
|
nsIFrame* kidPrevInFlow = nsnull;
|
||||||
ReflowStatus result = frNotComplete;
|
nsReflowStatus result = 0;
|
||||||
|
|
||||||
// If we have no children and we have a prev-in-flow then we need to pick
|
// If we have no children and we have a prev-in-flow then we need to pick
|
||||||
// up where it left off. If we have children, e.g. we're being resized, then
|
// up where it left off. If we have children, e.g. we're being resized, then
|
||||||
@@ -563,13 +562,13 @@ nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
// Get the next content object
|
// Get the next content object
|
||||||
nsIContentPtr kid = mContent->ChildAt(kidIndex);
|
nsIContentPtr kid = mContent->ChildAt(kidIndex);
|
||||||
if (nsnull == kid) {
|
if (nsnull == kid) {
|
||||||
result = frComplete;
|
result = NS_FRAME_COMPLETE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure we still have room left
|
// Make sure we still have room left
|
||||||
if (aState.availSize.width <= 0) {
|
if (aState.availSize.width <= 0) {
|
||||||
// Note: return status was set to frNotComplete above...
|
// Note: return status was set to 0 above...
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -629,8 +628,8 @@ nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
// Try to reflow the child into the available space. It might not
|
// Try to reflow the child into the available space. It might not
|
||||||
// fit or might need continuing.
|
// fit or might need continuing.
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
ReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize,
|
nsReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize,
|
||||||
aState.availSize, pKidMaxElementSize);
|
aState.availSize, pKidMaxElementSize);
|
||||||
|
|
||||||
// Did the child fit?
|
// Did the child fit?
|
||||||
if ((kidSize.width > aState.availSize.width) && (nsnull != mFirstChild)) {
|
if ((kidSize.width > aState.availSize.width) && (nsnull != mFirstChild)) {
|
||||||
@@ -658,7 +657,7 @@ nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
kidIndex++;
|
kidIndex++;
|
||||||
|
|
||||||
// Did the child complete?
|
// Did the child complete?
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// If the child isn't complete then it means that we've used up
|
// If the child isn't complete then it means that we've used up
|
||||||
// all of our available space
|
// all of our available space
|
||||||
mLastContentIsComplete = PR_FALSE;
|
mLastContentIsComplete = PR_FALSE;
|
||||||
@@ -704,7 +703,7 @@ NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
PreReflowCheck();
|
PreReflowCheck();
|
||||||
@@ -713,7 +712,7 @@ NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
PRBool reflowMappedOK = PR_TRUE;
|
PRBool reflowMappedOK = PR_TRUE;
|
||||||
|
|
||||||
aStatus = frComplete; // initialize out parameter
|
aStatus = NS_FRAME_COMPLETE; // initialize out parameter
|
||||||
|
|
||||||
// Get the style molecule
|
// Get the style molecule
|
||||||
nsStyleFont* styleFont = (nsStyleFont*)
|
nsStyleFont* styleFont = (nsStyleFont*)
|
||||||
@@ -735,7 +734,8 @@ NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
reflowMappedOK = ReflowMappedChildrenFrom(aPresContext, state, mFirstChild, 0);
|
reflowMappedOK = ReflowMappedChildrenFrom(aPresContext, state, mFirstChild, 0);
|
||||||
|
|
||||||
if (PR_FALSE == reflowMappedOK) {
|
if (PR_FALSE == reflowMappedOK) {
|
||||||
aStatus = frNotComplete;
|
// We didn't successfully reflow our mapped frames; therefore, we're not complete
|
||||||
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -745,7 +745,8 @@ NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
if (state.availSize.width <= 0) {
|
if (state.availSize.width <= 0) {
|
||||||
// No space left. Don't try to pull-up children or reflow unmapped
|
// No space left. Don't try to pull-up children or reflow unmapped
|
||||||
if (NextChildOffset() < mContent->ChildCount()) {
|
if (NextChildOffset() < mContent->ChildCount()) {
|
||||||
aStatus = frNotComplete;
|
// No room left to map the remaining content; therefore, we're not complete
|
||||||
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
} else if (NextChildOffset() < mContent->ChildCount()) {
|
} else if (NextChildOffset() < mContent->ChildCount()) {
|
||||||
// Try and pull-up some children from a next-in-flow
|
// Try and pull-up some children from a next-in-flow
|
||||||
@@ -755,8 +756,9 @@ NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
aStatus = ReflowUnmappedChildren(aPresContext, state);
|
aStatus = ReflowUnmappedChildren(aPresContext, state);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// We were unable to pull-up all the existing frames from the next in flow
|
// We were unable to pull-up all the existing frames from the next in flow;
|
||||||
aStatus = frNotComplete;
|
// therefore, we're not complete
|
||||||
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -887,13 +889,13 @@ PRInt32 nsInlineFrame::RecoverState(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
// XXX We need to return information about whether our next-in-flow is
|
// XXX We need to return information about whether our next-in-flow is
|
||||||
// dirty...
|
// dirty...
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
nsInlineFrame::IncrementalReflowFrom(nsIPresContext* aPresContext,
|
nsInlineFrame::IncrementalReflowFrom(nsIPresContext* aPresContext,
|
||||||
nsInlineState& aState,
|
nsInlineState& aState,
|
||||||
nsIFrame* aChildFrame,
|
nsIFrame* aChildFrame,
|
||||||
PRInt32 aChildIndex)
|
PRInt32 aChildIndex)
|
||||||
{
|
{
|
||||||
ReflowStatus status = frComplete;
|
nsReflowStatus status = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
// Just reflow all the mapped children starting with childFrame.
|
// Just reflow all the mapped children starting with childFrame.
|
||||||
// XXX This isn't the optimal thing to do...
|
// XXX This isn't the optimal thing to do...
|
||||||
@@ -902,32 +904,32 @@ nsInlineFrame::IncrementalReflowFrom(nsIPresContext* aPresContext,
|
|||||||
// Any space left?
|
// Any space left?
|
||||||
if (aState.availSize.width <= 0) {
|
if (aState.availSize.width <= 0) {
|
||||||
// No space left. Don't try to pull-up children
|
// No space left. Don't try to pull-up children
|
||||||
status = frNotComplete;
|
status = 0;
|
||||||
} else {
|
} else {
|
||||||
// Try and pull-up some children from a next-in-flow
|
// Try and pull-up some children from a next-in-flow
|
||||||
if (!PullUpChildren(aPresContext, aState)) {
|
if (!PullUpChildren(aPresContext, aState)) {
|
||||||
// We were not able to pull-up all the child frames from our
|
// We were not able to pull-up all the child frames from our
|
||||||
// next-in-flow
|
// next-in-flow
|
||||||
status = frNotComplete;
|
status = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// We were unable to reflow all our mapped frames
|
// We were unable to reflow all our mapped frames
|
||||||
status = frNotComplete;
|
status = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
nsInlineFrame::IncrementalReflowAfter(nsIPresContext* aPresContext,
|
nsInlineFrame::IncrementalReflowAfter(nsIPresContext* aPresContext,
|
||||||
nsInlineState& aState,
|
nsInlineState& aState,
|
||||||
nsIFrame* aChildFrame,
|
nsIFrame* aChildFrame,
|
||||||
PRInt32 aChildIndex)
|
PRInt32 aChildIndex)
|
||||||
{
|
{
|
||||||
ReflowStatus status = frComplete;
|
nsReflowStatus status = NS_FRAME_COMPLETE;
|
||||||
nsIFrame* nextFrame;
|
nsIFrame* nextFrame;
|
||||||
|
|
||||||
aChildFrame->GetNextSibling(nextFrame);
|
aChildFrame->GetNextSibling(nextFrame);
|
||||||
|
|
||||||
@@ -939,19 +941,19 @@ nsInlineFrame::IncrementalReflowAfter(nsIPresContext* aPresContext,
|
|||||||
// Any space left?
|
// Any space left?
|
||||||
if (aState.availSize.width <= 0) {
|
if (aState.availSize.width <= 0) {
|
||||||
// No space left. Don't try to pull-up children
|
// No space left. Don't try to pull-up children
|
||||||
status = frNotComplete;
|
status = 0;
|
||||||
} else {
|
} else {
|
||||||
// Try and pull-up some children from a next-in-flow
|
// Try and pull-up some children from a next-in-flow
|
||||||
if (!PullUpChildren(aPresContext, aState)) {
|
if (!PullUpChildren(aPresContext, aState)) {
|
||||||
// We were not able to pull-up all the child frames from our
|
// We were not able to pull-up all the child frames from our
|
||||||
// next-in-flow
|
// next-in-flow
|
||||||
status = frNotComplete;
|
status = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// We were unable to reflow all our mapped frames
|
// We were unable to reflow all our mapped frames
|
||||||
status = frNotComplete;
|
status = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
@@ -961,9 +963,9 @@ NS_METHOD nsInlineFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
aStatus = frComplete; // initialize out parameter
|
aStatus = NS_FRAME_COMPLETE; // initialize out parameter
|
||||||
|
|
||||||
// Get the style molecule
|
// Get the style molecule
|
||||||
nsStyleFont* styleFont =
|
nsStyleFont* styleFont =
|
||||||
@@ -1036,7 +1038,7 @@ NS_METHOD nsInlineFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
PushChildren(kidFrame, prevFrame, mLastContentIsComplete);
|
PushChildren(kidFrame, prevFrame, mLastContentIsComplete);
|
||||||
SetLastContentOffset(prevFrame);
|
SetLastContentOffset(prevFrame);
|
||||||
mChildCount = kidIndex - 1;
|
mChildCount = kidIndex - 1;
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Place and size the child
|
// Place and size the child
|
||||||
@@ -1046,7 +1048,7 @@ NS_METHOD nsInlineFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
kidFrame->GetNextInFlow(kidNextInFlow);
|
kidFrame->GetNextInFlow(kidNextInFlow);
|
||||||
|
|
||||||
// Is the child complete?
|
// Is the child complete?
|
||||||
if (frComplete == aStatus) {
|
if (NS_FRAME_IS_COMPLETE(aStatus)) {
|
||||||
// Check whether the frame has next-in-flow(s) that are no longer needed
|
// Check whether the frame has next-in-flow(s) that are no longer needed
|
||||||
if (nsnull != kidNextInFlow) {
|
if (nsnull != kidNextInFlow) {
|
||||||
// Remove the next-in-flow(s)
|
// Remove the next-in-flow(s)
|
||||||
@@ -1117,7 +1119,8 @@ NS_METHOD nsInlineFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
* If one of our children spills over the end then push it to the
|
* If one of our children spills over the end then push it to the
|
||||||
* next-in-flow or to our overflow list.
|
* next-in-flow or to our overflow list.
|
||||||
*/
|
*/
|
||||||
nsIFrame::ReflowStatus
|
#if 0
|
||||||
|
nsReflowStatus
|
||||||
nsInlineFrame::AdjustChildren(nsIPresContext* aPresContext,
|
nsInlineFrame::AdjustChildren(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
nsInlineState& aState,
|
nsInlineState& aState,
|
||||||
@@ -1154,5 +1157,6 @@ nsInlineFrame::AdjustChildren(nsIPresContext* aPresContext,
|
|||||||
// XXX adjust mLastContentOffset if we push
|
// XXX adjust mLastContentOffset if we push
|
||||||
// XXX if we push, generate a reflow command
|
// XXX if we push, generate a reflow command
|
||||||
|
|
||||||
return frComplete;
|
return NS_FRAME_COMPLETE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ NS_METHOD nsLeafFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
// XXX add in code to check for width/height being set via css
|
// XXX add in code to check for width/height being set via css
|
||||||
// and if set use them instead of calling GetDesiredSize.
|
// and if set use them instead of calling GetDesiredSize.
|
||||||
@@ -63,7 +63,7 @@ NS_METHOD nsLeafFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
aMaxElementSize->width = aDesiredSize.width;
|
aMaxElementSize->width = aDesiredSize.width;
|
||||||
aMaxElementSize->height = aDesiredSize.height;
|
aMaxElementSize->height = aDesiredSize.height;
|
||||||
}
|
}
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ NS_METHOD nsLeafFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
// XXX Unless the reflow command is a style change, we should
|
// XXX Unless the reflow command is a style change, we should
|
||||||
// just return the current size, otherwise we should invoke
|
// just return the current size, otherwise we should invoke
|
||||||
@@ -82,7 +82,7 @@ NS_METHOD nsLeafFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
GetDesiredSize(aPresContext, aDesiredSize, aMaxSize);
|
GetDesiredSize(aPresContext, aDesiredSize, aMaxSize);
|
||||||
AddBordersAndPadding(aPresContext, aDesiredSize);
|
AddBordersAndPadding(aPresContext, aDesiredSize);
|
||||||
|
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,13 +36,13 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||||
nsIFrame* aParent,
|
nsIFrame* aParent,
|
||||||
|
|||||||
@@ -342,7 +342,7 @@ nsLineLayout::WordBreakReflow()
|
|||||||
mReflowResult = NS_LINE_LAYOUT_REFLOW_RESULT_NOT_AWARE;
|
mReflowResult = NS_LINE_LAYOUT_REFLOW_RESULT_NOT_AWARE;
|
||||||
nsSize maxElementSize;
|
nsSize maxElementSize;
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
nsIFrame::ReflowStatus kidReflowStatus;
|
nsReflowStatus kidReflowStatus;
|
||||||
nsSize* kidMaxElementSize = nsnull;
|
nsSize* kidMaxElementSize = nsnull;
|
||||||
if (nsnull != mMaxElementSizePointer) {
|
if (nsnull != mMaxElementSizePointer) {
|
||||||
kidMaxElementSize = &maxElementSize;
|
kidMaxElementSize = &maxElementSize;
|
||||||
@@ -408,7 +408,7 @@ nsLineLayout::ReflowChild(nsReflowCommand* aReflowCommand)
|
|||||||
nsSize maxElementSize;
|
nsSize maxElementSize;
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
nsSize* kidMaxElementSize = nsnull;
|
nsSize* kidMaxElementSize = nsnull;
|
||||||
nsIFrame::ReflowStatus kidReflowStatus;
|
nsReflowStatus kidReflowStatus;
|
||||||
if (nsnull != mMaxElementSizePointer) {
|
if (nsnull != mMaxElementSizePointer) {
|
||||||
kidMaxElementSize = &maxElementSize;
|
kidMaxElementSize = &maxElementSize;
|
||||||
}
|
}
|
||||||
@@ -515,7 +515,7 @@ nsLineLayout::ReflowChild(nsReflowCommand* aReflowCommand)
|
|||||||
|
|
||||||
// Set completion status
|
// Set completion status
|
||||||
mLine->mLastContentOffset = mKidIndex;
|
mLine->mLastContentOffset = mKidIndex;
|
||||||
if (nsIFrame::frComplete == kidReflowStatus) {
|
if (NS_FRAME_IS_COMPLETE(kidReflowStatus)) {
|
||||||
mLine->mLastContentIsComplete = PR_TRUE;
|
mLine->mLastContentIsComplete = PR_TRUE;
|
||||||
if (isBlock ||
|
if (isBlock ||
|
||||||
(NS_LINE_LAYOUT_REFLOW_RESULT_BREAK_AFTER == mReflowResult)) {
|
(NS_LINE_LAYOUT_REFLOW_RESULT_BREAK_AFTER == mReflowResult)) {
|
||||||
|
|||||||
@@ -58,12 +58,12 @@ NS_METHOD PageFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
PreReflowCheck();
|
PreReflowCheck();
|
||||||
#endif
|
#endif
|
||||||
aStatus = frComplete; // initialize out parameter
|
aStatus = NS_FRAME_COMPLETE; // initialize out parameter
|
||||||
|
|
||||||
// Do we have any children?
|
// Do we have any children?
|
||||||
if (nsnull == mFirstChild) {
|
if (nsnull == mFirstChild) {
|
||||||
@@ -95,7 +95,7 @@ NS_METHOD PageFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
// Get the child's desired size
|
// Get the child's desired size
|
||||||
aStatus = ReflowChild(mFirstChild, aPresContext, aDesiredSize, aMaxSize,
|
aStatus = ReflowChild(mFirstChild, aPresContext, aDesiredSize, aMaxSize,
|
||||||
aMaxElementSize);
|
aMaxElementSize);
|
||||||
mLastContentIsComplete = PRBool(aStatus == frComplete);
|
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(aStatus);
|
||||||
|
|
||||||
// Make sure the child is at least as tall as our max size (the containing window)
|
// Make sure the child is at least as tall as our max size (the containing window)
|
||||||
if (aDesiredSize.height < aMaxSize.height) {
|
if (aDesiredSize.height < aMaxSize.height) {
|
||||||
@@ -107,7 +107,7 @@ NS_METHOD PageFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
mFirstChild->SetRect(rect);
|
mFirstChild->SetRect(rect);
|
||||||
|
|
||||||
// Is the frame complete?
|
// Is the frame complete?
|
||||||
if (frComplete == aStatus) {
|
if (NS_FRAME_IS_COMPLETE(aStatus)) {
|
||||||
nsIFrame* childNextInFlow;
|
nsIFrame* childNextInFlow;
|
||||||
|
|
||||||
mFirstChild->GetNextInFlow(childNextInFlow);
|
mFirstChild->GetNextInFlow(childNextInFlow);
|
||||||
@@ -130,7 +130,7 @@ NS_METHOD PageFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
// We don't expect the target of the reflow command to be page frame
|
// We don't expect the target of the reflow command to be page frame
|
||||||
NS_ASSERTION(aReflowCommand.GetTarget() != this, "page frame is reflow command target");
|
NS_ASSERTION(aReflowCommand.GetTarget() != this, "page frame is reflow command target");
|
||||||
|
|||||||
@@ -29,13 +29,13 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aCX,
|
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aCX,
|
||||||
nsIFrame* aParent,
|
nsIFrame* aParent,
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ NS_METHOD PlaceholderFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
// Get the floater container in which we're inserted
|
// Get the floater container in which we're inserted
|
||||||
nsIFloaterContainer* container = nsnull;
|
nsIFloaterContainer* container = nsnull;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||||
NS_IMETHOD ListTag(FILE* out = stdout) const;
|
NS_IMETHOD ListTag(FILE* out = stdout) const;
|
||||||
|
|
||||||
|
|||||||
@@ -34,13 +34,13 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD GetReflowMetrics(nsIPresContext* aPresContext,
|
NS_IMETHOD GetReflowMetrics(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aMetrics);
|
nsReflowMetrics& aMetrics);
|
||||||
@@ -67,8 +67,8 @@ protected:
|
|||||||
PRBool PullUpChildren(nsIPresContext* aPresContext,
|
PRBool PullUpChildren(nsIPresContext* aPresContext,
|
||||||
nsInlineState& aState);
|
nsInlineState& aState);
|
||||||
|
|
||||||
ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
nsReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
||||||
nsInlineState& aState);
|
nsInlineState& aState);
|
||||||
|
|
||||||
void PlaceChild(nsIFrame* aChild,
|
void PlaceChild(nsIFrame* aChild,
|
||||||
PRInt32 aIndex, // in the child frame list
|
PRInt32 aIndex, // in the child frame list
|
||||||
@@ -80,22 +80,24 @@ protected:
|
|||||||
nsInlineState& aState,
|
nsInlineState& aState,
|
||||||
nsIFrame* aSkipChild);
|
nsIFrame* aSkipChild);
|
||||||
|
|
||||||
ReflowStatus IncrementalReflowFrom(nsIPresContext* aPresContext,
|
nsReflowStatus IncrementalReflowFrom(nsIPresContext* aPresContext,
|
||||||
nsInlineState& aState,
|
nsInlineState& aState,
|
||||||
nsIFrame* aChildFrame,
|
nsIFrame* aChildFrame,
|
||||||
PRInt32 aChildIndex);
|
PRInt32 aChildIndex);
|
||||||
|
|
||||||
ReflowStatus IncrementalReflowAfter(nsIPresContext* aPresContext,
|
nsReflowStatus IncrementalReflowAfter(nsIPresContext* aPresContext,
|
||||||
nsInlineState& aState,
|
nsInlineState& aState,
|
||||||
nsIFrame* aChildFrame,
|
nsIFrame* aChildFrame,
|
||||||
PRInt32 aChildIndex);
|
PRInt32 aChildIndex);
|
||||||
|
|
||||||
ReflowStatus AdjustChildren(nsIPresContext* aPresContext,
|
#if 0
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowStatus AdjustChildren(nsIPresContext* aPresContext,
|
||||||
nsInlineState& aState,
|
nsReflowMetrics& aDesiredSize,
|
||||||
nsIFrame* aKid,
|
nsInlineState& aState,
|
||||||
nsReflowMetrics& aKidMetrics,
|
nsIFrame* aKid,
|
||||||
ReflowStatus aKidReflowStatus);
|
nsReflowMetrics& aKidMetrics,
|
||||||
|
ReflowStatus aKidReflowStatus);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* nsInlineFrame_h___ */
|
#endif /* nsInlineFrame_h___ */
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ NS_METHOD AbsoluteFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
// Have we created the absolutely positioned item yet?
|
// Have we created the absolutely positioned item yet?
|
||||||
if (nsnull == mFrame) {
|
if (nsnull == mFrame) {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
NS_IMETHOD GetReflowMetrics(nsIPresContext* aPresContext,
|
NS_IMETHOD GetReflowMetrics(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aMetrics);
|
nsReflowMetrics& aMetrics);
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ NS_METHOD BRFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
// Get cached state for containing block frame
|
// Get cached state for containing block frame
|
||||||
nsLineLayout* lineLayoutState = nsnull;
|
nsLineLayout* lineLayoutState = nsnull;
|
||||||
@@ -117,7 +117,7 @@ NS_METHOD BRFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
GetReflowMetrics(aPresContext, aDesiredSize);
|
GetReflowMetrics(aPresContext, aDesiredSize);
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -428,7 +428,7 @@ nsBlockFrame::ReflowInlineChild(nsIFrame* aKidFrame,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
aStatus = ReflowChild(aKidFrame, aPresContext, aDesiredSize, aMaxSize,
|
aStatus = ReflowChild(aKidFrame, aPresContext, aDesiredSize, aMaxSize,
|
||||||
aMaxElementSize);
|
aMaxElementSize);
|
||||||
@@ -442,7 +442,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame,
|
|||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
aStatus = ReflowChild(aKidFrame, aPresContext, aSpaceManager,
|
aStatus = ReflowChild(aKidFrame, aPresContext, aSpaceManager,
|
||||||
aMaxSize, aDesiredRect, aMaxElementSize);
|
aMaxSize, aDesiredRect, aMaxElementSize);
|
||||||
@@ -1072,10 +1072,10 @@ nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
nsBlockReflowState state;
|
nsBlockReflowState state;
|
||||||
rv = InitializeState(aPresContext, aMaxSize, aMaxElementSize, state);
|
rv = InitializeState(aPresContext, aMaxSize, aMaxElementSize, state);
|
||||||
if (NS_OK == rv) {
|
if (NS_OK == rv) {
|
||||||
@@ -1127,7 +1127,7 @@ nsresult
|
|||||||
nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState,
|
nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
VerifyLines(PR_TRUE);
|
VerifyLines(PR_TRUE);
|
||||||
@@ -1164,15 +1164,15 @@ nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState,
|
|||||||
ComputeDesiredRect(aState, aMaxSize, aDesiredRect);
|
ComputeDesiredRect(aState, aMaxSize, aDesiredRect);
|
||||||
|
|
||||||
// Set return status
|
// Set return status
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
||||||
rv = NS_OK;
|
rv = NS_OK;
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
// Verify that the line layout code pulled everything up when it
|
// Verify that the line layout code pulled everything up when it
|
||||||
// indicates a complete reflow.
|
// indicates a complete reflow.
|
||||||
if (frComplete == aStatus) {
|
if (NS_FRAME_IS_COMPLETE(aStatus)) {
|
||||||
nsBlockFrame* nextBlock = (nsBlockFrame*) mNextInFlow;
|
nsBlockFrame* nextBlock = (nsBlockFrame*) mNextInFlow;
|
||||||
while (nsnull != nextBlock) {
|
while (nsnull != nextBlock) {
|
||||||
NS_ASSERTION((nsnull == nextBlock->mLines) &&
|
NS_ASSERTION((nsnull == nextBlock->mLines) &&
|
||||||
@@ -1266,15 +1266,15 @@ nsBlockFrame::GetReflowMetrics(nsIPresContext* aPresContext,
|
|||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
NS_METHOD
|
NS_METHOD
|
||||||
nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext,
|
nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext,
|
||||||
nsISpaceManager* aSpaceManager,
|
nsISpaceManager* aSpaceManager,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
nsIFrame::ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
nsBlockReflowState state;
|
nsBlockReflowState state;
|
||||||
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
||||||
aMaxElementSize, state);
|
aMaxElementSize, state);
|
||||||
@@ -1331,12 +1331,12 @@ nsresult nsBlockFrame::IncrementalReflowAfter(nsBlockReflowState& aState,
|
|||||||
}
|
}
|
||||||
|
|
||||||
NS_METHOD
|
NS_METHOD
|
||||||
nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsISpaceManager* aSpaceManager,
|
nsISpaceManager* aSpaceManager,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
nsIFrame::ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
VerifyLines(PR_TRUE);
|
VerifyLines(PR_TRUE);
|
||||||
@@ -1344,7 +1344,7 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
nsBlockReflowState state;
|
nsBlockReflowState state;
|
||||||
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
||||||
nsnull, state);
|
nsnull, state);
|
||||||
@@ -1428,10 +1428,10 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
ComputeDesiredRect(state, aMaxSize, aDesiredRect);
|
ComputeDesiredRect(state, aMaxSize, aDesiredRect);
|
||||||
|
|
||||||
// Set return status
|
// Set return status
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
||||||
rv = NS_OK;
|
rv = NS_OK;
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now that reflow has finished, remove the cached pointer
|
// Now that reflow has finished, remove the cached pointer
|
||||||
|
|||||||
@@ -185,18 +185,18 @@ public:
|
|||||||
NS_IMETHOD VerifyTree() const;
|
NS_IMETHOD VerifyTree() const;
|
||||||
|
|
||||||
// nsIRunaround
|
// nsIRunaround
|
||||||
NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext,
|
||||||
nsISpaceManager* aSpaceManager,
|
nsISpaceManager* aSpaceManager,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
nsIFrame::ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsISpaceManager* aSpaceManager,
|
nsISpaceManager* aSpaceManager,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
nsIFrame::ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
// nsIFloaterContainer
|
// nsIFloaterContainer
|
||||||
virtual PRBool AddFloater(nsIPresContext* aPresContext,
|
virtual PRBool AddFloater(nsIPresContext* aPresContext,
|
||||||
@@ -212,7 +212,7 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
nsresult ReflowBlockChild(nsIFrame* aKidFrame,
|
nsresult ReflowBlockChild(nsIFrame* aKidFrame,
|
||||||
nsIPresContext* aPresContext,
|
nsIPresContext* aPresContext,
|
||||||
@@ -220,7 +220,7 @@ public:
|
|||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
nsLineData* GetFirstLine();
|
nsLineData* GetFirstLine();
|
||||||
|
|
||||||
@@ -245,7 +245,7 @@ protected:
|
|||||||
nsresult DoResizeReflow(nsBlockReflowState& aState,
|
nsresult DoResizeReflow(nsBlockReflowState& aState,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
void ComputeDesiredRect(nsBlockReflowState& aState,
|
void ComputeDesiredRect(nsBlockReflowState& aState,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
|
|||||||
@@ -428,7 +428,7 @@ nsBlockFrame::ReflowInlineChild(nsIFrame* aKidFrame,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
aStatus = ReflowChild(aKidFrame, aPresContext, aDesiredSize, aMaxSize,
|
aStatus = ReflowChild(aKidFrame, aPresContext, aDesiredSize, aMaxSize,
|
||||||
aMaxElementSize);
|
aMaxElementSize);
|
||||||
@@ -442,7 +442,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame,
|
|||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
aStatus = ReflowChild(aKidFrame, aPresContext, aSpaceManager,
|
aStatus = ReflowChild(aKidFrame, aPresContext, aSpaceManager,
|
||||||
aMaxSize, aDesiredRect, aMaxElementSize);
|
aMaxSize, aDesiredRect, aMaxElementSize);
|
||||||
@@ -1072,10 +1072,10 @@ nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
nsBlockReflowState state;
|
nsBlockReflowState state;
|
||||||
rv = InitializeState(aPresContext, aMaxSize, aMaxElementSize, state);
|
rv = InitializeState(aPresContext, aMaxSize, aMaxElementSize, state);
|
||||||
if (NS_OK == rv) {
|
if (NS_OK == rv) {
|
||||||
@@ -1127,7 +1127,7 @@ nsresult
|
|||||||
nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState,
|
nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
VerifyLines(PR_TRUE);
|
VerifyLines(PR_TRUE);
|
||||||
@@ -1164,15 +1164,15 @@ nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState,
|
|||||||
ComputeDesiredRect(aState, aMaxSize, aDesiredRect);
|
ComputeDesiredRect(aState, aMaxSize, aDesiredRect);
|
||||||
|
|
||||||
// Set return status
|
// Set return status
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
||||||
rv = NS_OK;
|
rv = NS_OK;
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
// Verify that the line layout code pulled everything up when it
|
// Verify that the line layout code pulled everything up when it
|
||||||
// indicates a complete reflow.
|
// indicates a complete reflow.
|
||||||
if (frComplete == aStatus) {
|
if (NS_FRAME_IS_COMPLETE(aStatus)) {
|
||||||
nsBlockFrame* nextBlock = (nsBlockFrame*) mNextInFlow;
|
nsBlockFrame* nextBlock = (nsBlockFrame*) mNextInFlow;
|
||||||
while (nsnull != nextBlock) {
|
while (nsnull != nextBlock) {
|
||||||
NS_ASSERTION((nsnull == nextBlock->mLines) &&
|
NS_ASSERTION((nsnull == nextBlock->mLines) &&
|
||||||
@@ -1266,15 +1266,15 @@ nsBlockFrame::GetReflowMetrics(nsIPresContext* aPresContext,
|
|||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
NS_METHOD
|
NS_METHOD
|
||||||
nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext,
|
nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext,
|
||||||
nsISpaceManager* aSpaceManager,
|
nsISpaceManager* aSpaceManager,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
nsIFrame::ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
nsBlockReflowState state;
|
nsBlockReflowState state;
|
||||||
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
||||||
aMaxElementSize, state);
|
aMaxElementSize, state);
|
||||||
@@ -1331,12 +1331,12 @@ nsresult nsBlockFrame::IncrementalReflowAfter(nsBlockReflowState& aState,
|
|||||||
}
|
}
|
||||||
|
|
||||||
NS_METHOD
|
NS_METHOD
|
||||||
nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsISpaceManager* aSpaceManager,
|
nsISpaceManager* aSpaceManager,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
nsIFrame::ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
VerifyLines(PR_TRUE);
|
VerifyLines(PR_TRUE);
|
||||||
@@ -1344,7 +1344,7 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
nsBlockReflowState state;
|
nsBlockReflowState state;
|
||||||
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
||||||
nsnull, state);
|
nsnull, state);
|
||||||
@@ -1428,10 +1428,10 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
ComputeDesiredRect(state, aMaxSize, aDesiredRect);
|
ComputeDesiredRect(state, aMaxSize, aDesiredRect);
|
||||||
|
|
||||||
// Set return status
|
// Set return status
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
||||||
rv = NS_OK;
|
rv = NS_OK;
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now that reflow has finished, remove the cached pointer
|
// Now that reflow has finished, remove the cached pointer
|
||||||
|
|||||||
@@ -428,7 +428,7 @@ nsBlockFrame::ReflowInlineChild(nsIFrame* aKidFrame,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
aStatus = ReflowChild(aKidFrame, aPresContext, aDesiredSize, aMaxSize,
|
aStatus = ReflowChild(aKidFrame, aPresContext, aDesiredSize, aMaxSize,
|
||||||
aMaxElementSize);
|
aMaxElementSize);
|
||||||
@@ -442,7 +442,7 @@ nsBlockFrame::ReflowBlockChild(nsIFrame* aKidFrame,
|
|||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
aStatus = ReflowChild(aKidFrame, aPresContext, aSpaceManager,
|
aStatus = ReflowChild(aKidFrame, aPresContext, aSpaceManager,
|
||||||
aMaxSize, aDesiredRect, aMaxElementSize);
|
aMaxSize, aDesiredRect, aMaxElementSize);
|
||||||
@@ -1072,10 +1072,10 @@ nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
nsBlockReflowState state;
|
nsBlockReflowState state;
|
||||||
rv = InitializeState(aPresContext, aMaxSize, aMaxElementSize, state);
|
rv = InitializeState(aPresContext, aMaxSize, aMaxElementSize, state);
|
||||||
if (NS_OK == rv) {
|
if (NS_OK == rv) {
|
||||||
@@ -1127,7 +1127,7 @@ nsresult
|
|||||||
nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState,
|
nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
VerifyLines(PR_TRUE);
|
VerifyLines(PR_TRUE);
|
||||||
@@ -1164,15 +1164,15 @@ nsBlockFrame::DoResizeReflow(nsBlockReflowState& aState,
|
|||||||
ComputeDesiredRect(aState, aMaxSize, aDesiredRect);
|
ComputeDesiredRect(aState, aMaxSize, aDesiredRect);
|
||||||
|
|
||||||
// Set return status
|
// Set return status
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
||||||
rv = NS_OK;
|
rv = NS_OK;
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
// Verify that the line layout code pulled everything up when it
|
// Verify that the line layout code pulled everything up when it
|
||||||
// indicates a complete reflow.
|
// indicates a complete reflow.
|
||||||
if (frComplete == aStatus) {
|
if (NS_FRAME_IS_COMPLETE(aStatus)) {
|
||||||
nsBlockFrame* nextBlock = (nsBlockFrame*) mNextInFlow;
|
nsBlockFrame* nextBlock = (nsBlockFrame*) mNextInFlow;
|
||||||
while (nsnull != nextBlock) {
|
while (nsnull != nextBlock) {
|
||||||
NS_ASSERTION((nsnull == nextBlock->mLines) &&
|
NS_ASSERTION((nsnull == nextBlock->mLines) &&
|
||||||
@@ -1266,15 +1266,15 @@ nsBlockFrame::GetReflowMetrics(nsIPresContext* aPresContext,
|
|||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
NS_METHOD
|
NS_METHOD
|
||||||
nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext,
|
nsBlockFrame::ResizeReflow(nsIPresContext* aPresContext,
|
||||||
nsISpaceManager* aSpaceManager,
|
nsISpaceManager* aSpaceManager,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
nsIFrame::ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
nsBlockReflowState state;
|
nsBlockReflowState state;
|
||||||
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
||||||
aMaxElementSize, state);
|
aMaxElementSize, state);
|
||||||
@@ -1331,12 +1331,12 @@ nsresult nsBlockFrame::IncrementalReflowAfter(nsBlockReflowState& aState,
|
|||||||
}
|
}
|
||||||
|
|
||||||
NS_METHOD
|
NS_METHOD
|
||||||
nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsISpaceManager* aSpaceManager,
|
nsISpaceManager* aSpaceManager,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
nsIFrame::ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
VerifyLines(PR_TRUE);
|
VerifyLines(PR_TRUE);
|
||||||
@@ -1344,7 +1344,7 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
nsBlockReflowState state;
|
nsBlockReflowState state;
|
||||||
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
rv = InitializeState(aPresContext, aSpaceManager, aMaxSize,
|
||||||
nsnull, state);
|
nsnull, state);
|
||||||
@@ -1428,10 +1428,10 @@ nsBlockFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
ComputeDesiredRect(state, aMaxSize, aDesiredRect);
|
ComputeDesiredRect(state, aMaxSize, aDesiredRect);
|
||||||
|
|
||||||
// Set return status
|
// Set return status
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
if (NS_LINE_LAYOUT_NOT_COMPLETE == rv) {
|
||||||
rv = NS_OK;
|
rv = NS_OK;
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now that reflow has finished, remove the cached pointer
|
// Now that reflow has finished, remove the cached pointer
|
||||||
|
|||||||
@@ -134,9 +134,9 @@ NS_METHOD nsBodyFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
aStatus = frComplete; // initialize out parameter
|
aStatus = NS_FRAME_COMPLETE; // initialize out parameter
|
||||||
|
|
||||||
// Do we have any children?
|
// Do we have any children?
|
||||||
if (nsnull == mFirstChild) {
|
if (nsnull == mFirstChild) {
|
||||||
@@ -177,7 +177,7 @@ NS_METHOD nsBodyFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
// If the frame is complete, then check whether there's a next-in-flow that
|
// If the frame is complete, then check whether there's a next-in-flow that
|
||||||
// needs to be deleted
|
// needs to be deleted
|
||||||
if (frComplete == aStatus) {
|
if (NS_FRAME_IS_COMPLETE(aStatus)) {
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
mFirstChild->GetNextInFlow(kidNextInFlow);
|
mFirstChild->GetNextInFlow(kidNextInFlow);
|
||||||
@@ -249,7 +249,7 @@ NS_METHOD nsBodyFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
// XXX Currently there's a bug that when the body background image dimension
|
// XXX Currently there's a bug that when the body background image dimension
|
||||||
// is resolved we're treating that as a content change rather than just repainting
|
// is resolved we're treating that as a content change rather than just repainting
|
||||||
|
|||||||
@@ -37,13 +37,13 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD ContentAppended(nsIPresShell* aShell,
|
NS_IMETHOD ContentAppended(nsIPresShell* aShell,
|
||||||
nsIPresContext* aPresContext,
|
nsIPresContext* aPresContext,
|
||||||
@@ -60,6 +60,7 @@ public:
|
|||||||
nsIStyleContext* aStyleContext,
|
nsIStyleContext* aStyleContext,
|
||||||
nsIFrame*& aContinuingFrame);
|
nsIFrame*& aContinuingFrame);
|
||||||
|
|
||||||
|
// nsIAnchoredItems
|
||||||
virtual void AddAnchoredItem(nsIFrame* aAnchoredItem,
|
virtual void AddAnchoredItem(nsIFrame* aAnchoredItem,
|
||||||
AnchoringPosition aPosition,
|
AnchoringPosition aPosition,
|
||||||
nsIFrame* aContainer);
|
nsIFrame* aContainer);
|
||||||
|
|||||||
@@ -311,7 +311,7 @@ PRBool ColumnFrame::ReflowMappedChildren(nsIPresContext* aPresContext,
|
|||||||
childCount++;
|
childCount++;
|
||||||
|
|
||||||
// Update mLastContentIsComplete now that this kid fits
|
// Update mLastContentIsComplete now that this kid fits
|
||||||
mLastContentIsComplete = PRBool(status == frComplete);
|
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status);
|
||||||
|
|
||||||
// Special handling for incomplete children
|
// Special handling for incomplete children
|
||||||
if (frNotComplete == status) {
|
if (frNotComplete == status) {
|
||||||
|
|||||||
@@ -431,7 +431,7 @@ nsHTMLContainerFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// Ignore all other reflow commands
|
// Ignore all other reflow commands
|
||||||
status = frComplete;
|
status = NS_FRAME_COMPLETE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ PRBool nsInlineFrame::ReflowMappedChildrenFrom(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
for (nsIFrame* kidFrame = aChildFrame; nsnull != kidFrame; ) {
|
for (nsIFrame* kidFrame = aChildFrame; nsnull != kidFrame; ) {
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
// Reflow the child into the available space
|
// Reflow the child into the available space
|
||||||
status = ReflowChild(kidFrame, aPresContext, kidSize, aState.availSize,
|
status = ReflowChild(kidFrame, aPresContext, kidSize, aState.availSize,
|
||||||
@@ -256,8 +256,8 @@ PRBool nsInlineFrame::ReflowMappedChildrenFrom(nsIPresContext* aPresContext,
|
|||||||
prevKidFrame = kidFrame;
|
prevKidFrame = kidFrame;
|
||||||
|
|
||||||
// Is the child complete?
|
// Is the child complete?
|
||||||
mLastContentIsComplete = PRBool(status == frComplete);
|
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status);
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// No, the child isn't complete
|
// No, the child isn't complete
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
@@ -358,7 +358,7 @@ PRBool nsInlineFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
while (nsnull != nextInFlow) {
|
while (nsnull != nextInFlow) {
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
// Get the next child
|
// Get the next child
|
||||||
nsIFrame* kidFrame = nextInFlow->mFirstChild;
|
nsIFrame* kidFrame = nextInFlow->mFirstChild;
|
||||||
@@ -443,8 +443,8 @@ PRBool nsInlineFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
prevLastContentIsComplete = mLastContentIsComplete;
|
prevLastContentIsComplete = mLastContentIsComplete;
|
||||||
|
|
||||||
// Is the child we just pulled up complete?
|
// Is the child we just pulled up complete?
|
||||||
mLastContentIsComplete = PRBool(status == frComplete);
|
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status);
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// No the child isn't complete
|
// No the child isn't complete
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
@@ -523,18 +523,17 @@ PRBool nsInlineFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
*
|
*
|
||||||
* @param aPresContext presentation context to use
|
* @param aPresContext presentation context to use
|
||||||
* @param aState current inline state
|
* @param aState current inline state
|
||||||
* @return frComplete if all content has been mapped and frNotComplete
|
* @return NS_FRAME_COMPLETE if all content has been mapped and 0 if we
|
||||||
* if we should be continued
|
* should be continued
|
||||||
*/
|
*/
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
||||||
nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
nsInlineState& aState)
|
||||||
nsInlineState& aState)
|
|
||||||
{
|
{
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
VerifyLastIsComplete();
|
VerifyLastIsComplete();
|
||||||
#endif
|
#endif
|
||||||
nsIFrame* kidPrevInFlow = nsnull;
|
nsIFrame* kidPrevInFlow = nsnull;
|
||||||
ReflowStatus result = frNotComplete;
|
nsReflowStatus result = 0;
|
||||||
|
|
||||||
// If we have no children and we have a prev-in-flow then we need to pick
|
// If we have no children and we have a prev-in-flow then we need to pick
|
||||||
// up where it left off. If we have children, e.g. we're being resized, then
|
// up where it left off. If we have children, e.g. we're being resized, then
|
||||||
@@ -563,13 +562,13 @@ nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
// Get the next content object
|
// Get the next content object
|
||||||
nsIContentPtr kid = mContent->ChildAt(kidIndex);
|
nsIContentPtr kid = mContent->ChildAt(kidIndex);
|
||||||
if (nsnull == kid) {
|
if (nsnull == kid) {
|
||||||
result = frComplete;
|
result = NS_FRAME_COMPLETE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure we still have room left
|
// Make sure we still have room left
|
||||||
if (aState.availSize.width <= 0) {
|
if (aState.availSize.width <= 0) {
|
||||||
// Note: return status was set to frNotComplete above...
|
// Note: return status was set to 0 above...
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -629,8 +628,8 @@ nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
// Try to reflow the child into the available space. It might not
|
// Try to reflow the child into the available space. It might not
|
||||||
// fit or might need continuing.
|
// fit or might need continuing.
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
ReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize,
|
nsReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize,
|
||||||
aState.availSize, pKidMaxElementSize);
|
aState.availSize, pKidMaxElementSize);
|
||||||
|
|
||||||
// Did the child fit?
|
// Did the child fit?
|
||||||
if ((kidSize.width > aState.availSize.width) && (nsnull != mFirstChild)) {
|
if ((kidSize.width > aState.availSize.width) && (nsnull != mFirstChild)) {
|
||||||
@@ -658,7 +657,7 @@ nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
kidIndex++;
|
kidIndex++;
|
||||||
|
|
||||||
// Did the child complete?
|
// Did the child complete?
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// If the child isn't complete then it means that we've used up
|
// If the child isn't complete then it means that we've used up
|
||||||
// all of our available space
|
// all of our available space
|
||||||
mLastContentIsComplete = PR_FALSE;
|
mLastContentIsComplete = PR_FALSE;
|
||||||
@@ -704,7 +703,7 @@ NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
PreReflowCheck();
|
PreReflowCheck();
|
||||||
@@ -713,7 +712,7 @@ NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
PRBool reflowMappedOK = PR_TRUE;
|
PRBool reflowMappedOK = PR_TRUE;
|
||||||
|
|
||||||
aStatus = frComplete; // initialize out parameter
|
aStatus = NS_FRAME_COMPLETE; // initialize out parameter
|
||||||
|
|
||||||
// Get the style molecule
|
// Get the style molecule
|
||||||
nsStyleFont* styleFont = (nsStyleFont*)
|
nsStyleFont* styleFont = (nsStyleFont*)
|
||||||
@@ -735,7 +734,8 @@ NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
reflowMappedOK = ReflowMappedChildrenFrom(aPresContext, state, mFirstChild, 0);
|
reflowMappedOK = ReflowMappedChildrenFrom(aPresContext, state, mFirstChild, 0);
|
||||||
|
|
||||||
if (PR_FALSE == reflowMappedOK) {
|
if (PR_FALSE == reflowMappedOK) {
|
||||||
aStatus = frNotComplete;
|
// We didn't successfully reflow our mapped frames; therefore, we're not complete
|
||||||
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -745,7 +745,8 @@ NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
if (state.availSize.width <= 0) {
|
if (state.availSize.width <= 0) {
|
||||||
// No space left. Don't try to pull-up children or reflow unmapped
|
// No space left. Don't try to pull-up children or reflow unmapped
|
||||||
if (NextChildOffset() < mContent->ChildCount()) {
|
if (NextChildOffset() < mContent->ChildCount()) {
|
||||||
aStatus = frNotComplete;
|
// No room left to map the remaining content; therefore, we're not complete
|
||||||
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
} else if (NextChildOffset() < mContent->ChildCount()) {
|
} else if (NextChildOffset() < mContent->ChildCount()) {
|
||||||
// Try and pull-up some children from a next-in-flow
|
// Try and pull-up some children from a next-in-flow
|
||||||
@@ -755,8 +756,9 @@ NS_METHOD nsInlineFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
aStatus = ReflowUnmappedChildren(aPresContext, state);
|
aStatus = ReflowUnmappedChildren(aPresContext, state);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// We were unable to pull-up all the existing frames from the next in flow
|
// We were unable to pull-up all the existing frames from the next in flow;
|
||||||
aStatus = frNotComplete;
|
// therefore, we're not complete
|
||||||
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -887,13 +889,13 @@ PRInt32 nsInlineFrame::RecoverState(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
// XXX We need to return information about whether our next-in-flow is
|
// XXX We need to return information about whether our next-in-flow is
|
||||||
// dirty...
|
// dirty...
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
nsInlineFrame::IncrementalReflowFrom(nsIPresContext* aPresContext,
|
nsInlineFrame::IncrementalReflowFrom(nsIPresContext* aPresContext,
|
||||||
nsInlineState& aState,
|
nsInlineState& aState,
|
||||||
nsIFrame* aChildFrame,
|
nsIFrame* aChildFrame,
|
||||||
PRInt32 aChildIndex)
|
PRInt32 aChildIndex)
|
||||||
{
|
{
|
||||||
ReflowStatus status = frComplete;
|
nsReflowStatus status = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
// Just reflow all the mapped children starting with childFrame.
|
// Just reflow all the mapped children starting with childFrame.
|
||||||
// XXX This isn't the optimal thing to do...
|
// XXX This isn't the optimal thing to do...
|
||||||
@@ -902,32 +904,32 @@ nsInlineFrame::IncrementalReflowFrom(nsIPresContext* aPresContext,
|
|||||||
// Any space left?
|
// Any space left?
|
||||||
if (aState.availSize.width <= 0) {
|
if (aState.availSize.width <= 0) {
|
||||||
// No space left. Don't try to pull-up children
|
// No space left. Don't try to pull-up children
|
||||||
status = frNotComplete;
|
status = 0;
|
||||||
} else {
|
} else {
|
||||||
// Try and pull-up some children from a next-in-flow
|
// Try and pull-up some children from a next-in-flow
|
||||||
if (!PullUpChildren(aPresContext, aState)) {
|
if (!PullUpChildren(aPresContext, aState)) {
|
||||||
// We were not able to pull-up all the child frames from our
|
// We were not able to pull-up all the child frames from our
|
||||||
// next-in-flow
|
// next-in-flow
|
||||||
status = frNotComplete;
|
status = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// We were unable to reflow all our mapped frames
|
// We were unable to reflow all our mapped frames
|
||||||
status = frNotComplete;
|
status = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
nsInlineFrame::IncrementalReflowAfter(nsIPresContext* aPresContext,
|
nsInlineFrame::IncrementalReflowAfter(nsIPresContext* aPresContext,
|
||||||
nsInlineState& aState,
|
nsInlineState& aState,
|
||||||
nsIFrame* aChildFrame,
|
nsIFrame* aChildFrame,
|
||||||
PRInt32 aChildIndex)
|
PRInt32 aChildIndex)
|
||||||
{
|
{
|
||||||
ReflowStatus status = frComplete;
|
nsReflowStatus status = NS_FRAME_COMPLETE;
|
||||||
nsIFrame* nextFrame;
|
nsIFrame* nextFrame;
|
||||||
|
|
||||||
aChildFrame->GetNextSibling(nextFrame);
|
aChildFrame->GetNextSibling(nextFrame);
|
||||||
|
|
||||||
@@ -939,19 +941,19 @@ nsInlineFrame::IncrementalReflowAfter(nsIPresContext* aPresContext,
|
|||||||
// Any space left?
|
// Any space left?
|
||||||
if (aState.availSize.width <= 0) {
|
if (aState.availSize.width <= 0) {
|
||||||
// No space left. Don't try to pull-up children
|
// No space left. Don't try to pull-up children
|
||||||
status = frNotComplete;
|
status = 0;
|
||||||
} else {
|
} else {
|
||||||
// Try and pull-up some children from a next-in-flow
|
// Try and pull-up some children from a next-in-flow
|
||||||
if (!PullUpChildren(aPresContext, aState)) {
|
if (!PullUpChildren(aPresContext, aState)) {
|
||||||
// We were not able to pull-up all the child frames from our
|
// We were not able to pull-up all the child frames from our
|
||||||
// next-in-flow
|
// next-in-flow
|
||||||
status = frNotComplete;
|
status = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// We were unable to reflow all our mapped frames
|
// We were unable to reflow all our mapped frames
|
||||||
status = frNotComplete;
|
status = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
@@ -961,9 +963,9 @@ NS_METHOD nsInlineFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
aStatus = frComplete; // initialize out parameter
|
aStatus = NS_FRAME_COMPLETE; // initialize out parameter
|
||||||
|
|
||||||
// Get the style molecule
|
// Get the style molecule
|
||||||
nsStyleFont* styleFont =
|
nsStyleFont* styleFont =
|
||||||
@@ -1036,7 +1038,7 @@ NS_METHOD nsInlineFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
PushChildren(kidFrame, prevFrame, mLastContentIsComplete);
|
PushChildren(kidFrame, prevFrame, mLastContentIsComplete);
|
||||||
SetLastContentOffset(prevFrame);
|
SetLastContentOffset(prevFrame);
|
||||||
mChildCount = kidIndex - 1;
|
mChildCount = kidIndex - 1;
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Place and size the child
|
// Place and size the child
|
||||||
@@ -1046,7 +1048,7 @@ NS_METHOD nsInlineFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
kidFrame->GetNextInFlow(kidNextInFlow);
|
kidFrame->GetNextInFlow(kidNextInFlow);
|
||||||
|
|
||||||
// Is the child complete?
|
// Is the child complete?
|
||||||
if (frComplete == aStatus) {
|
if (NS_FRAME_IS_COMPLETE(aStatus)) {
|
||||||
// Check whether the frame has next-in-flow(s) that are no longer needed
|
// Check whether the frame has next-in-flow(s) that are no longer needed
|
||||||
if (nsnull != kidNextInFlow) {
|
if (nsnull != kidNextInFlow) {
|
||||||
// Remove the next-in-flow(s)
|
// Remove the next-in-flow(s)
|
||||||
@@ -1117,7 +1119,8 @@ NS_METHOD nsInlineFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
* If one of our children spills over the end then push it to the
|
* If one of our children spills over the end then push it to the
|
||||||
* next-in-flow or to our overflow list.
|
* next-in-flow or to our overflow list.
|
||||||
*/
|
*/
|
||||||
nsIFrame::ReflowStatus
|
#if 0
|
||||||
|
nsReflowStatus
|
||||||
nsInlineFrame::AdjustChildren(nsIPresContext* aPresContext,
|
nsInlineFrame::AdjustChildren(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
nsInlineState& aState,
|
nsInlineState& aState,
|
||||||
@@ -1154,5 +1157,6 @@ nsInlineFrame::AdjustChildren(nsIPresContext* aPresContext,
|
|||||||
// XXX adjust mLastContentOffset if we push
|
// XXX adjust mLastContentOffset if we push
|
||||||
// XXX if we push, generate a reflow command
|
// XXX if we push, generate a reflow command
|
||||||
|
|
||||||
return frComplete;
|
return NS_FRAME_COMPLETE;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ NS_METHOD nsLeafFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
// XXX add in code to check for width/height being set via css
|
// XXX add in code to check for width/height being set via css
|
||||||
// and if set use them instead of calling GetDesiredSize.
|
// and if set use them instead of calling GetDesiredSize.
|
||||||
@@ -63,7 +63,7 @@ NS_METHOD nsLeafFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
aMaxElementSize->width = aDesiredSize.width;
|
aMaxElementSize->width = aDesiredSize.width;
|
||||||
aMaxElementSize->height = aDesiredSize.height;
|
aMaxElementSize->height = aDesiredSize.height;
|
||||||
}
|
}
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ NS_METHOD nsLeafFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
// XXX Unless the reflow command is a style change, we should
|
// XXX Unless the reflow command is a style change, we should
|
||||||
// just return the current size, otherwise we should invoke
|
// just return the current size, otherwise we should invoke
|
||||||
@@ -82,7 +82,7 @@ NS_METHOD nsLeafFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
GetDesiredSize(aPresContext, aDesiredSize, aMaxSize);
|
GetDesiredSize(aPresContext, aDesiredSize, aMaxSize);
|
||||||
AddBordersAndPadding(aPresContext, aDesiredSize);
|
AddBordersAndPadding(aPresContext, aDesiredSize);
|
||||||
|
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,13 +36,13 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||||
nsIFrame* aParent,
|
nsIFrame* aParent,
|
||||||
|
|||||||
@@ -342,7 +342,7 @@ nsLineLayout::WordBreakReflow()
|
|||||||
mReflowResult = NS_LINE_LAYOUT_REFLOW_RESULT_NOT_AWARE;
|
mReflowResult = NS_LINE_LAYOUT_REFLOW_RESULT_NOT_AWARE;
|
||||||
nsSize maxElementSize;
|
nsSize maxElementSize;
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
nsIFrame::ReflowStatus kidReflowStatus;
|
nsReflowStatus kidReflowStatus;
|
||||||
nsSize* kidMaxElementSize = nsnull;
|
nsSize* kidMaxElementSize = nsnull;
|
||||||
if (nsnull != mMaxElementSizePointer) {
|
if (nsnull != mMaxElementSizePointer) {
|
||||||
kidMaxElementSize = &maxElementSize;
|
kidMaxElementSize = &maxElementSize;
|
||||||
@@ -408,7 +408,7 @@ nsLineLayout::ReflowChild(nsReflowCommand* aReflowCommand)
|
|||||||
nsSize maxElementSize;
|
nsSize maxElementSize;
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
nsSize* kidMaxElementSize = nsnull;
|
nsSize* kidMaxElementSize = nsnull;
|
||||||
nsIFrame::ReflowStatus kidReflowStatus;
|
nsReflowStatus kidReflowStatus;
|
||||||
if (nsnull != mMaxElementSizePointer) {
|
if (nsnull != mMaxElementSizePointer) {
|
||||||
kidMaxElementSize = &maxElementSize;
|
kidMaxElementSize = &maxElementSize;
|
||||||
}
|
}
|
||||||
@@ -515,7 +515,7 @@ nsLineLayout::ReflowChild(nsReflowCommand* aReflowCommand)
|
|||||||
|
|
||||||
// Set completion status
|
// Set completion status
|
||||||
mLine->mLastContentOffset = mKidIndex;
|
mLine->mLastContentOffset = mKidIndex;
|
||||||
if (nsIFrame::frComplete == kidReflowStatus) {
|
if (NS_FRAME_IS_COMPLETE(kidReflowStatus)) {
|
||||||
mLine->mLastContentIsComplete = PR_TRUE;
|
mLine->mLastContentIsComplete = PR_TRUE;
|
||||||
if (isBlock ||
|
if (isBlock ||
|
||||||
(NS_LINE_LAYOUT_REFLOW_RESULT_BREAK_AFTER == mReflowResult)) {
|
(NS_LINE_LAYOUT_REFLOW_RESULT_BREAK_AFTER == mReflowResult)) {
|
||||||
|
|||||||
@@ -60,13 +60,13 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aCX,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aCX,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
void GetBulletSize(nsIPresContext* aCX,
|
void GetBulletSize(nsIPresContext* aCX,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
@@ -140,7 +140,7 @@ NS_METHOD BulletFrame::ResizeReflow(nsIPresContext* aCX,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
GetBulletSize(aCX, aDesiredSize, aMaxSize);
|
GetBulletSize(aCX, aDesiredSize, aMaxSize);
|
||||||
if (nsnull != aMaxElementSize) {
|
if (nsnull != aMaxElementSize) {
|
||||||
@@ -153,7 +153,7 @@ NS_METHOD BulletFrame::ResizeReflow(nsIPresContext* aCX,
|
|||||||
// the bullet must be mapping the second content object instead of
|
// the bullet must be mapping the second content object instead of
|
||||||
// mapping the first content object.
|
// mapping the first content object.
|
||||||
mLastContentIsComplete = PR_FALSE;
|
mLastContentIsComplete = PR_FALSE;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,14 +161,14 @@ NS_METHOD BulletFrame::IncrementalReflow(nsIPresContext* aCX,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
// XXX Unless the reflow command is a style change, we should
|
// XXX Unless the reflow command is a style change, we should
|
||||||
// just return the current size, otherwise we should invoke
|
// just return the current size, otherwise we should invoke
|
||||||
// GetBulletSize
|
// GetBulletSize
|
||||||
GetBulletSize(aCX, aDesiredSize, aMaxSize);
|
GetBulletSize(aCX, aDesiredSize, aMaxSize);
|
||||||
|
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -574,7 +574,7 @@ NS_METHOD nsListItemFrame::ResizeReflow(nsIPresContext* aCX,
|
|||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
PRBool insideBullet = PR_FALSE;
|
PRBool insideBullet = PR_FALSE;
|
||||||
|
|
||||||
@@ -639,9 +639,9 @@ NS_METHOD nsListItemFrame::IncrementalReflow(nsIPresContext* aCX,
|
|||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
// XXX
|
// XXX
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public:
|
|||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsRect& aDesiredRect,
|
nsRect& aDesiredRect,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aCX,
|
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aCX,
|
||||||
nsIFrame* aParent,
|
nsIFrame* aParent,
|
||||||
nsIStyleContext* aStyleContext,
|
nsIStyleContext* aStyleContext,
|
||||||
|
|||||||
@@ -58,12 +58,12 @@ NS_METHOD PageFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
PreReflowCheck();
|
PreReflowCheck();
|
||||||
#endif
|
#endif
|
||||||
aStatus = frComplete; // initialize out parameter
|
aStatus = NS_FRAME_COMPLETE; // initialize out parameter
|
||||||
|
|
||||||
// Do we have any children?
|
// Do we have any children?
|
||||||
if (nsnull == mFirstChild) {
|
if (nsnull == mFirstChild) {
|
||||||
@@ -95,7 +95,7 @@ NS_METHOD PageFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
// Get the child's desired size
|
// Get the child's desired size
|
||||||
aStatus = ReflowChild(mFirstChild, aPresContext, aDesiredSize, aMaxSize,
|
aStatus = ReflowChild(mFirstChild, aPresContext, aDesiredSize, aMaxSize,
|
||||||
aMaxElementSize);
|
aMaxElementSize);
|
||||||
mLastContentIsComplete = PRBool(aStatus == frComplete);
|
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(aStatus);
|
||||||
|
|
||||||
// Make sure the child is at least as tall as our max size (the containing window)
|
// Make sure the child is at least as tall as our max size (the containing window)
|
||||||
if (aDesiredSize.height < aMaxSize.height) {
|
if (aDesiredSize.height < aMaxSize.height) {
|
||||||
@@ -107,7 +107,7 @@ NS_METHOD PageFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
mFirstChild->SetRect(rect);
|
mFirstChild->SetRect(rect);
|
||||||
|
|
||||||
// Is the frame complete?
|
// Is the frame complete?
|
||||||
if (frComplete == aStatus) {
|
if (NS_FRAME_IS_COMPLETE(aStatus)) {
|
||||||
nsIFrame* childNextInFlow;
|
nsIFrame* childNextInFlow;
|
||||||
|
|
||||||
mFirstChild->GetNextInFlow(childNextInFlow);
|
mFirstChild->GetNextInFlow(childNextInFlow);
|
||||||
@@ -130,7 +130,7 @@ NS_METHOD PageFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
// We don't expect the target of the reflow command to be page frame
|
// We don't expect the target of the reflow command to be page frame
|
||||||
NS_ASSERTION(aReflowCommand.GetTarget() != this, "page frame is reflow command target");
|
NS_ASSERTION(aReflowCommand.GetTarget() != this, "page frame is reflow command target");
|
||||||
|
|||||||
@@ -29,13 +29,13 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aCX,
|
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aCX,
|
||||||
nsIFrame* aParent,
|
nsIFrame* aParent,
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ NS_METHOD PlaceholderFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
// Get the floater container in which we're inserted
|
// Get the floater container in which we're inserted
|
||||||
nsIFloaterContainer* container = nsnull;
|
nsIFloaterContainer* container = nsnull;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||||
NS_IMETHOD ListTag(FILE* out = stdout) const;
|
NS_IMETHOD ListTag(FILE* out = stdout) const;
|
||||||
|
|
||||||
|
|||||||
@@ -43,13 +43,13 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
|
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
|
||||||
nsGUIEvent* aEvent,
|
nsGUIEvent* aEvent,
|
||||||
@@ -65,13 +65,13 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||||
nsIRenderingContext& aRenderingContext,
|
nsIRenderingContext& aRenderingContext,
|
||||||
@@ -92,12 +92,12 @@ NS_METHOD RootFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
PreReflowCheck();
|
PreReflowCheck();
|
||||||
#endif
|
#endif
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
// Do we have any children?
|
// Do we have any children?
|
||||||
if (nsnull == mFirstChild) {
|
if (nsnull == mFirstChild) {
|
||||||
@@ -139,7 +139,7 @@ NS_METHOD RootFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
// We don't expect the target of the reflow command to be the root frame
|
// We don't expect the target of the reflow command to be the root frame
|
||||||
NS_ASSERTION(aReflowCommand.GetTarget() != this, "root frame is reflow command target");
|
NS_ASSERTION(aReflowCommand.GetTarget() != this, "root frame is reflow command target");
|
||||||
@@ -291,12 +291,12 @@ NS_METHOD RootContentFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
PreReflowCheck();
|
PreReflowCheck();
|
||||||
#endif
|
#endif
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
// Do we have any children?
|
// Do we have any children?
|
||||||
if (nsnull == mFirstChild) {
|
if (nsnull == mFirstChild) {
|
||||||
@@ -315,8 +315,8 @@ NS_METHOD RootContentFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
// Tile the pages vertically
|
// Tile the pages vertically
|
||||||
for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) {
|
for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) {
|
||||||
// Reflow the page
|
// Reflow the page
|
||||||
ReflowStatus status = ReflowChild(kidFrame, aPresContext, kidSize,
|
nsReflowStatus status = ReflowChild(kidFrame, aPresContext, kidSize,
|
||||||
pageSize, aMaxElementSize);
|
pageSize, aMaxElementSize);
|
||||||
|
|
||||||
// Place and size the page. If the page is narrower than our max width then
|
// Place and size the page. If the page is narrower than our max width then
|
||||||
// center it horizontally
|
// center it horizontally
|
||||||
@@ -333,7 +333,7 @@ NS_METHOD RootContentFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
kidFrame->GetNextInFlow(kidNextInFlow);
|
kidFrame->GetNextInFlow(kidNextInFlow);
|
||||||
if (frComplete == status) {
|
if (NS_FRAME_IS_COMPLETE(status)) {
|
||||||
NS_ASSERTION(nsnull == kidNextInFlow, "bad child flow list");
|
NS_ASSERTION(nsnull == kidNextInFlow, "bad child flow list");
|
||||||
} else if (nsnull == kidNextInFlow) {
|
} else if (nsnull == kidNextInFlow) {
|
||||||
// The page isn't complete and it doesn't have a next-in-flow so
|
// The page isn't complete and it doesn't have a next-in-flow so
|
||||||
@@ -373,7 +373,7 @@ NS_METHOD RootContentFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
// desired size
|
// desired size
|
||||||
aStatus = ReflowChild(mFirstChild, aPresContext, aDesiredSize, maxSize,
|
aStatus = ReflowChild(mFirstChild, aPresContext, aDesiredSize, maxSize,
|
||||||
aMaxElementSize);
|
aMaxElementSize);
|
||||||
NS_ASSERTION(frComplete == aStatus, "bad status");
|
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
|
||||||
|
|
||||||
// Place and size the child. Make sure the child is at least as
|
// Place and size the child. Make sure the child is at least as
|
||||||
// tall as our max size (the containing window)
|
// tall as our max size (the containing window)
|
||||||
@@ -398,7 +398,7 @@ NS_METHOD RootContentFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
// We don't expect the target of the reflow command to be the root
|
// We don't expect the target of the reflow command to be the root
|
||||||
// content frame
|
// content frame
|
||||||
|
|||||||
@@ -38,10 +38,11 @@ class SpacerFrame : public nsFrame
|
|||||||
public:
|
public:
|
||||||
SpacerFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
SpacerFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||||
|
|
||||||
virtual ReflowStatus ResizeReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize);
|
nsSize* aMaxElementSize,
|
||||||
|
nsReflowStatus& aStatus);
|
||||||
protected:
|
protected:
|
||||||
virtual ~SpacerFrame();
|
virtual ~SpacerFrame();
|
||||||
};
|
};
|
||||||
@@ -80,11 +81,11 @@ SpacerFrame::~SpacerFrame()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::ReflowStatus
|
NS_METHOD SpacerFrame::ResizeReflow(nsIPresContext* aPresContext,
|
||||||
SpacerFrame::ResizeReflow(nsIPresContext* aPresContext,
|
nsReflowMetrics& aDesiredSize,
|
||||||
nsReflowMetrics& aDesiredSize,
|
const nsSize& aMaxSize,
|
||||||
const nsSize& aMaxSize,
|
nsSize* aMaxElementSize,
|
||||||
nsSize* aMaxElementSize)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
// Get cached state for containing block frame
|
// Get cached state for containing block frame
|
||||||
nsBlockReflowState* state = nsnull;
|
nsBlockReflowState* state = nsnull;
|
||||||
@@ -115,7 +116,8 @@ SpacerFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
if (nsnull == state) {
|
if (nsnull == state) {
|
||||||
// We don't do anything unless we are in a block container somewhere
|
// We don't do anything unless we are in a block container somewhere
|
||||||
return frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
nscoord width = 0;
|
nscoord width = 0;
|
||||||
@@ -188,7 +190,8 @@ SpacerFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD GetReflowMetrics(nsIPresContext* aPresContext,
|
NS_IMETHOD GetReflowMetrics(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aMetrics);
|
nsReflowMetrics& aMetrics);
|
||||||
@@ -175,22 +175,22 @@ protected:
|
|||||||
const nsRect& aDirtyRect,
|
const nsRect& aDirtyRect,
|
||||||
nscoord dx, nscoord dy);
|
nscoord dx, nscoord dy);
|
||||||
|
|
||||||
ReflowStatus ReflowPre(nsIPresContext* aCX,
|
nsReflowStatus ReflowPre(nsIPresContext* aCX,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
nsStyleFont& aFont,
|
nsStyleFont& aFont,
|
||||||
PRInt32 aStartingOffset,
|
PRInt32 aStartingOffset,
|
||||||
nsLineLayout* aLineState);
|
nsLineLayout* aLineState);
|
||||||
|
|
||||||
ReflowStatus ReflowNormal(nsIPresContext* aCX,
|
nsReflowStatus ReflowNormal(nsIPresContext* aCX,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
nsStyleFont& aFont,
|
nsStyleFont& aFont,
|
||||||
nsStyleText& aTextStyle,
|
nsStyleText& aTextStyle,
|
||||||
PRInt32 aStartingOffset,
|
PRInt32 aStartingOffset,
|
||||||
nsLineLayout* aLineState);
|
nsLineLayout* aLineState);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PRInt32 mContentOffset;
|
PRInt32 mContentOffset;
|
||||||
@@ -733,7 +733,7 @@ NS_METHOD TextFrame::ResizeReflow(nsIPresContext* aCX,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
#ifdef NOISY
|
#ifdef NOISY
|
||||||
ListTag(stdout);
|
ListTag(stdout);
|
||||||
@@ -800,7 +800,7 @@ NS_METHOD TextFrame::ResizeReflow(nsIPresContext* aCX,
|
|||||||
#ifdef NOISY
|
#ifdef NOISY
|
||||||
ListTag(stdout);
|
ListTag(stdout);
|
||||||
printf(": reflow %scomplete [flags=%x]\n",
|
printf(": reflow %scomplete [flags=%x]\n",
|
||||||
((aStatus == frComplete) ? "" : "not "), mFlags);
|
(NS_FRAME_IS_COMPLETE(aStatus) ? "" : "not "), mFlags);
|
||||||
#endif
|
#endif
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@@ -808,7 +808,7 @@ NS_METHOD TextFrame::ResizeReflow(nsIPresContext* aCX,
|
|||||||
// Reflow normal text (stuff that doesn't have to deal with horizontal
|
// Reflow normal text (stuff that doesn't have to deal with horizontal
|
||||||
// tabs). Normal text reflow may or may not wrap depending on the
|
// tabs). Normal text reflow may or may not wrap depending on the
|
||||||
// "whiteSpace" style property.
|
// "whiteSpace" style property.
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
TextFrame::ReflowNormal(nsIPresContext* aCX,
|
TextFrame::ReflowNormal(nsIPresContext* aCX,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
@@ -953,7 +953,7 @@ TextFrame::ReflowNormal(nsIPresContext* aCX,
|
|||||||
aMaxElementSize->height = 0;
|
aMaxElementSize->height = 0;
|
||||||
}
|
}
|
||||||
NS_RELEASE(fm);
|
NS_RELEASE(fm);
|
||||||
return frComplete;
|
return NS_FRAME_COMPLETE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -967,10 +967,10 @@ TextFrame::ReflowNormal(nsIPresContext* aCX,
|
|||||||
aMaxElementSize->height = fm->GetHeight();
|
aMaxElementSize->height = fm->GetHeight();
|
||||||
}
|
}
|
||||||
NS_RELEASE(fm);
|
NS_RELEASE(fm);
|
||||||
return (cp == end) ? frComplete : frNotComplete;
|
return (cp == end) ? NS_FRAME_COMPLETE : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
TextFrame::ReflowPre(nsIPresContext* aCX,
|
TextFrame::ReflowPre(nsIPresContext* aCX,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
@@ -1044,7 +1044,7 @@ TextFrame::ReflowPre(nsIPresContext* aCX,
|
|||||||
aMaxElementSize->height = aDesiredSize.height;
|
aMaxElementSize->height = aDesiredSize.height;
|
||||||
}
|
}
|
||||||
NS_RELEASE(fm);
|
NS_RELEASE(fm);
|
||||||
return (cp == end) ? frComplete : frNotComplete;
|
return (cp == end) ? NS_FRAME_COMPLETE : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define NUM_WORDS 20
|
#define NUM_WORDS 20
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView* aView);
|
virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView* aView);
|
||||||
|
|
||||||
@@ -389,7 +389,7 @@ nsInputButtonFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
if ((kButtonTag_Input == GetButtonTagType()) &&
|
if ((kButtonTag_Input == GetButtonTagType()) &&
|
||||||
(kButton_Image == GetButtonType())) {
|
(kButton_Image == GetButtonType())) {
|
||||||
@@ -400,7 +400,7 @@ nsInputButtonFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
aMaxElementSize->width = aDesiredSize.width;
|
aMaxElementSize->width = aDesiredSize.width;
|
||||||
aMaxElementSize->height = aDesiredSize.height;
|
aMaxElementSize->height = aDesiredSize.height;
|
||||||
}
|
}
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ nsInputFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
nsIView* view = nsnull;
|
nsIView* view = nsnull;
|
||||||
GetView(view);
|
GetView(view);
|
||||||
@@ -230,7 +230,7 @@ nsInputFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
(void **)&view);
|
(void **)&view);
|
||||||
if (NS_OK != result) {
|
if (NS_OK != result) {
|
||||||
NS_ASSERTION(0, "Could not create view for button");
|
NS_ASSERTION(0, "Could not create view for button");
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
nsIPresShell *presShell = aPresContext->GetShell(); // need to release
|
nsIPresShell *presShell = aPresContext->GetShell(); // need to release
|
||||||
@@ -258,7 +258,7 @@ nsInputFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
}
|
}
|
||||||
if (NS_OK != result) {
|
if (NS_OK != result) {
|
||||||
NS_ASSERTION(0, "widget initialization failed");
|
NS_ASSERTION(0, "widget initialization failed");
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -300,7 +300,7 @@ nsInputFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
aMaxElementSize->height = aDesiredSize.height;
|
aMaxElementSize->height = aDesiredSize.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
// new behavior
|
// new behavior
|
||||||
|
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ NS_METHOD nsTableCaptionFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
NS_PRECONDITION(nsnull!=aPresContext, "bad arg");
|
NS_PRECONDITION(nsnull!=aPresContext, "bad arg");
|
||||||
|
|
||||||
@@ -193,7 +193,7 @@ NS_METHOD nsTableCaptionFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
PreReflowCheck();
|
PreReflowCheck();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
if (gsDebug==PR_TRUE)
|
if (gsDebug==PR_TRUE)
|
||||||
printf("nsTableCaptionFrame::ResizeReflow %p: maxSize=%d,%d\n",
|
printf("nsTableCaptionFrame::ResizeReflow %p: maxSize=%d,%d\n",
|
||||||
this, aMaxSize.width, aMaxSize.height);
|
this, aMaxSize.width, aMaxSize.height);
|
||||||
@@ -244,13 +244,13 @@ NS_METHOD nsTableCaptionFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
if (nsnull!=pMaxElementSize)
|
if (nsnull!=pMaxElementSize)
|
||||||
printf(" nsTableCaptionFrame::ResizeReflow: child returned %s with desiredSize=%d,%d,\
|
printf(" nsTableCaptionFrame::ResizeReflow: child returned %s with desiredSize=%d,%d,\
|
||||||
and maxElementSize=%d,%d\n",
|
and maxElementSize=%d,%d\n",
|
||||||
aStatus==frComplete?"Complete":"Not Complete",
|
NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete",
|
||||||
kidSize.width, kidSize.height,
|
kidSize.width, kidSize.height,
|
||||||
pMaxElementSize->width, pMaxElementSize->height);
|
pMaxElementSize->width, pMaxElementSize->height);
|
||||||
else
|
else
|
||||||
printf(" nsTableCaptionFrame::ResizeReflow: child returned %s with desiredSize=%d,%d,\
|
printf(" nsTableCaptionFrame::ResizeReflow: child returned %s with desiredSize=%d,%d,\
|
||||||
and maxElementSize=nsnull\n",
|
and maxElementSize=nsnull\n",
|
||||||
aStatus==frComplete?"Complete":"Not Complete",
|
NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete",
|
||||||
kidSize.width, kidSize.height);
|
kidSize.width, kidSize.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -264,7 +264,7 @@ NS_METHOD nsTableCaptionFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
kidSize.width, kidSize.height));
|
kidSize.width, kidSize.height));
|
||||||
|
|
||||||
|
|
||||||
if (frNotComplete == aStatus) {
|
if (NS_FRAME_IS_NOT_COMPLETE(aStatus)) {
|
||||||
// If the child didn't finish layout then it means that it used
|
// If the child didn't finish layout then it means that it used
|
||||||
// up all of our available space (or needs us to split).
|
// up all of our available space (or needs us to split).
|
||||||
mLastContentIsComplete = PR_FALSE;
|
mLastContentIsComplete = PR_FALSE;
|
||||||
@@ -300,12 +300,12 @@ NS_METHOD nsTableCaptionFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
{
|
{
|
||||||
if (nsnull!=aMaxElementSize)
|
if (nsnull!=aMaxElementSize)
|
||||||
printf("nsTableCaptionFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=%d,%d\n",
|
printf("nsTableCaptionFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=%d,%d\n",
|
||||||
aStatus==frComplete?"Complete":"Not Complete",
|
NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete",
|
||||||
aDesiredSize.width, aDesiredSize.height,
|
aDesiredSize.width, aDesiredSize.height,
|
||||||
aMaxElementSize->width, aMaxElementSize->height);
|
aMaxElementSize->width, aMaxElementSize->height);
|
||||||
else
|
else
|
||||||
printf("nsTableCaptionFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=NSNULL\n",
|
printf("nsTableCaptionFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=NSNULL\n",
|
||||||
aStatus==frComplete?"Complete":"Not Complete",
|
NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete",
|
||||||
aDesiredSize.width, aDesiredSize.height);
|
aDesiredSize.width, aDesiredSize.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -320,7 +320,7 @@ NS_METHOD nsTableCaptionFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
if (gsDebug == PR_TRUE) printf("nsTableCaptionFrame::IncrementalReflow\n");
|
if (gsDebug == PR_TRUE) printf("nsTableCaptionFrame::IncrementalReflow\n");
|
||||||
// total hack for now, just some hard-coded values
|
// total hack for now, just some hard-coded values
|
||||||
|
|||||||
@@ -43,13 +43,13 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see nsContainerFrame
|
* @see nsContainerFrame
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ NS_METHOD nsTableCellFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
NS_PRECONDITION(nsnull!=aPresContext, "bad arg");
|
NS_PRECONDITION(nsnull!=aPresContext, "bad arg");
|
||||||
|
|
||||||
@@ -216,7 +216,7 @@ NS_METHOD nsTableCellFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
//PreReflowCheck();
|
//PreReflowCheck();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
if (gsDebug==PR_TRUE)
|
if (gsDebug==PR_TRUE)
|
||||||
printf("nsTableCellFrame::ResizeReflow: maxSize=%d,%d\n",
|
printf("nsTableCellFrame::ResizeReflow: maxSize=%d,%d\n",
|
||||||
aMaxSize.width, aMaxSize.height);
|
aMaxSize.width, aMaxSize.height);
|
||||||
@@ -287,7 +287,7 @@ NS_METHOD nsTableCellFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
kidSize.width, kidSize.height));
|
kidSize.width, kidSize.height));
|
||||||
|
|
||||||
|
|
||||||
if (frNotComplete == aStatus) {
|
if (NS_FRAME_IS_NOT_COMPLETE(aStatus)) {
|
||||||
// If the child didn't finish layout then it means that it used
|
// If the child didn't finish layout then it means that it used
|
||||||
// up all of our available space (or needs us to split).
|
// up all of our available space (or needs us to split).
|
||||||
mLastContentIsComplete = PR_FALSE;
|
mLastContentIsComplete = PR_FALSE;
|
||||||
@@ -329,7 +329,7 @@ NS_METHOD nsTableCellFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
if (gsDebug == PR_TRUE) printf("nsTableCellFrame::IncrementalReflow\n");
|
if (gsDebug == PR_TRUE) printf("nsTableCellFrame::IncrementalReflow\n");
|
||||||
// total hack for now, just some hard-coded values
|
// total hack for now, just some hard-coded values
|
||||||
|
|||||||
@@ -43,13 +43,13 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see nsContainerFrame
|
* @see nsContainerFrame
|
||||||
|
|||||||
@@ -49,13 +49,13 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ NS_METHOD nsTableColFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(nsnull!=aPresContext, "bad arg");
|
NS_ASSERTION(nsnull!=aPresContext, "bad arg");
|
||||||
if (gsDebug==PR_TRUE) printf("nsTableoupFrame::ResizeReflow\n");
|
if (gsDebug==PR_TRUE) printf("nsTableoupFrame::ResizeReflow\n");
|
||||||
@@ -101,7 +101,7 @@ NS_METHOD nsTableColFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
aMaxElementSize->width=0;
|
aMaxElementSize->width=0;
|
||||||
aMaxElementSize->height=0;
|
aMaxElementSize->height=0;
|
||||||
}
|
}
|
||||||
aStatus = nsIFrame::frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,13 +109,13 @@ NS_METHOD nsTableColFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(nsnull!=aPresContext, "bad arg");
|
NS_ASSERTION(nsnull!=aPresContext, "bad arg");
|
||||||
if (gsDebug==PR_TRUE) printf("nsTableColFrame::IncrementalReflow\n");
|
if (gsDebug==PR_TRUE) printf("nsTableColFrame::IncrementalReflow\n");
|
||||||
aDesiredSize.width=0;
|
aDesiredSize.width=0;
|
||||||
aDesiredSize.height=0;
|
aDesiredSize.height=0;
|
||||||
aStatus = nsIFrame::frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ nsTableColGroupFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(nsnull!=aPresContext, "bad arg");
|
NS_ASSERTION(nsnull!=aPresContext, "bad arg");
|
||||||
if (gsDebug==PR_TRUE) printf("nsTableColGroupFrame::ResizeReflow\n");
|
if (gsDebug==PR_TRUE) printf("nsTableColGroupFrame::ResizeReflow\n");
|
||||||
@@ -60,7 +60,7 @@ nsTableColGroupFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
aMaxElementSize->width=0;
|
aMaxElementSize->width=0;
|
||||||
aMaxElementSize->height=0;
|
aMaxElementSize->height=0;
|
||||||
}
|
}
|
||||||
aStatus = nsIFrame::frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ nsTableColGroupFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(nsnull!=aPresContext, "bad arg");
|
NS_ASSERTION(nsnull!=aPresContext, "bad arg");
|
||||||
if (gsDebug==PR_TRUE) printf("nsTableColGroupFrame::IncrementalReflow\n");
|
if (gsDebug==PR_TRUE) printf("nsTableColGroupFrame::IncrementalReflow\n");
|
||||||
|
|||||||
@@ -43,13 +43,13 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|||||||
@@ -486,7 +486,7 @@ NS_METHOD nsTableFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
NS_PRECONDITION(nsnull != aPresContext, "null arg");
|
NS_PRECONDITION(nsnull != aPresContext, "null arg");
|
||||||
if (gsDebug==PR_TRUE)
|
if (gsDebug==PR_TRUE)
|
||||||
@@ -500,7 +500,7 @@ NS_METHOD nsTableFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
PreReflowCheck();
|
PreReflowCheck();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
PRIntervalTime startTime;
|
PRIntervalTime startTime;
|
||||||
if (gsTiming) {
|
if (gsTiming) {
|
||||||
@@ -558,10 +558,10 @@ NS_METHOD nsTableFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
* NOTE: should never get called on a continuing frame! All cached pass1 state
|
* NOTE: should never get called on a continuing frame! All cached pass1 state
|
||||||
* is stored in the inner table first-in-flow.
|
* is stored in the inner table first-in-flow.
|
||||||
*/
|
*/
|
||||||
nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresContext,
|
nsReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize)
|
nsSize* aMaxElementSize)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(nsnull!=aPresContext, "bad pres context param");
|
NS_ASSERTION(nsnull!=aPresContext, "bad pres context param");
|
||||||
NS_ASSERTION(nsnull==mPrevInFlow, "illegal call, cannot call pass 1 on a continuing frame.");
|
NS_ASSERTION(nsnull==mPrevInFlow, "illegal call, cannot call pass 1 on a continuing frame.");
|
||||||
@@ -569,7 +569,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont
|
|||||||
if (gsDebug==PR_TRUE) printf("nsTableFrame::ResizeReflow Pass1: maxSize=%d,%d\n",
|
if (gsDebug==PR_TRUE) printf("nsTableFrame::ResizeReflow Pass1: maxSize=%d,%d\n",
|
||||||
aMaxSize.width, aMaxSize.height);
|
aMaxSize.width, aMaxSize.height);
|
||||||
if (PR_TRUE==gsDebug) printf ("*** tableframe reflow pass1\t\t%d\n", this);
|
if (PR_TRUE==gsDebug) printf ("*** tableframe reflow pass1\t\t%d\n", this);
|
||||||
ReflowStatus result = frComplete;
|
nsReflowStatus result = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
mChildCount = 0;
|
mChildCount = 0;
|
||||||
mFirstContentOffset = mLastContentOffset = 0;
|
mFirstContentOffset = mLastContentOffset = 0;
|
||||||
@@ -609,7 +609,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
nsIContentPtr kid = c->ChildAt(kidIndex); // kid: REFCNT++
|
nsIContentPtr kid = c->ChildAt(kidIndex); // kid: REFCNT++
|
||||||
if (kid.IsNull()) {
|
if (kid.IsNull()) {
|
||||||
result = frComplete;
|
result = NS_FRAME_COMPLETE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -684,7 +684,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont
|
|||||||
prevKidFrame = kidFrame;
|
prevKidFrame = kidFrame;
|
||||||
mChildCount++;
|
mChildCount++;
|
||||||
|
|
||||||
if (frNotComplete == result) {
|
if (NS_FRAME_IS_NOT_COMPLETE(result)) {
|
||||||
// If the child didn't finish layout then it means that it used
|
// If the child didn't finish layout then it means that it used
|
||||||
// up all of our available space (or needs us to split).
|
// up all of our available space (or needs us to split).
|
||||||
mLastContentIsComplete = PR_FALSE;
|
mLastContentIsComplete = PR_FALSE;
|
||||||
@@ -693,7 +693,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont
|
|||||||
}
|
}
|
||||||
contentOffset++;
|
contentOffset++;
|
||||||
kidIndex++;
|
kidIndex++;
|
||||||
if (frNotComplete == result) {
|
if (NS_FRAME_IS_NOT_COMPLETE(result)) {
|
||||||
// If the child didn't finish layout then it means that it used
|
// If the child didn't finish layout then it means that it used
|
||||||
// up all of our available space (or needs us to split).
|
// up all of our available space (or needs us to split).
|
||||||
mLastContentIsComplete = PR_FALSE;
|
mLastContentIsComplete = PR_FALSE;
|
||||||
@@ -715,19 +715,19 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont
|
|||||||
|
|
||||||
/** the second of 2 reflow passes
|
/** the second of 2 reflow passes
|
||||||
*/
|
*/
|
||||||
nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresContext,
|
nsReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
PRInt32 aMinCaptionWidth,
|
PRInt32 aMinCaptionWidth,
|
||||||
PRInt32 mMaxCaptionWidth)
|
PRInt32 mMaxCaptionWidth)
|
||||||
{
|
{
|
||||||
if (PR_TRUE==gsDebug) printf ("***tableframe reflow pass2\t\t%d\n", this);
|
if (PR_TRUE==gsDebug) printf ("***tableframe reflow pass2\t\t%d\n", this);
|
||||||
if (gsDebug==PR_TRUE)
|
if (gsDebug==PR_TRUE)
|
||||||
printf("nsTableFrame::ResizeReflow Pass2: maxSize=%d,%d\n",
|
printf("nsTableFrame::ResizeReflow Pass2: maxSize=%d,%d\n",
|
||||||
aMaxSize.width, aMaxSize.height);
|
aMaxSize.width, aMaxSize.height);
|
||||||
|
|
||||||
ReflowStatus result = frComplete;
|
nsReflowStatus result = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
// now that we've computed the column width information, reflow all children
|
// now that we've computed the column width information, reflow all children
|
||||||
nsIContent* c = mContent;
|
nsIContent* c = mContent;
|
||||||
@@ -749,7 +749,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresCont
|
|||||||
}
|
}
|
||||||
|
|
||||||
PRBool reflowMappedOK = PR_TRUE;
|
PRBool reflowMappedOK = PR_TRUE;
|
||||||
ReflowStatus status = frComplete;
|
nsReflowStatus status = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
// Check for an overflow list
|
// Check for an overflow list
|
||||||
MoveOverflowToChildList();
|
MoveOverflowToChildList();
|
||||||
@@ -762,7 +762,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresCont
|
|||||||
if (nsnull != mFirstChild) {
|
if (nsnull != mFirstChild) {
|
||||||
reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize);
|
reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize);
|
||||||
if (PR_FALSE == reflowMappedOK) {
|
if (PR_FALSE == reflowMappedOK) {
|
||||||
status = frNotComplete;
|
status = 0; // not complete
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -772,7 +772,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresCont
|
|||||||
if (state.availSize.height <= 0) {
|
if (state.availSize.height <= 0) {
|
||||||
// No space left. Don't try to pull-up children or reflow unmapped
|
// No space left. Don't try to pull-up children or reflow unmapped
|
||||||
if (NextChildOffset() < mContent->ChildCount()) {
|
if (NextChildOffset() < mContent->ChildCount()) {
|
||||||
status = frNotComplete;
|
status = 0; // not complete
|
||||||
}
|
}
|
||||||
} else if (NextChildOffset() < mContent->ChildCount()) {
|
} else if (NextChildOffset() < mContent->ChildCount()) {
|
||||||
// Try and pull-up some children from a next-in-flow
|
// Try and pull-up some children from a next-in-flow
|
||||||
@@ -784,14 +784,14 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresCont
|
|||||||
} else {
|
} else {
|
||||||
// We were unable to pull-up all the existing frames from the
|
// We were unable to pull-up all the existing frames from the
|
||||||
// next in flow
|
// next in flow
|
||||||
status = frNotComplete;
|
status = 0; // not complete
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return our size and our status
|
// Return our size and our status
|
||||||
|
|
||||||
if (frComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// Don't forget to add in the bottom margin from our last child.
|
// Don't forget to add in the bottom margin from our last child.
|
||||||
// Only add it in if there's room for it.
|
// Only add it in if there's room for it.
|
||||||
nscoord margin = state.prevMaxPosBottomMargin -
|
nscoord margin = state.prevMaxPosBottomMargin -
|
||||||
@@ -978,9 +978,9 @@ PRBool nsTableFrame::ReflowMappedChildren( nsIPresContext* aPresContext,
|
|||||||
PRBool result = PR_TRUE;
|
PRBool result = PR_TRUE;
|
||||||
|
|
||||||
for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) {
|
for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) {
|
||||||
nsSize kidAvailSize(aState.availSize);
|
nsSize kidAvailSize(aState.availSize);
|
||||||
nsReflowMetrics desiredSize;
|
nsReflowMetrics desiredSize;
|
||||||
nsIFrame::ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
// Get top margin for this kid
|
// Get top margin for this kid
|
||||||
nsIContentPtr kid;
|
nsIContentPtr kid;
|
||||||
@@ -1045,10 +1045,10 @@ PRBool nsTableFrame::ReflowMappedChildren( nsIPresContext* aPresContext,
|
|||||||
prevKidFrame = kidFrame;
|
prevKidFrame = kidFrame;
|
||||||
|
|
||||||
// Update mLastContentIsComplete now that this kid fits
|
// Update mLastContentIsComplete now that this kid fits
|
||||||
mLastContentIsComplete = PRBool(status == frComplete);
|
mLastContentIsComplete = PRBool(NS_FRAME_IS_COMPLETE(status));
|
||||||
|
|
||||||
// Special handling for incomplete children
|
// Special handling for incomplete children
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
kidFrame->GetNextInFlow(kidNextInFlow);
|
kidFrame->GetNextInFlow(kidNextInFlow);
|
||||||
@@ -1189,7 +1189,7 @@ PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
while (nsnull != nextInFlow) {
|
while (nsnull != nextInFlow) {
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
// Get the next child
|
// Get the next child
|
||||||
nsIFrame* kidFrame = nextInFlow->mFirstChild;
|
nsIFrame* kidFrame = nextInFlow->mFirstChild;
|
||||||
@@ -1277,8 +1277,8 @@ PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
prevLastContentIsComplete = mLastContentIsComplete;
|
prevLastContentIsComplete = mLastContentIsComplete;
|
||||||
|
|
||||||
// Is the child we just pulled up complete?
|
// Is the child we just pulled up complete?
|
||||||
mLastContentIsComplete = PRBool(status == frComplete);
|
mLastContentIsComplete = PRBool(NS_FRAME_IS_COMPLETE(status));
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// No the child isn't complete
|
// No the child isn't complete
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
@@ -1360,7 +1360,7 @@ PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
* @return frComplete if all content has been mapped and frNotComplete
|
* @return frComplete if all content has been mapped and frNotComplete
|
||||||
* if we should be continued
|
* if we should be continued
|
||||||
*/
|
*/
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
||||||
InnerTableReflowState& aState,
|
InnerTableReflowState& aState,
|
||||||
nsSize* aMaxElementSize)
|
nsSize* aMaxElementSize)
|
||||||
@@ -1369,7 +1369,7 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
VerifyLastIsComplete();
|
VerifyLastIsComplete();
|
||||||
#endif
|
#endif
|
||||||
nsIFrame* kidPrevInFlow = nsnull;
|
nsIFrame* kidPrevInFlow = nsnull;
|
||||||
ReflowStatus result = frNotComplete;
|
nsReflowStatus result = 0; // not complete
|
||||||
|
|
||||||
// If we have no children and we have a prev-in-flow then we need to pick
|
// If we have no children and we have a prev-in-flow then we need to pick
|
||||||
// up where it left off. If we have children, e.g. we're being resized, then
|
// up where it left off. If we have children, e.g. we're being resized, then
|
||||||
@@ -1397,7 +1397,7 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
// Get the next content object
|
// Get the next content object
|
||||||
nsIContentPtr kid = mContent->ChildAt(kidIndex);
|
nsIContentPtr kid = mContent->ChildAt(kidIndex);
|
||||||
if (kid.IsNull()) {
|
if (kid.IsNull()) {
|
||||||
result = frComplete;
|
result = NS_FRAME_COMPLETE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1429,7 +1429,7 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
// Try to reflow the child into the available space. It might not
|
// Try to reflow the child into the available space. It might not
|
||||||
// fit or might need continuing.
|
// fit or might need continuing.
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
ReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize,
|
nsReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize,
|
||||||
aState.availSize, pKidMaxElementSize);
|
aState.availSize, pKidMaxElementSize);
|
||||||
|
|
||||||
// Did the child fit?
|
// Did the child fit?
|
||||||
@@ -1465,7 +1465,7 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
kidIndex++;
|
kidIndex++;
|
||||||
|
|
||||||
// Did the child complete?
|
// Did the child complete?
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// If the child isn't complete then it means that we've used up
|
// If the child isn't complete then it means that we've used up
|
||||||
// all of our available space
|
// all of our available space
|
||||||
mLastContentIsComplete = PR_FALSE;
|
mLastContentIsComplete = PR_FALSE;
|
||||||
@@ -1860,7 +1860,7 @@ NS_METHOD nsTableFrame::IncrementalReflow(nsIPresContext* aCX,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(nsnull != aCX, "bad arg");
|
NS_ASSERTION(nsnull != aCX, "bad arg");
|
||||||
if (gsDebug==PR_TRUE) printf ("nsTableFrame::IncrementalReflow: maxSize=%d,%d\n",
|
if (gsDebug==PR_TRUE) printf ("nsTableFrame::IncrementalReflow: maxSize=%d,%d\n",
|
||||||
@@ -1870,7 +1870,7 @@ NS_METHOD nsTableFrame::IncrementalReflow(nsIPresContext* aCX,
|
|||||||
|
|
||||||
aDesiredSize.width = mRect.width;
|
aDesiredSize.width = mRect.width;
|
||||||
aDesiredSize.height = mRect.height;
|
aDesiredSize.height = mRect.height;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,14 +85,14 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
/** @see nsIFrame::IncrementalReflow */
|
/** @see nsIFrame::IncrementalReflow */
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
/** @see nsContainerFrame::CreateContinuingFrame */
|
/** @see nsContainerFrame::CreateContinuingFrame */
|
||||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||||
@@ -191,10 +191,10 @@ protected:
|
|||||||
*
|
*
|
||||||
* @see ResizeReflow
|
* @see ResizeReflow
|
||||||
*/
|
*/
|
||||||
virtual ReflowStatus ResizeReflowPass1(nsIPresContext* aPresContext,
|
virtual nsReflowStatus ResizeReflowPass1(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize);
|
nsSize* aMaxElementSize);
|
||||||
|
|
||||||
/** second pass of ResizeReflow.
|
/** second pass of ResizeReflow.
|
||||||
* lays out all table content with aMaxSize(computed_table_width, given_table_height)
|
* lays out all table content with aMaxSize(computed_table_width, given_table_height)
|
||||||
@@ -207,12 +207,12 @@ protected:
|
|||||||
* @see ResizeReflow
|
* @see ResizeReflow
|
||||||
* @see NeedsReflow
|
* @see NeedsReflow
|
||||||
*/
|
*/
|
||||||
virtual ReflowStatus ResizeReflowPass2(nsIPresContext* aPresContext,
|
virtual nsReflowStatus ResizeReflowPass2(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
PRInt32 aMinCaptionWidth,
|
PRInt32 aMinCaptionWidth,
|
||||||
PRInt32 mMaxCaptionWidth);
|
PRInt32 mMaxCaptionWidth);
|
||||||
|
|
||||||
nscoord GetTopMarginFor(nsIPresContext* aCX,
|
nscoord GetTopMarginFor(nsIPresContext* aCX,
|
||||||
InnerTableReflowState& aState,
|
InnerTableReflowState& aState,
|
||||||
@@ -256,9 +256,9 @@ protected:
|
|||||||
* @return frComplete if all content has been mapped and frNotComplete
|
* @return frComplete if all content has been mapped and frNotComplete
|
||||||
* if we should be continued
|
* if we should be continued
|
||||||
*/
|
*/
|
||||||
ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
nsReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
||||||
InnerTableReflowState& aState,
|
InnerTableReflowState& aState,
|
||||||
nsSize* aMaxElementSize);
|
nsSize* aMaxElementSize);
|
||||||
|
|
||||||
|
|
||||||
/** assign widths for each column, taking into account the table content, the effective style,
|
/** assign widths for each column, taking into account the table content, the effective style,
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
if (PR_TRUE==gsDebug)
|
if (PR_TRUE==gsDebug)
|
||||||
printf ("***table outer frame reflow \t\t%p\n", this);
|
printf ("***table outer frame reflow \t\t%p\n", this);
|
||||||
@@ -187,7 +187,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
PRBool reflowMappedOK = PR_TRUE;
|
PRBool reflowMappedOK = PR_TRUE;
|
||||||
|
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
nsSize innerTableMaxElementSize(0,0);
|
nsSize innerTableMaxElementSize(0,0);
|
||||||
|
|
||||||
// Set up our kids. They're already present, on an overflow list,
|
// Set up our kids. They're already present, on an overflow list,
|
||||||
@@ -204,7 +204,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
NS_ASSERTION(nsnull!=mInnerTableFrame, "no mInnerTableFrame");
|
NS_ASSERTION(nsnull!=mInnerTableFrame, "no mInnerTableFrame");
|
||||||
if (nsnull==mFirstChild || nsnull==mInnerTableFrame) {
|
if (nsnull==mFirstChild || nsnull==mInnerTableFrame) {
|
||||||
//ERROR!
|
//ERROR!
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,7 +260,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
if (nsnull != mFirstChild) {
|
if (nsnull != mFirstChild) {
|
||||||
reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize);
|
reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize);
|
||||||
if (PR_FALSE == reflowMappedOK) {
|
if (PR_FALSE == reflowMappedOK) {
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
if (state.availSize.height <= 0) {
|
if (state.availSize.height <= 0) {
|
||||||
// No space left. Don't try to pull-up children or reflow unmapped
|
// No space left. Don't try to pull-up children or reflow unmapped
|
||||||
if (NextChildOffset() < mContent->ChildCount()) {
|
if (NextChildOffset() < mContent->ChildCount()) {
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
} else if (NextChildOffset() < mContent->ChildCount()) {
|
} else if (NextChildOffset() < mContent->ChildCount()) {
|
||||||
// Try and pull-up some children from a next-in-flow
|
// Try and pull-up some children from a next-in-flow
|
||||||
@@ -279,12 +279,12 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
NS_ABORT(); // huge error for tables!
|
NS_ABORT(); // huge error for tables!
|
||||||
} else {
|
} else {
|
||||||
// We were unable to pull-up all the existing frames from the next in flow
|
// We were unable to pull-up all the existing frames from the next in flow
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frComplete == aStatus) {
|
if (NS_FRAME_IS_COMPLETE(aStatus)) {
|
||||||
// Don't forget to add in the bottom margin from our last child.
|
// Don't forget to add in the bottom margin from our last child.
|
||||||
// Only add it in if there's room for it.
|
// Only add it in if there's room for it.
|
||||||
nscoord margin = state.prevMaxPosBottomMargin -
|
nscoord margin = state.prevMaxPosBottomMargin -
|
||||||
@@ -301,7 +301,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
/* if we're incomplete, take up all the remaining height so we don't waste time
|
/* if we're incomplete, take up all the remaining height so we don't waste time
|
||||||
* trying to lay out in a slot that we know isn't tall enough to fit our minimum.
|
* trying to lay out in a slot that we know isn't tall enough to fit our minimum.
|
||||||
* otherwise, we're as tall as our kids want us to be */
|
* otherwise, we're as tall as our kids want us to be */
|
||||||
if (frNotComplete == aStatus)
|
if (NS_FRAME_IS_NOT_COMPLETE(aStatus))
|
||||||
aDesiredSize.height = aMaxSize.height;
|
aDesiredSize.height = aMaxSize.height;
|
||||||
else
|
else
|
||||||
aDesiredSize.height = state.y;
|
aDesiredSize.height = state.y;
|
||||||
@@ -310,12 +310,12 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
{
|
{
|
||||||
if (nsnull!=aMaxElementSize)
|
if (nsnull!=aMaxElementSize)
|
||||||
printf("Outer frame Reflow complete, returning %s with aDesiredSize = %d,%d and aMaxElementSize=%d,%d\n",
|
printf("Outer frame Reflow complete, returning %s with aDesiredSize = %d,%d and aMaxElementSize=%d,%d\n",
|
||||||
aStatus==frComplete ? "Complete" : "Not Complete",
|
NS_FRAME_IS_COMPLETE(aStatus)? "Complete" : "Not Complete",
|
||||||
aDesiredSize.width, aDesiredSize.height,
|
aDesiredSize.width, aDesiredSize.height,
|
||||||
aMaxElementSize->width, aMaxElementSize->height);
|
aMaxElementSize->width, aMaxElementSize->height);
|
||||||
else
|
else
|
||||||
printf("Outer frame Reflow complete, returning %s with aDesiredSize = %d,%d and NSNULL aMaxElementSize\n",
|
printf("Outer frame Reflow complete, returning %s with aDesiredSize = %d,%d and NSNULL aMaxElementSize\n",
|
||||||
aStatus==frComplete ? "Complete" : "Not Complete",
|
NS_FRAME_IS_COMPLETE(aStatus)? "Complete" : "Not Complete",
|
||||||
aDesiredSize.width, aDesiredSize.height);
|
aDesiredSize.width, aDesiredSize.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -449,8 +449,8 @@ PRBool nsTableOuterFrame::ReflowMappedChildren( nsIPresContext* aPresContex
|
|||||||
PRBool result = PR_TRUE;
|
PRBool result = PR_TRUE;
|
||||||
aState.availSize.width = aState.innerTableMaxSize.width;
|
aState.availSize.width = aState.innerTableMaxSize.width;
|
||||||
for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) {
|
for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) {
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
nsIFrame::ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
SetReflowState(aState, kidFrame);
|
SetReflowState(aState, kidFrame);
|
||||||
|
|
||||||
@@ -517,9 +517,9 @@ PRBool nsTableOuterFrame::ReflowMappedChildren( nsIPresContext* aPresContex
|
|||||||
prevKidFrame = kidFrame;
|
prevKidFrame = kidFrame;
|
||||||
|
|
||||||
// Update mLastContentIsComplete now that this kid fits
|
// Update mLastContentIsComplete now that this kid fits
|
||||||
mLastContentIsComplete = PRBool(status == frComplete);
|
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status);
|
||||||
|
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// No, the child isn't complete
|
// No, the child isn't complete
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
@@ -670,8 +670,8 @@ PRBool nsTableOuterFrame::PullUpChildren( nsIPresContext* aPresContext,
|
|||||||
PRBool result = PR_TRUE;
|
PRBool result = PR_TRUE;
|
||||||
|
|
||||||
while (nsnull != nextInFlow) {
|
while (nsnull != nextInFlow) {
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
// Get the next child
|
// Get the next child
|
||||||
nsIFrame* kidFrame = nextInFlow->mFirstChild;
|
nsIFrame* kidFrame = nextInFlow->mFirstChild;
|
||||||
@@ -756,8 +756,8 @@ PRBool nsTableOuterFrame::PullUpChildren( nsIPresContext* aPresContext,
|
|||||||
prevLastContentIsComplete = mLastContentIsComplete;
|
prevLastContentIsComplete = mLastContentIsComplete;
|
||||||
|
|
||||||
// Is the child we just pulled up complete?
|
// Is the child we just pulled up complete?
|
||||||
mLastContentIsComplete = PRBool(status == frComplete);
|
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status);
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// No the child isn't complete
|
// No the child isn't complete
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
@@ -875,7 +875,7 @@ void nsTableOuterFrame::SetReflowState(OuterTableReflowState& aState, nsIFrame*
|
|||||||
* child is complete and it has next-in-flows (it was a splittable child)
|
* child is complete and it has next-in-flows (it was a splittable child)
|
||||||
* then delete the next-in-flows.
|
* then delete the next-in-flows.
|
||||||
*/
|
*/
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
nsTableOuterFrame::ReflowChild( nsIFrame* aKidFrame,
|
nsTableOuterFrame::ReflowChild( nsIFrame* aKidFrame,
|
||||||
nsIPresContext* aPresContext,
|
nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
@@ -883,7 +883,7 @@ nsTableOuterFrame::ReflowChild( nsIFrame* aKidFrame,
|
|||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
OuterTableReflowState& aState)
|
OuterTableReflowState& aState)
|
||||||
{
|
{
|
||||||
ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
/* call the appropriate reflow method based on the type and position of the child */
|
/* call the appropriate reflow method based on the type and position of the child */
|
||||||
if (PR_TRUE==aState.processingCaption)
|
if (PR_TRUE==aState.processingCaption)
|
||||||
@@ -922,7 +922,7 @@ nsTableOuterFrame::ReflowChild( nsIFrame* aKidFrame,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frComplete == status) {
|
if (NS_FRAME_IS_COMPLETE(status)) {
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
aKidFrame->GetNextInFlow(kidNextInFlow);
|
aKidFrame->GetNextInFlow(kidNextInFlow);
|
||||||
@@ -1017,7 +1017,7 @@ void nsTableOuterFrame::CreateChildFrames(nsIPresContext* aPresContext)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
nsTableOuterFrame::ResizeReflowCaptionsPass1(nsIPresContext* aPresContext)
|
nsTableOuterFrame::ResizeReflowCaptionsPass1(nsIPresContext* aPresContext)
|
||||||
{
|
{
|
||||||
if (nsnull!=mCaptionFrames)
|
if (nsnull!=mCaptionFrames)
|
||||||
@@ -1029,7 +1029,7 @@ nsTableOuterFrame::ResizeReflowCaptionsPass1(nsIPresContext* aPresContext)
|
|||||||
nsSize maxSize(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
|
nsSize maxSize(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
|
||||||
nsReflowMetrics desiredSize;
|
nsReflowMetrics desiredSize;
|
||||||
nsTableCaptionFrame *captionFrame = (nsTableCaptionFrame *)mCaptionFrames->ElementAt(captionIndex);
|
nsTableCaptionFrame *captionFrame = (nsTableCaptionFrame *)mCaptionFrames->ElementAt(captionIndex);
|
||||||
ReflowStatus status;
|
nsReflowStatus status;
|
||||||
captionFrame->ResizeReflow(aPresContext, desiredSize, maxSize, &maxElementSize, status);
|
captionFrame->ResizeReflow(aPresContext, desiredSize, maxSize, &maxElementSize, status);
|
||||||
if (mMinCaptionWidth<maxElementSize.width)
|
if (mMinCaptionWidth<maxElementSize.width)
|
||||||
mMinCaptionWidth = maxElementSize.width;
|
mMinCaptionWidth = maxElementSize.width;
|
||||||
@@ -1039,16 +1039,16 @@ nsTableOuterFrame::ResizeReflowCaptionsPass1(nsIPresContext* aPresContext)
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return frComplete;
|
return NS_FRAME_COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
nsTableOuterFrame::ResizeReflowTopCaptionsPass2(nsIPresContext* aPresContext,
|
nsTableOuterFrame::ResizeReflowTopCaptionsPass2(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize)
|
nsSize* aMaxElementSize)
|
||||||
{
|
{
|
||||||
ReflowStatus result = frComplete;
|
nsReflowStatus result = NS_FRAME_COMPLETE;
|
||||||
nscoord topCaptionY = 0;
|
nscoord topCaptionY = 0;
|
||||||
if (nsnull!=mCaptionFrames)
|
if (nsnull!=mCaptionFrames)
|
||||||
{
|
{
|
||||||
@@ -1074,7 +1074,7 @@ nsTableOuterFrame::ResizeReflowTopCaptionsPass2(nsIPresContext* aPresContext,
|
|||||||
else
|
else
|
||||||
{ // top-align captions, the default
|
{ // top-align captions, the default
|
||||||
// reflow the caption, skipping top captions after the first that doesn't fit
|
// reflow the caption, skipping top captions after the first that doesn't fit
|
||||||
if (frComplete==result)
|
if (NS_FRAME_IS_COMPLETE(result))
|
||||||
{
|
{
|
||||||
nsReflowMetrics desiredSize;
|
nsReflowMetrics desiredSize;
|
||||||
result = nsContainerFrame::ReflowChild(captionFrame, aPresContext, desiredSize, aMaxSize, nsnull);
|
result = nsContainerFrame::ReflowChild(captionFrame, aPresContext, desiredSize, aMaxSize, nsnull);
|
||||||
@@ -1108,14 +1108,14 @@ nsTableOuterFrame::ResizeReflowTopCaptionsPass2(nsIPresContext* aPresContext,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
nsTableOuterFrame::ResizeReflowBottomCaptionsPass2(nsIPresContext* aPresContext,
|
nsTableOuterFrame::ResizeReflowBottomCaptionsPass2(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
nscoord aYOffset)
|
nscoord aYOffset)
|
||||||
{
|
{
|
||||||
ReflowStatus result = frComplete;
|
nsReflowStatus result = NS_FRAME_COMPLETE;
|
||||||
nscoord bottomCaptionY = aYOffset;
|
nscoord bottomCaptionY = aYOffset;
|
||||||
// for now, assume all captions are stacked vertically
|
// for now, assume all captions are stacked vertically
|
||||||
if (nsnull!=mBottomCaptions)
|
if (nsnull!=mBottomCaptions)
|
||||||
@@ -1199,7 +1199,7 @@ nsTableOuterFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
if (PR_TRUE==gsDebug) printf("nsTableOuterFrame::IncrementalReflow\n");
|
if (PR_TRUE==gsDebug) printf("nsTableOuterFrame::IncrementalReflow\n");
|
||||||
// total hack for now, just some hard-coded values
|
// total hack for now, just some hard-coded values
|
||||||
|
|||||||
@@ -87,14 +87,14 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
/** @see nsIFrame::IncrementalReflow */
|
/** @see nsIFrame::IncrementalReflow */
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
/** @see nsContainerFrame */
|
/** @see nsContainerFrame */
|
||||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||||
@@ -134,13 +134,13 @@ protected:
|
|||||||
|
|
||||||
/** reflow the captions in an infinite space, caching the min/max sizes for each
|
/** reflow the captions in an infinite space, caching the min/max sizes for each
|
||||||
*/
|
*/
|
||||||
virtual ReflowStatus ResizeReflowCaptionsPass1(nsIPresContext* aPresContext);
|
virtual nsReflowStatus ResizeReflowCaptionsPass1(nsIPresContext* aPresContext);
|
||||||
|
|
||||||
/** reflow the top captions in a space constrained by the computed table width
|
/** reflow the top captions in a space constrained by the computed table width
|
||||||
* and the heigth given to us by our parent. Top captions are laid down
|
* and the heigth given to us by our parent. Top captions are laid down
|
||||||
* before the inner table.
|
* before the inner table.
|
||||||
*/
|
*/
|
||||||
virtual ReflowStatus ResizeReflowTopCaptionsPass2(nsIPresContext* aPresContext,
|
virtual nsReflowStatus ResizeReflowTopCaptionsPass2(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize);
|
nsSize* aMaxElementSize);
|
||||||
@@ -149,11 +149,11 @@ protected:
|
|||||||
* and the heigth given to us by our parent. Bottom captions are laid down
|
* and the heigth given to us by our parent. Bottom captions are laid down
|
||||||
* after the inner table.
|
* after the inner table.
|
||||||
*/
|
*/
|
||||||
virtual ReflowStatus ResizeReflowBottomCaptionsPass2(nsIPresContext* aPresContext,
|
virtual nsReflowStatus ResizeReflowBottomCaptionsPass2(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
nscoord aYOffset);
|
nscoord aYOffset);
|
||||||
|
|
||||||
nscoord GetTopMarginFor(nsIPresContext* aCX,
|
nscoord GetTopMarginFor(nsIPresContext* aCX,
|
||||||
OuterTableReflowState& aState,
|
OuterTableReflowState& aState,
|
||||||
@@ -192,12 +192,12 @@ protected:
|
|||||||
virtual void SetReflowState(OuterTableReflowState& aState,
|
virtual void SetReflowState(OuterTableReflowState& aState,
|
||||||
nsIFrame* aKidFrame);
|
nsIFrame* aKidFrame);
|
||||||
|
|
||||||
virtual nsIFrame::ReflowStatus ReflowChild( nsIFrame* aKidFrame,
|
virtual nsReflowStatus ReflowChild( nsIFrame* aKidFrame,
|
||||||
nsIPresContext* aPresContext,
|
nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
OuterTableReflowState& aState);
|
OuterTableReflowState& aState);
|
||||||
|
|
||||||
/** overridden here to handle special caption-table relationship
|
/** overridden here to handle special caption-table relationship
|
||||||
* @see nsContainerFrame::VerifyTree
|
* @see nsContainerFrame::VerifyTree
|
||||||
|
|||||||
@@ -273,8 +273,8 @@ PRBool nsTableRowFrame::ReflowMappedChildren(nsIPresContext* aPresContext,
|
|||||||
nsSize kidAvailSize(aState.availSize);
|
nsSize kidAvailSize(aState.availSize);
|
||||||
if (0>=kidAvailSize.height)
|
if (0>=kidAvailSize.height)
|
||||||
kidAvailSize.height = 1; // XXX: HaCk - we don't handle negative heights yet
|
kidAvailSize.height = 1; // XXX: HaCk - we don't handle negative heights yet
|
||||||
nsReflowMetrics desiredSize;
|
nsReflowMetrics desiredSize;
|
||||||
nsIFrame::ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
// Get top margin for this kid
|
// Get top margin for this kid
|
||||||
nsIStyleContext* kidSC;
|
nsIStyleContext* kidSC;
|
||||||
@@ -322,12 +322,12 @@ PRBool nsTableRowFrame::ReflowMappedChildren(nsIPresContext* aPresContext,
|
|||||||
{
|
{
|
||||||
if (nsnull!=pKidMaxElementSize)
|
if (nsnull!=pKidMaxElementSize)
|
||||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
|
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
|
||||||
status==frComplete?"complete":"NOT complete",
|
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||||
desiredSize.width, desiredSize.height,
|
desiredSize.width, desiredSize.height,
|
||||||
pKidMaxElementSize->width, pKidMaxElementSize->height);
|
pKidMaxElementSize->width, pKidMaxElementSize->height);
|
||||||
else
|
else
|
||||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n",
|
printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n",
|
||||||
status==frComplete?"complete":"NOT complete",
|
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||||
desiredSize.width, desiredSize.height);
|
desiredSize.width, desiredSize.height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -372,7 +372,7 @@ PRBool nsTableRowFrame::ReflowMappedChildren(nsIPresContext* aPresContext,
|
|||||||
prevKidFrame = kidFrame;
|
prevKidFrame = kidFrame;
|
||||||
|
|
||||||
// Update mLastContentIsComplete now that this kid fits
|
// Update mLastContentIsComplete now that this kid fits
|
||||||
mLastContentIsComplete = PRBool(status == frComplete);
|
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status);
|
||||||
|
|
||||||
/* Rows should not create continuing frames for cells
|
/* Rows should not create continuing frames for cells
|
||||||
* unless they absolutely have to!
|
* unless they absolutely have to!
|
||||||
@@ -380,7 +380,7 @@ PRBool nsTableRowFrame::ReflowMappedChildren(nsIPresContext* aPresContext,
|
|||||||
* otherwise PushChildren and bail.
|
* otherwise PushChildren and bail.
|
||||||
*/
|
*/
|
||||||
// Special handling for incomplete children
|
// Special handling for incomplete children
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// XXX It's good to assume that we might still have room
|
// XXX It's good to assume that we might still have room
|
||||||
// even if the child didn't complete (floaters will want this)
|
// even if the child didn't complete (floaters will want this)
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
@@ -530,7 +530,7 @@ PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
while (nsnull != nextInFlow) {
|
while (nsnull != nextInFlow) {
|
||||||
nsReflowMetrics desiredSize;
|
nsReflowMetrics desiredSize;
|
||||||
ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
// Get the next child
|
// Get the next child
|
||||||
nsIFrame* kidFrame = nextInFlow->mFirstChild;
|
nsIFrame* kidFrame = nextInFlow->mFirstChild;
|
||||||
@@ -586,12 +586,12 @@ PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
{
|
{
|
||||||
if (nsnull!=pKidMaxElementSize)
|
if (nsnull!=pKidMaxElementSize)
|
||||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
|
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
|
||||||
status==frComplete?"complete":"NOT complete",
|
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||||
desiredSize.width, desiredSize.height,
|
desiredSize.width, desiredSize.height,
|
||||||
pKidMaxElementSize->width, pKidMaxElementSize->height);
|
pKidMaxElementSize->width, pKidMaxElementSize->height);
|
||||||
else
|
else
|
||||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n",
|
printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n",
|
||||||
status==frComplete?"complete":"NOT complete",
|
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||||
desiredSize.width, desiredSize.height);
|
desiredSize.width, desiredSize.height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -646,8 +646,8 @@ PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
prevLastContentIsComplete = mLastContentIsComplete;
|
prevLastContentIsComplete = mLastContentIsComplete;
|
||||||
|
|
||||||
// Is the child we just pulled up complete?
|
// Is the child we just pulled up complete?
|
||||||
mLastContentIsComplete = PRBool(status == frComplete);
|
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status);
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// No the child isn't complete
|
// No the child isn't complete
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
@@ -746,10 +746,10 @@ PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
*
|
*
|
||||||
* @param aPresContext presentation context to use
|
* @param aPresContext presentation context to use
|
||||||
* @param aState current inline state
|
* @param aState current inline state
|
||||||
* @return frComplete if all content has been mapped and frNotComplete
|
* @return NS_FRAME_COMPLETE if all content has been mapped and NS_FRAME_NOT_COMPLETE
|
||||||
* if we should be continued
|
* if we should be continued
|
||||||
*/
|
*/
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext,
|
nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsSize* aMaxElementSize)
|
nsSize* aMaxElementSize)
|
||||||
@@ -758,7 +758,7 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext,
|
|||||||
VerifyLastIsComplete();
|
VerifyLastIsComplete();
|
||||||
#endif
|
#endif
|
||||||
nsIFrame* kidPrevInFlow = nsnull;
|
nsIFrame* kidPrevInFlow = nsnull;
|
||||||
ReflowStatus result = frNotComplete;
|
nsReflowStatus result = 0; // not complete
|
||||||
|
|
||||||
// If we have no children and we have a prev-in-flow then we need to pick
|
// If we have no children and we have a prev-in-flow then we need to pick
|
||||||
// up where it left off. If we have children, e.g. we're being resized, then
|
// up where it left off. If we have children, e.g. we're being resized, then
|
||||||
@@ -789,13 +789,13 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext,
|
|||||||
// Get the next content object
|
// Get the next content object
|
||||||
nsIContent* cell = mContent->ChildAt(kidIndex);
|
nsIContent* cell = mContent->ChildAt(kidIndex);
|
||||||
if (nsnull == cell) {
|
if (nsnull == cell) {
|
||||||
result = frComplete;
|
result = NS_FRAME_COMPLETE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure we still have room left
|
// Make sure we still have room left
|
||||||
if (aState.availSize.height <= 0) {
|
if (aState.availSize.height <= 0) {
|
||||||
// Note: return status was set to frNotComplete above...
|
// Note: return status was set to NS_FRAME_NOT_COMPLETE above...
|
||||||
NS_RELEASE(cell); // cell: REFCNT--(a)
|
NS_RELEASE(cell); // cell: REFCNT--(a)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -826,7 +826,7 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext,
|
|||||||
// Try to reflow the child into the available space. It might not
|
// Try to reflow the child into the available space. It might not
|
||||||
// fit or might need continuing.
|
// fit or might need continuing.
|
||||||
nsReflowMetrics desiredSize;
|
nsReflowMetrics desiredSize;
|
||||||
ReflowStatus status;
|
nsReflowStatus status;
|
||||||
if (NS_UNCONSTRAINEDSIZE == aState.availSize.width)
|
if (NS_UNCONSTRAINEDSIZE == aState.availSize.width)
|
||||||
{
|
{
|
||||||
// Reflow the child into the available space
|
// Reflow the child into the available space
|
||||||
@@ -854,12 +854,12 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext,
|
|||||||
{
|
{
|
||||||
if (nsnull!=pKidMaxElementSize)
|
if (nsnull!=pKidMaxElementSize)
|
||||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
|
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
|
||||||
status==frComplete?"complete":"NOT complete",
|
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||||
desiredSize.width, desiredSize.height,
|
desiredSize.width, desiredSize.height,
|
||||||
pKidMaxElementSize->width, pKidMaxElementSize->height);
|
pKidMaxElementSize->width, pKidMaxElementSize->height);
|
||||||
else
|
else
|
||||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n",
|
printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n",
|
||||||
status==frComplete?"complete":"NOT complete",
|
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||||
desiredSize.width, desiredSize.height);
|
desiredSize.width, desiredSize.height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -900,7 +900,7 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext,
|
|||||||
kidIndex++;
|
kidIndex++;
|
||||||
|
|
||||||
// Did the child complete?
|
// Did the child complete?
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// If the child isn't complete then it means that we've used up
|
// If the child isn't complete then it means that we've used up
|
||||||
// all of our available space
|
// all of our available space
|
||||||
mLastContentIsComplete = PR_FALSE;
|
mLastContentIsComplete = PR_FALSE;
|
||||||
@@ -934,7 +934,7 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
if (gsDebug1==PR_TRUE)
|
if (gsDebug1==PR_TRUE)
|
||||||
printf("nsTableRowFrame::ResizeReflow - aMaxSize = %d, %d\n",
|
printf("nsTableRowFrame::ResizeReflow - aMaxSize = %d, %d\n",
|
||||||
@@ -954,7 +954,7 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
PRBool reflowMappedOK = PR_TRUE;
|
PRBool reflowMappedOK = PR_TRUE;
|
||||||
|
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
// Check for an overflow list
|
// Check for an overflow list
|
||||||
MoveOverflowToChildList();
|
MoveOverflowToChildList();
|
||||||
@@ -966,7 +966,7 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
if (nsnull != mFirstChild) {
|
if (nsnull != mFirstChild) {
|
||||||
reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize);
|
reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize);
|
||||||
if (PR_FALSE == reflowMappedOK) {
|
if (PR_FALSE == reflowMappedOK) {
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -976,7 +976,7 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
if (state.availSize.height <= 0) {
|
if (state.availSize.height <= 0) {
|
||||||
// No space left. Don't try to pull-up children or reflow unmapped
|
// No space left. Don't try to pull-up children or reflow unmapped
|
||||||
if (NextChildOffset() < mContent->ChildCount()) {
|
if (NextChildOffset() < mContent->ChildCount()) {
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
} else if (NextChildOffset() < mContent->ChildCount()) {
|
} else if (NextChildOffset() < mContent->ChildCount()) {
|
||||||
// Try and pull-up some children from a next-in-flow
|
// Try and pull-up some children from a next-in-flow
|
||||||
@@ -988,12 +988,12 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
} else {
|
} else {
|
||||||
// We were unable to pull-up all the existing frames from the
|
// We were unable to pull-up all the existing frames from the
|
||||||
// next in flow
|
// next in flow
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frComplete == aStatus) {
|
if (NS_FRAME_IS_COMPLETE(aStatus)) {
|
||||||
// Don't forget to add in the bottom margin from our last child.
|
// Don't forget to add in the bottom margin from our last child.
|
||||||
// Only add it in if there's room for it.
|
// Only add it in if there's room for it.
|
||||||
nscoord margin = state.prevMaxPosBottomMargin -
|
nscoord margin = state.prevMaxPosBottomMargin -
|
||||||
@@ -1012,12 +1012,12 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
{
|
{
|
||||||
if (nsnull!=aMaxElementSize)
|
if (nsnull!=aMaxElementSize)
|
||||||
printf("nsTableRowFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=%d,%d\n",
|
printf("nsTableRowFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=%d,%d\n",
|
||||||
aStatus==frComplete?"Complete":"Not Complete",
|
NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete",
|
||||||
aDesiredSize.width, aDesiredSize.height,
|
aDesiredSize.width, aDesiredSize.height,
|
||||||
aMaxElementSize->width, aMaxElementSize->height);
|
aMaxElementSize->width, aMaxElementSize->height);
|
||||||
else
|
else
|
||||||
printf("nsTableRowFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=NSNULL\n",
|
printf("nsTableRowFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=NSNULL\n",
|
||||||
aStatus==frComplete?"Complete":"Not Complete",
|
NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete",
|
||||||
aDesiredSize.width, aDesiredSize.height);
|
aDesiredSize.width, aDesiredSize.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1030,10 +1030,10 @@ nsTableRowFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
if (gsDebug1==PR_TRUE) printf("nsTableRowFrame::IncrementalReflow\n");
|
if (gsDebug1==PR_TRUE) printf("nsTableRowFrame::IncrementalReflow\n");
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,14 +81,14 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
/** @see nsIFrame::IncrementalReflow */
|
/** @see nsIFrame::IncrementalReflow */
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
/** @see nsContainerFrame::CreateContinuingFrame */
|
/** @see nsContainerFrame::CreateContinuingFrame */
|
||||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||||
@@ -159,9 +159,9 @@ protected:
|
|||||||
* @return frComplete if all content has been mapped and frNotComplete
|
* @return frComplete if all content has been mapped and frNotComplete
|
||||||
* if we should be continued
|
* if we should be continued
|
||||||
*/
|
*/
|
||||||
ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
nsReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsSize* aMaxElementSize);
|
nsSize* aMaxElementSize);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -270,8 +270,8 @@ PRBool nsTableRowGroupFrame::ReflowMappedChildren( nsIPresContext* aPresCon
|
|||||||
nsSize kidAvailSize(aState.availSize);
|
nsSize kidAvailSize(aState.availSize);
|
||||||
if (0>=kidAvailSize.height)
|
if (0>=kidAvailSize.height)
|
||||||
kidAvailSize.height = 1; // XXX: HaCk - we don't handle negative heights yet
|
kidAvailSize.height = 1; // XXX: HaCk - we don't handle negative heights yet
|
||||||
nsReflowMetrics desiredSize;
|
nsReflowMetrics desiredSize;
|
||||||
nsIFrame::ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
// Get top margin for this kid
|
// Get top margin for this kid
|
||||||
nsIContentPtr kid;
|
nsIContentPtr kid;
|
||||||
@@ -340,7 +340,7 @@ PRBool nsTableRowGroupFrame::ReflowMappedChildren( nsIPresContext* aPresCon
|
|||||||
prevKidFrame = kidFrame;
|
prevKidFrame = kidFrame;
|
||||||
|
|
||||||
// Update mLastContentIsComplete now that this kid fits
|
// Update mLastContentIsComplete now that this kid fits
|
||||||
mLastContentIsComplete = PRBool(status == frComplete);
|
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status);
|
||||||
|
|
||||||
/* Row groups should not create continuing frames for rows
|
/* Row groups should not create continuing frames for rows
|
||||||
* unless they absolutely have to!
|
* unless they absolutely have to!
|
||||||
@@ -348,7 +348,7 @@ PRBool nsTableRowGroupFrame::ReflowMappedChildren( nsIPresContext* aPresCon
|
|||||||
* otherwise PushChildren and bail.
|
* otherwise PushChildren and bail.
|
||||||
*/
|
*/
|
||||||
// Special handling for incomplete children
|
// Special handling for incomplete children
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// XXX It's good to assume that we might still have room
|
// XXX It's good to assume that we might still have room
|
||||||
// even if the child didn't complete (floaters will want this)
|
// even if the child didn't complete (floaters will want this)
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
@@ -495,7 +495,7 @@ PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
while (nsnull != nextInFlow) {
|
while (nsnull != nextInFlow) {
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
// Get the next child
|
// Get the next child
|
||||||
nsIFrame* kidFrame = nextInFlow->mFirstChild;
|
nsIFrame* kidFrame = nextInFlow->mFirstChild;
|
||||||
@@ -579,8 +579,8 @@ PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
prevLastContentIsComplete = mLastContentIsComplete;
|
prevLastContentIsComplete = mLastContentIsComplete;
|
||||||
|
|
||||||
// Is the child we just pulled up complete?
|
// Is the child we just pulled up complete?
|
||||||
mLastContentIsComplete = PRBool(status == frComplete);
|
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status);
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// No the child isn't complete
|
// No the child isn't complete
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
@@ -682,7 +682,7 @@ PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
* @return frComplete if all content has been mapped and frNotComplete
|
* @return frComplete if all content has been mapped and frNotComplete
|
||||||
* if we should be continued
|
* if we should be continued
|
||||||
*/
|
*/
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
||||||
RowGroupReflowState& aState,
|
RowGroupReflowState& aState,
|
||||||
nsSize* aMaxElementSize)
|
nsSize* aMaxElementSize)
|
||||||
@@ -690,8 +690,8 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
VerifyLastIsComplete();
|
VerifyLastIsComplete();
|
||||||
#endif
|
#endif
|
||||||
nsIFrame* kidPrevInFlow = nsnull;
|
nsIFrame* kidPrevInFlow = nsnull;
|
||||||
ReflowStatus result = frNotComplete;
|
nsReflowStatus result = 0; // not complete
|
||||||
|
|
||||||
// If we have no children and we have a prev-in-flow then we need to pick
|
// If we have no children and we have a prev-in-flow then we need to pick
|
||||||
// up where it left off. If we have children, e.g. we're being resized, then
|
// up where it left off. If we have children, e.g. we're being resized, then
|
||||||
@@ -721,7 +721,7 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
// Get the next content object
|
// Get the next content object
|
||||||
nsIContentPtr kid = mContent->ChildAt(kidIndex);
|
nsIContentPtr kid = mContent->ChildAt(kidIndex);
|
||||||
if (kid.IsNull()) {
|
if (kid.IsNull()) {
|
||||||
result = frComplete;
|
result = NS_FRAME_COMPLETE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -756,8 +756,8 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
// Try to reflow the child into the available space. It might not
|
// Try to reflow the child into the available space. It might not
|
||||||
// fit or might need continuing.
|
// fit or might need continuing.
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
ReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize,
|
nsReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize,
|
||||||
aState.availSize, pKidMaxElementSize);
|
aState.availSize, pKidMaxElementSize);
|
||||||
|
|
||||||
// Did the child fit?
|
// Did the child fit?
|
||||||
if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) {
|
if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) {
|
||||||
@@ -788,7 +788,7 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
kidIndex++;
|
kidIndex++;
|
||||||
|
|
||||||
// Did the child complete?
|
// Did the child complete?
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// If the child isn't complete then it means that we've used up
|
// If the child isn't complete then it means that we've used up
|
||||||
// all of our available space
|
// all of our available space
|
||||||
mLastContentIsComplete = PR_FALSE;
|
mLastContentIsComplete = PR_FALSE;
|
||||||
@@ -820,7 +820,7 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
if (gsDebug1==PR_TRUE)
|
if (gsDebug1==PR_TRUE)
|
||||||
printf("nsTableRowGroupFrame::ResizeReflow - aMaxSize = %d, %d\n",
|
printf("nsTableRowGroupFrame::ResizeReflow - aMaxSize = %d, %d\n",
|
||||||
@@ -837,7 +837,7 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
PRBool reflowMappedOK = PR_TRUE;
|
PRBool reflowMappedOK = PR_TRUE;
|
||||||
|
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
// Check for an overflow list
|
// Check for an overflow list
|
||||||
MoveOverflowToChildList();
|
MoveOverflowToChildList();
|
||||||
@@ -848,7 +848,7 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext,
|
|||||||
if (nsnull != mFirstChild) {
|
if (nsnull != mFirstChild) {
|
||||||
reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize);
|
reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize);
|
||||||
if (PR_FALSE == reflowMappedOK) {
|
if (PR_FALSE == reflowMappedOK) {
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -858,7 +858,7 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext,
|
|||||||
if (state.availSize.height <= 0) {
|
if (state.availSize.height <= 0) {
|
||||||
// No space left. Don't try to pull-up children or reflow unmapped
|
// No space left. Don't try to pull-up children or reflow unmapped
|
||||||
if (NextChildOffset() < mContent->ChildCount()) {
|
if (NextChildOffset() < mContent->ChildCount()) {
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
} else if (NextChildOffset() < mContent->ChildCount()) {
|
} else if (NextChildOffset() < mContent->ChildCount()) {
|
||||||
// Try and pull-up some children from a next-in-flow
|
// Try and pull-up some children from a next-in-flow
|
||||||
@@ -870,12 +870,12 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext,
|
|||||||
} else {
|
} else {
|
||||||
// We were unable to pull-up all the existing frames from the
|
// We were unable to pull-up all the existing frames from the
|
||||||
// next in flow
|
// next in flow
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frComplete == aStatus) {
|
if (NS_FRAME_IS_COMPLETE(aStatus)) {
|
||||||
// Don't forget to add in the bottom margin from our last child.
|
// Don't forget to add in the bottom margin from our last child.
|
||||||
// Only add it in if there's room for it.
|
// Only add it in if there's room for it.
|
||||||
nscoord margin = state.prevMaxPosBottomMargin -
|
nscoord margin = state.prevMaxPosBottomMargin -
|
||||||
@@ -899,12 +899,12 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext,
|
|||||||
{
|
{
|
||||||
if (nsnull!=aMaxElementSize)
|
if (nsnull!=aMaxElementSize)
|
||||||
printf("nsTableRowGroupFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=%d,%d\n",
|
printf("nsTableRowGroupFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=%d,%d\n",
|
||||||
aStatus==frComplete?"Complete":"Not Complete",
|
NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete",
|
||||||
aDesiredSize.width, aDesiredSize.height,
|
aDesiredSize.width, aDesiredSize.height,
|
||||||
aMaxElementSize->width, aMaxElementSize->height);
|
aMaxElementSize->width, aMaxElementSize->height);
|
||||||
else
|
else
|
||||||
printf("nsTableRowGroupFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=NSNULL\n",
|
printf("nsTableRowGroupFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=NSNULL\n",
|
||||||
aStatus==frComplete?"Complete":"Not Complete",
|
NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete",
|
||||||
aDesiredSize.width, aDesiredSize.height);
|
aDesiredSize.width, aDesiredSize.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -917,7 +917,7 @@ nsTableRowGroupFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
if (gsDebug1==PR_TRUE) printf("nsTableRowGroupFrame::IncrementalReflow\n");
|
if (gsDebug1==PR_TRUE) printf("nsTableRowGroupFrame::IncrementalReflow\n");
|
||||||
|
|
||||||
@@ -925,7 +925,7 @@ nsTableRowGroupFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
aDesiredSize.width = aMaxSize.width;
|
aDesiredSize.width = aMaxSize.width;
|
||||||
aDesiredSize.height = aMaxSize.height;
|
aDesiredSize.height = aMaxSize.height;
|
||||||
|
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,13 +76,13 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
/** @see nsIFrame::IncrementalReflow */
|
/** @see nsIFrame::IncrementalReflow */
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
/** @see nsContainerFrame::CreateContinuingFrame */
|
/** @see nsContainerFrame::CreateContinuingFrame */
|
||||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||||
@@ -152,9 +152,9 @@ protected:
|
|||||||
* @return frComplete if all content has been mapped and frNotComplete
|
* @return frComplete if all content has been mapped and frNotComplete
|
||||||
* if we should be continued
|
* if we should be continued
|
||||||
*/
|
*/
|
||||||
ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
nsReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
||||||
RowGroupReflowState& aState,
|
RowGroupReflowState& aState,
|
||||||
nsSize* aMaxElementSize);
|
nsSize* aMaxElementSize);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nsIAtom *mType;
|
nsIAtom *mType;
|
||||||
|
|||||||
@@ -67,10 +67,10 @@ public:
|
|||||||
FixedSizeFrame(nsIContent* aContent,
|
FixedSizeFrame(nsIContent* aContent,
|
||||||
nsIFrame* aParentFrame);
|
nsIFrame* aParentFrame);
|
||||||
|
|
||||||
ReflowStatus ResizeReflow(nsIPresContext* aPresContext,
|
nsReflowStatus ResizeReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize);
|
nsSize* aMaxElementSize);
|
||||||
|
|
||||||
PRBool IsSplittable() const;
|
PRBool IsSplittable() const;
|
||||||
};
|
};
|
||||||
@@ -108,7 +108,7 @@ FixedSizeFrame::FixedSizeFrame(nsIContent* aContent,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
FixedSizeFrame::ResizeReflow(nsIPresContext* aPresContext,
|
FixedSizeFrame::ResizeReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
@@ -116,7 +116,7 @@ FixedSizeFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
{
|
{
|
||||||
NS_PRECONDITION((aMaxSize.width > 0) && (aMaxSize.height > 0), "bad max size");
|
NS_PRECONDITION((aMaxSize.width > 0) && (aMaxSize.height > 0), "bad max size");
|
||||||
FixedSizeContent* content = (FixedSizeContent*)mContent;
|
FixedSizeContent* content = (FixedSizeContent*)mContent;
|
||||||
ReflowStatus status = frComplete;
|
nsReflowStatus status = NS_FRAME_COMPLETE;
|
||||||
FixedSizeFrame* prevInFlow = (FixedSizeFrame*)mPrevInFlow;
|
FixedSizeFrame* prevInFlow = (FixedSizeFrame*)mPrevInFlow;
|
||||||
|
|
||||||
aDesiredSize.width = content->GetWidth();
|
aDesiredSize.width = content->GetWidth();
|
||||||
@@ -127,7 +127,7 @@ FixedSizeFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
aDesiredSize.width -= prevInFlow->mRect.width;
|
aDesiredSize.width -= prevInFlow->mRect.width;
|
||||||
} else if ((aDesiredSize.width > aMaxSize.width) && content->IsSplittable()) {
|
} else if ((aDesiredSize.width > aMaxSize.width) && content->IsSplittable()) {
|
||||||
aDesiredSize.width = aMaxSize.width;
|
aDesiredSize.width = aMaxSize.width;
|
||||||
status = frNotComplete;
|
status = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
aDesiredSize.ascent = aDesiredSize.height;
|
aDesiredSize.ascent = aDesiredSize.height;
|
||||||
@@ -283,14 +283,14 @@ TestReflowUnmapped(nsIPresContext* presContext)
|
|||||||
f->SetStyleContext(presContext,styleContext);
|
f->SetStyleContext(presContext,styleContext);
|
||||||
|
|
||||||
// Reflow the HTML container
|
// Reflow the HTML container
|
||||||
nsReflowMetrics reflowMetrics;
|
nsReflowMetrics reflowMetrics;
|
||||||
nsSize maxSize(1000, 1000);
|
nsSize maxSize(1000, 1000);
|
||||||
nsIFrame::ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
||||||
|
|
||||||
// Make sure the frame is complete
|
// Make sure the frame is complete
|
||||||
if (status != nsIFrame::frComplete) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
printf("ReflowUnmapped: initial reflow not complete: %d\n", status);
|
printf("ReflowUnmapped: initial reflow not complete: %d\n", status);
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
}
|
}
|
||||||
@@ -380,14 +380,14 @@ TestChildrenThatDontFit(nsIPresContext* presContext)
|
|||||||
|
|
||||||
// Reflow the frame with a width narrower than the first child frame. This
|
// Reflow the frame with a width narrower than the first child frame. This
|
||||||
// tests how we handle one child that doesn't fit when reflowing unmapped
|
// tests how we handle one child that doesn't fit when reflowing unmapped
|
||||||
nsReflowMetrics reflowMetrics;
|
nsReflowMetrics reflowMetrics;
|
||||||
nsSize maxSize(10, 1000);
|
nsSize maxSize(10, 1000);
|
||||||
nsIFrame::ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
||||||
|
|
||||||
// Verify that the inline frame is complete
|
// Verify that the inline frame is complete
|
||||||
if (status != nsIFrame::frComplete) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
printf("ChildrenThatDontFIt: reflow unmapped isn't complete (#1a): %d\n", status);
|
printf("ChildrenThatDontFIt: reflow unmapped isn't complete (#1a): %d\n", status);
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
}
|
}
|
||||||
@@ -415,7 +415,7 @@ TestChildrenThatDontFit(nsIPresContext* presContext)
|
|||||||
status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
||||||
|
|
||||||
// Verify that the frame is not complete
|
// Verify that the frame is not complete
|
||||||
if (status != nsIFrame::frNotComplete) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
printf("ChildrenThatDontFIt: reflow unmapped isn't not complete (#1b): %d\n", status);
|
printf("ChildrenThatDontFIt: reflow unmapped isn't not complete (#1b): %d\n", status);
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
}
|
}
|
||||||
@@ -452,7 +452,7 @@ TestChildrenThatDontFit(nsIPresContext* presContext)
|
|||||||
status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
||||||
|
|
||||||
// Verify the frame is complete
|
// Verify the frame is complete
|
||||||
if (status != nsIFrame::frComplete) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
printf("ChildrenThatDontFit: resize isn't complete (#2): %d\n", status);
|
printf("ChildrenThatDontFit: resize isn't complete (#2): %d\n", status);
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
}
|
}
|
||||||
@@ -479,7 +479,7 @@ TestChildrenThatDontFit(nsIPresContext* presContext)
|
|||||||
status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
||||||
|
|
||||||
// Verify the frame is complete and we still have all the child frames
|
// Verify the frame is complete and we still have all the child frames
|
||||||
if ((status != nsIFrame::frComplete) || (f1->ChildCount() != b->ChildCount())) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status) || (f1->ChildCount() != b->ChildCount())) {
|
||||||
printf("ChildrenThatDontFit: reflow mapped failed (#3)\n");
|
printf("ChildrenThatDontFit: reflow mapped failed (#3)\n");
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
}
|
}
|
||||||
@@ -500,7 +500,7 @@ TestChildrenThatDontFit(nsIPresContext* presContext)
|
|||||||
status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
||||||
|
|
||||||
// Verify the frame is not complete
|
// Verify the frame is not complete
|
||||||
if (status != nsIFrame::frNotComplete) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
printf("ChildrenThatDontFIt: reflow mapped isn't not complete (#4): %d\n", status);
|
printf("ChildrenThatDontFIt: reflow mapped isn't not complete (#4): %d\n", status);
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
}
|
}
|
||||||
@@ -551,9 +551,9 @@ TestOverflow(nsIPresContext* presContext)
|
|||||||
// Test #1
|
// Test #1
|
||||||
|
|
||||||
// Reflow the frame so only half the second frame fits
|
// Reflow the frame so only half the second frame fits
|
||||||
nsReflowMetrics reflowMetrics;
|
nsReflowMetrics reflowMetrics;
|
||||||
nsSize maxSize(150, 1000);
|
nsSize maxSize(150, 1000);
|
||||||
nsIFrame::ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
||||||
NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status");
|
NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status");
|
||||||
@@ -601,7 +601,7 @@ TestOverflow(nsIPresContext* presContext)
|
|||||||
// Reflow the continuing frame. It should get its children from the overflow list
|
// Reflow the continuing frame. It should get its children from the overflow list
|
||||||
maxSize.width = 1000;
|
maxSize.width = 1000;
|
||||||
status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
||||||
NS_ASSERTION(nsIFrame::frComplete == status, "bad continuing frame");
|
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "bad continuing frame");
|
||||||
|
|
||||||
// Verify that the overflow list is now empty
|
// Verify that the overflow list is now empty
|
||||||
if (nsnull != f->OverflowList()) {
|
if (nsnull != f->OverflowList()) {
|
||||||
@@ -660,12 +660,12 @@ TestPushingPulling(nsIPresContext* presContext)
|
|||||||
f->SetStyleContext(presContext,styleContext);
|
f->SetStyleContext(presContext,styleContext);
|
||||||
|
|
||||||
// Reflow the inline frame so only the first frame fits
|
// Reflow the inline frame so only the first frame fits
|
||||||
nsReflowMetrics reflowMetrics;
|
nsReflowMetrics reflowMetrics;
|
||||||
nsSize maxSize(100, 1000);
|
nsSize maxSize(100, 1000);
|
||||||
nsIFrame::ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
||||||
NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status");
|
NS_ASSERTION(NS_FRAME_IS_NOT_COMPLETE(status), "bad status");
|
||||||
NS_ASSERTION(f->ChildCount() == 1, "bad child count");
|
NS_ASSERTION(f->ChildCount() == 1, "bad child count");
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
@@ -687,7 +687,7 @@ TestPushingPulling(nsIPresContext* presContext)
|
|||||||
// children
|
// children
|
||||||
maxSize.width = 1000;
|
maxSize.width = 1000;
|
||||||
status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
status = f1->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
||||||
NS_ASSERTION(nsIFrame::frComplete == status, "bad continuing frame");
|
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "bad continuing frame");
|
||||||
|
|
||||||
// Verify that the continuing inline frame has the remaining children
|
// Verify that the continuing inline frame has the remaining children
|
||||||
if (f1->ChildCount() != (b->ChildCount() - f->ChildCount())) {
|
if (f1->ChildCount() != (b->ChildCount() - f->ChildCount())) {
|
||||||
@@ -733,7 +733,7 @@ TestPushingPulling(nsIPresContext* presContext)
|
|||||||
// child frames
|
// child frames
|
||||||
maxSize.width = f->FirstChild()->GetWidth();
|
maxSize.width = f->FirstChild()->GetWidth();
|
||||||
status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
||||||
NS_ASSERTION(nsIFrame::frNotComplete == status, "bad status");
|
NS_ASSERTION(NS_FRAME_IS_NOT_COMPLETE(status), "bad status");
|
||||||
NS_ASSERTION(f->ChildCount() == 1, "bad child count");
|
NS_ASSERTION(f->ChildCount() == 1, "bad child count");
|
||||||
|
|
||||||
// Verify the last content offset of the first inline frame
|
// Verify the last content offset of the first inline frame
|
||||||
@@ -883,7 +883,7 @@ TestPushingPulling(nsIPresContext* presContext)
|
|||||||
status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
||||||
|
|
||||||
// Verify that the inline frame is complete
|
// Verify that the inline frame is complete
|
||||||
if (nsIFrame::frComplete != status) {
|
if (NS_FRAME_NOT_IS_COMPLETE(status)) {
|
||||||
printf("PushPull: failed to pull-up across empty frame (#6)\n");
|
printf("PushPull: failed to pull-up across empty frame (#6)\n");
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
}
|
}
|
||||||
@@ -941,7 +941,7 @@ TestPushingPulling(nsIPresContext* presContext)
|
|||||||
status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
status = f->ResizeReflow(presContext, reflowMetrics, maxSize, nsnull);
|
||||||
|
|
||||||
// Verify that the first inline frame is not complete
|
// Verify that the first inline frame is not complete
|
||||||
if (nsIFrame::frNotComplete != status) {
|
if (NS_FRAME_IS_COMPLETE(status)) {
|
||||||
printf("PushPull: bad status (#7)\n");
|
printf("PushPull: bad status (#7)\n");
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ NS_METHOD nsTableCellFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
NS_PRECONDITION(nsnull!=aPresContext, "bad arg");
|
NS_PRECONDITION(nsnull!=aPresContext, "bad arg");
|
||||||
|
|
||||||
@@ -216,7 +216,7 @@ NS_METHOD nsTableCellFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
//PreReflowCheck();
|
//PreReflowCheck();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
if (gsDebug==PR_TRUE)
|
if (gsDebug==PR_TRUE)
|
||||||
printf("nsTableCellFrame::ResizeReflow: maxSize=%d,%d\n",
|
printf("nsTableCellFrame::ResizeReflow: maxSize=%d,%d\n",
|
||||||
aMaxSize.width, aMaxSize.height);
|
aMaxSize.width, aMaxSize.height);
|
||||||
@@ -287,7 +287,7 @@ NS_METHOD nsTableCellFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
kidSize.width, kidSize.height));
|
kidSize.width, kidSize.height));
|
||||||
|
|
||||||
|
|
||||||
if (frNotComplete == aStatus) {
|
if (NS_FRAME_IS_NOT_COMPLETE(aStatus)) {
|
||||||
// If the child didn't finish layout then it means that it used
|
// If the child didn't finish layout then it means that it used
|
||||||
// up all of our available space (or needs us to split).
|
// up all of our available space (or needs us to split).
|
||||||
mLastContentIsComplete = PR_FALSE;
|
mLastContentIsComplete = PR_FALSE;
|
||||||
@@ -329,7 +329,7 @@ NS_METHOD nsTableCellFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
if (gsDebug == PR_TRUE) printf("nsTableCellFrame::IncrementalReflow\n");
|
if (gsDebug == PR_TRUE) printf("nsTableCellFrame::IncrementalReflow\n");
|
||||||
// total hack for now, just some hard-coded values
|
// total hack for now, just some hard-coded values
|
||||||
|
|||||||
@@ -43,13 +43,13 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see nsContainerFrame
|
* @see nsContainerFrame
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ nsTableColGroupFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(nsnull!=aPresContext, "bad arg");
|
NS_ASSERTION(nsnull!=aPresContext, "bad arg");
|
||||||
if (gsDebug==PR_TRUE) printf("nsTableColGroupFrame::ResizeReflow\n");
|
if (gsDebug==PR_TRUE) printf("nsTableColGroupFrame::ResizeReflow\n");
|
||||||
@@ -60,7 +60,7 @@ nsTableColGroupFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
aMaxElementSize->width=0;
|
aMaxElementSize->width=0;
|
||||||
aMaxElementSize->height=0;
|
aMaxElementSize->height=0;
|
||||||
}
|
}
|
||||||
aStatus = nsIFrame::frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ nsTableColGroupFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(nsnull!=aPresContext, "bad arg");
|
NS_ASSERTION(nsnull!=aPresContext, "bad arg");
|
||||||
if (gsDebug==PR_TRUE) printf("nsTableColGroupFrame::IncrementalReflow\n");
|
if (gsDebug==PR_TRUE) printf("nsTableColGroupFrame::IncrementalReflow\n");
|
||||||
|
|||||||
@@ -43,13 +43,13 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|||||||
@@ -486,7 +486,7 @@ NS_METHOD nsTableFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
NS_PRECONDITION(nsnull != aPresContext, "null arg");
|
NS_PRECONDITION(nsnull != aPresContext, "null arg");
|
||||||
if (gsDebug==PR_TRUE)
|
if (gsDebug==PR_TRUE)
|
||||||
@@ -500,7 +500,7 @@ NS_METHOD nsTableFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
PreReflowCheck();
|
PreReflowCheck();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
PRIntervalTime startTime;
|
PRIntervalTime startTime;
|
||||||
if (gsTiming) {
|
if (gsTiming) {
|
||||||
@@ -558,10 +558,10 @@ NS_METHOD nsTableFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
* NOTE: should never get called on a continuing frame! All cached pass1 state
|
* NOTE: should never get called on a continuing frame! All cached pass1 state
|
||||||
* is stored in the inner table first-in-flow.
|
* is stored in the inner table first-in-flow.
|
||||||
*/
|
*/
|
||||||
nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresContext,
|
nsReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize)
|
nsSize* aMaxElementSize)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(nsnull!=aPresContext, "bad pres context param");
|
NS_ASSERTION(nsnull!=aPresContext, "bad pres context param");
|
||||||
NS_ASSERTION(nsnull==mPrevInFlow, "illegal call, cannot call pass 1 on a continuing frame.");
|
NS_ASSERTION(nsnull==mPrevInFlow, "illegal call, cannot call pass 1 on a continuing frame.");
|
||||||
@@ -569,7 +569,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont
|
|||||||
if (gsDebug==PR_TRUE) printf("nsTableFrame::ResizeReflow Pass1: maxSize=%d,%d\n",
|
if (gsDebug==PR_TRUE) printf("nsTableFrame::ResizeReflow Pass1: maxSize=%d,%d\n",
|
||||||
aMaxSize.width, aMaxSize.height);
|
aMaxSize.width, aMaxSize.height);
|
||||||
if (PR_TRUE==gsDebug) printf ("*** tableframe reflow pass1\t\t%d\n", this);
|
if (PR_TRUE==gsDebug) printf ("*** tableframe reflow pass1\t\t%d\n", this);
|
||||||
ReflowStatus result = frComplete;
|
nsReflowStatus result = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
mChildCount = 0;
|
mChildCount = 0;
|
||||||
mFirstContentOffset = mLastContentOffset = 0;
|
mFirstContentOffset = mLastContentOffset = 0;
|
||||||
@@ -609,7 +609,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
nsIContentPtr kid = c->ChildAt(kidIndex); // kid: REFCNT++
|
nsIContentPtr kid = c->ChildAt(kidIndex); // kid: REFCNT++
|
||||||
if (kid.IsNull()) {
|
if (kid.IsNull()) {
|
||||||
result = frComplete;
|
result = NS_FRAME_COMPLETE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -684,7 +684,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont
|
|||||||
prevKidFrame = kidFrame;
|
prevKidFrame = kidFrame;
|
||||||
mChildCount++;
|
mChildCount++;
|
||||||
|
|
||||||
if (frNotComplete == result) {
|
if (NS_FRAME_IS_NOT_COMPLETE(result)) {
|
||||||
// If the child didn't finish layout then it means that it used
|
// If the child didn't finish layout then it means that it used
|
||||||
// up all of our available space (or needs us to split).
|
// up all of our available space (or needs us to split).
|
||||||
mLastContentIsComplete = PR_FALSE;
|
mLastContentIsComplete = PR_FALSE;
|
||||||
@@ -693,7 +693,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont
|
|||||||
}
|
}
|
||||||
contentOffset++;
|
contentOffset++;
|
||||||
kidIndex++;
|
kidIndex++;
|
||||||
if (frNotComplete == result) {
|
if (NS_FRAME_IS_NOT_COMPLETE(result)) {
|
||||||
// If the child didn't finish layout then it means that it used
|
// If the child didn't finish layout then it means that it used
|
||||||
// up all of our available space (or needs us to split).
|
// up all of our available space (or needs us to split).
|
||||||
mLastContentIsComplete = PR_FALSE;
|
mLastContentIsComplete = PR_FALSE;
|
||||||
@@ -715,19 +715,19 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont
|
|||||||
|
|
||||||
/** the second of 2 reflow passes
|
/** the second of 2 reflow passes
|
||||||
*/
|
*/
|
||||||
nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresContext,
|
nsReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
PRInt32 aMinCaptionWidth,
|
PRInt32 aMinCaptionWidth,
|
||||||
PRInt32 mMaxCaptionWidth)
|
PRInt32 mMaxCaptionWidth)
|
||||||
{
|
{
|
||||||
if (PR_TRUE==gsDebug) printf ("***tableframe reflow pass2\t\t%d\n", this);
|
if (PR_TRUE==gsDebug) printf ("***tableframe reflow pass2\t\t%d\n", this);
|
||||||
if (gsDebug==PR_TRUE)
|
if (gsDebug==PR_TRUE)
|
||||||
printf("nsTableFrame::ResizeReflow Pass2: maxSize=%d,%d\n",
|
printf("nsTableFrame::ResizeReflow Pass2: maxSize=%d,%d\n",
|
||||||
aMaxSize.width, aMaxSize.height);
|
aMaxSize.width, aMaxSize.height);
|
||||||
|
|
||||||
ReflowStatus result = frComplete;
|
nsReflowStatus result = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
// now that we've computed the column width information, reflow all children
|
// now that we've computed the column width information, reflow all children
|
||||||
nsIContent* c = mContent;
|
nsIContent* c = mContent;
|
||||||
@@ -749,7 +749,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresCont
|
|||||||
}
|
}
|
||||||
|
|
||||||
PRBool reflowMappedOK = PR_TRUE;
|
PRBool reflowMappedOK = PR_TRUE;
|
||||||
ReflowStatus status = frComplete;
|
nsReflowStatus status = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
// Check for an overflow list
|
// Check for an overflow list
|
||||||
MoveOverflowToChildList();
|
MoveOverflowToChildList();
|
||||||
@@ -762,7 +762,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresCont
|
|||||||
if (nsnull != mFirstChild) {
|
if (nsnull != mFirstChild) {
|
||||||
reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize);
|
reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize);
|
||||||
if (PR_FALSE == reflowMappedOK) {
|
if (PR_FALSE == reflowMappedOK) {
|
||||||
status = frNotComplete;
|
status = 0; // not complete
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -772,7 +772,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresCont
|
|||||||
if (state.availSize.height <= 0) {
|
if (state.availSize.height <= 0) {
|
||||||
// No space left. Don't try to pull-up children or reflow unmapped
|
// No space left. Don't try to pull-up children or reflow unmapped
|
||||||
if (NextChildOffset() < mContent->ChildCount()) {
|
if (NextChildOffset() < mContent->ChildCount()) {
|
||||||
status = frNotComplete;
|
status = 0; // not complete
|
||||||
}
|
}
|
||||||
} else if (NextChildOffset() < mContent->ChildCount()) {
|
} else if (NextChildOffset() < mContent->ChildCount()) {
|
||||||
// Try and pull-up some children from a next-in-flow
|
// Try and pull-up some children from a next-in-flow
|
||||||
@@ -784,14 +784,14 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass2(nsIPresContext* aPresCont
|
|||||||
} else {
|
} else {
|
||||||
// We were unable to pull-up all the existing frames from the
|
// We were unable to pull-up all the existing frames from the
|
||||||
// next in flow
|
// next in flow
|
||||||
status = frNotComplete;
|
status = 0; // not complete
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return our size and our status
|
// Return our size and our status
|
||||||
|
|
||||||
if (frComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// Don't forget to add in the bottom margin from our last child.
|
// Don't forget to add in the bottom margin from our last child.
|
||||||
// Only add it in if there's room for it.
|
// Only add it in if there's room for it.
|
||||||
nscoord margin = state.prevMaxPosBottomMargin -
|
nscoord margin = state.prevMaxPosBottomMargin -
|
||||||
@@ -978,9 +978,9 @@ PRBool nsTableFrame::ReflowMappedChildren( nsIPresContext* aPresContext,
|
|||||||
PRBool result = PR_TRUE;
|
PRBool result = PR_TRUE;
|
||||||
|
|
||||||
for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) {
|
for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) {
|
||||||
nsSize kidAvailSize(aState.availSize);
|
nsSize kidAvailSize(aState.availSize);
|
||||||
nsReflowMetrics desiredSize;
|
nsReflowMetrics desiredSize;
|
||||||
nsIFrame::ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
// Get top margin for this kid
|
// Get top margin for this kid
|
||||||
nsIContentPtr kid;
|
nsIContentPtr kid;
|
||||||
@@ -1045,10 +1045,10 @@ PRBool nsTableFrame::ReflowMappedChildren( nsIPresContext* aPresContext,
|
|||||||
prevKidFrame = kidFrame;
|
prevKidFrame = kidFrame;
|
||||||
|
|
||||||
// Update mLastContentIsComplete now that this kid fits
|
// Update mLastContentIsComplete now that this kid fits
|
||||||
mLastContentIsComplete = PRBool(status == frComplete);
|
mLastContentIsComplete = PRBool(NS_FRAME_IS_COMPLETE(status));
|
||||||
|
|
||||||
// Special handling for incomplete children
|
// Special handling for incomplete children
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
kidFrame->GetNextInFlow(kidNextInFlow);
|
kidFrame->GetNextInFlow(kidNextInFlow);
|
||||||
@@ -1189,7 +1189,7 @@ PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
while (nsnull != nextInFlow) {
|
while (nsnull != nextInFlow) {
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
// Get the next child
|
// Get the next child
|
||||||
nsIFrame* kidFrame = nextInFlow->mFirstChild;
|
nsIFrame* kidFrame = nextInFlow->mFirstChild;
|
||||||
@@ -1277,8 +1277,8 @@ PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
prevLastContentIsComplete = mLastContentIsComplete;
|
prevLastContentIsComplete = mLastContentIsComplete;
|
||||||
|
|
||||||
// Is the child we just pulled up complete?
|
// Is the child we just pulled up complete?
|
||||||
mLastContentIsComplete = PRBool(status == frComplete);
|
mLastContentIsComplete = PRBool(NS_FRAME_IS_COMPLETE(status));
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// No the child isn't complete
|
// No the child isn't complete
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
@@ -1360,7 +1360,7 @@ PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
* @return frComplete if all content has been mapped and frNotComplete
|
* @return frComplete if all content has been mapped and frNotComplete
|
||||||
* if we should be continued
|
* if we should be continued
|
||||||
*/
|
*/
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
||||||
InnerTableReflowState& aState,
|
InnerTableReflowState& aState,
|
||||||
nsSize* aMaxElementSize)
|
nsSize* aMaxElementSize)
|
||||||
@@ -1369,7 +1369,7 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
VerifyLastIsComplete();
|
VerifyLastIsComplete();
|
||||||
#endif
|
#endif
|
||||||
nsIFrame* kidPrevInFlow = nsnull;
|
nsIFrame* kidPrevInFlow = nsnull;
|
||||||
ReflowStatus result = frNotComplete;
|
nsReflowStatus result = 0; // not complete
|
||||||
|
|
||||||
// If we have no children and we have a prev-in-flow then we need to pick
|
// If we have no children and we have a prev-in-flow then we need to pick
|
||||||
// up where it left off. If we have children, e.g. we're being resized, then
|
// up where it left off. If we have children, e.g. we're being resized, then
|
||||||
@@ -1397,7 +1397,7 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
// Get the next content object
|
// Get the next content object
|
||||||
nsIContentPtr kid = mContent->ChildAt(kidIndex);
|
nsIContentPtr kid = mContent->ChildAt(kidIndex);
|
||||||
if (kid.IsNull()) {
|
if (kid.IsNull()) {
|
||||||
result = frComplete;
|
result = NS_FRAME_COMPLETE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1429,7 +1429,7 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
// Try to reflow the child into the available space. It might not
|
// Try to reflow the child into the available space. It might not
|
||||||
// fit or might need continuing.
|
// fit or might need continuing.
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
ReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize,
|
nsReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize,
|
||||||
aState.availSize, pKidMaxElementSize);
|
aState.availSize, pKidMaxElementSize);
|
||||||
|
|
||||||
// Did the child fit?
|
// Did the child fit?
|
||||||
@@ -1465,7 +1465,7 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
kidIndex++;
|
kidIndex++;
|
||||||
|
|
||||||
// Did the child complete?
|
// Did the child complete?
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// If the child isn't complete then it means that we've used up
|
// If the child isn't complete then it means that we've used up
|
||||||
// all of our available space
|
// all of our available space
|
||||||
mLastContentIsComplete = PR_FALSE;
|
mLastContentIsComplete = PR_FALSE;
|
||||||
@@ -1860,7 +1860,7 @@ NS_METHOD nsTableFrame::IncrementalReflow(nsIPresContext* aCX,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(nsnull != aCX, "bad arg");
|
NS_ASSERTION(nsnull != aCX, "bad arg");
|
||||||
if (gsDebug==PR_TRUE) printf ("nsTableFrame::IncrementalReflow: maxSize=%d,%d\n",
|
if (gsDebug==PR_TRUE) printf ("nsTableFrame::IncrementalReflow: maxSize=%d,%d\n",
|
||||||
@@ -1870,7 +1870,7 @@ NS_METHOD nsTableFrame::IncrementalReflow(nsIPresContext* aCX,
|
|||||||
|
|
||||||
aDesiredSize.width = mRect.width;
|
aDesiredSize.width = mRect.width;
|
||||||
aDesiredSize.height = mRect.height;
|
aDesiredSize.height = mRect.height;
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,14 +85,14 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
/** @see nsIFrame::IncrementalReflow */
|
/** @see nsIFrame::IncrementalReflow */
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
/** @see nsContainerFrame::CreateContinuingFrame */
|
/** @see nsContainerFrame::CreateContinuingFrame */
|
||||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||||
@@ -191,10 +191,10 @@ protected:
|
|||||||
*
|
*
|
||||||
* @see ResizeReflow
|
* @see ResizeReflow
|
||||||
*/
|
*/
|
||||||
virtual ReflowStatus ResizeReflowPass1(nsIPresContext* aPresContext,
|
virtual nsReflowStatus ResizeReflowPass1(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize);
|
nsSize* aMaxElementSize);
|
||||||
|
|
||||||
/** second pass of ResizeReflow.
|
/** second pass of ResizeReflow.
|
||||||
* lays out all table content with aMaxSize(computed_table_width, given_table_height)
|
* lays out all table content with aMaxSize(computed_table_width, given_table_height)
|
||||||
@@ -207,12 +207,12 @@ protected:
|
|||||||
* @see ResizeReflow
|
* @see ResizeReflow
|
||||||
* @see NeedsReflow
|
* @see NeedsReflow
|
||||||
*/
|
*/
|
||||||
virtual ReflowStatus ResizeReflowPass2(nsIPresContext* aPresContext,
|
virtual nsReflowStatus ResizeReflowPass2(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
PRInt32 aMinCaptionWidth,
|
PRInt32 aMinCaptionWidth,
|
||||||
PRInt32 mMaxCaptionWidth);
|
PRInt32 mMaxCaptionWidth);
|
||||||
|
|
||||||
nscoord GetTopMarginFor(nsIPresContext* aCX,
|
nscoord GetTopMarginFor(nsIPresContext* aCX,
|
||||||
InnerTableReflowState& aState,
|
InnerTableReflowState& aState,
|
||||||
@@ -256,9 +256,9 @@ protected:
|
|||||||
* @return frComplete if all content has been mapped and frNotComplete
|
* @return frComplete if all content has been mapped and frNotComplete
|
||||||
* if we should be continued
|
* if we should be continued
|
||||||
*/
|
*/
|
||||||
ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
nsReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
||||||
InnerTableReflowState& aState,
|
InnerTableReflowState& aState,
|
||||||
nsSize* aMaxElementSize);
|
nsSize* aMaxElementSize);
|
||||||
|
|
||||||
|
|
||||||
/** assign widths for each column, taking into account the table content, the effective style,
|
/** assign widths for each column, taking into account the table content, the effective style,
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
if (PR_TRUE==gsDebug)
|
if (PR_TRUE==gsDebug)
|
||||||
printf ("***table outer frame reflow \t\t%p\n", this);
|
printf ("***table outer frame reflow \t\t%p\n", this);
|
||||||
@@ -187,7 +187,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
PRBool reflowMappedOK = PR_TRUE;
|
PRBool reflowMappedOK = PR_TRUE;
|
||||||
|
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
nsSize innerTableMaxElementSize(0,0);
|
nsSize innerTableMaxElementSize(0,0);
|
||||||
|
|
||||||
// Set up our kids. They're already present, on an overflow list,
|
// Set up our kids. They're already present, on an overflow list,
|
||||||
@@ -204,7 +204,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
NS_ASSERTION(nsnull!=mInnerTableFrame, "no mInnerTableFrame");
|
NS_ASSERTION(nsnull!=mInnerTableFrame, "no mInnerTableFrame");
|
||||||
if (nsnull==mFirstChild || nsnull==mInnerTableFrame) {
|
if (nsnull==mFirstChild || nsnull==mInnerTableFrame) {
|
||||||
//ERROR!
|
//ERROR!
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,7 +260,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
if (nsnull != mFirstChild) {
|
if (nsnull != mFirstChild) {
|
||||||
reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize);
|
reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize);
|
||||||
if (PR_FALSE == reflowMappedOK) {
|
if (PR_FALSE == reflowMappedOK) {
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,7 +270,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
if (state.availSize.height <= 0) {
|
if (state.availSize.height <= 0) {
|
||||||
// No space left. Don't try to pull-up children or reflow unmapped
|
// No space left. Don't try to pull-up children or reflow unmapped
|
||||||
if (NextChildOffset() < mContent->ChildCount()) {
|
if (NextChildOffset() < mContent->ChildCount()) {
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
} else if (NextChildOffset() < mContent->ChildCount()) {
|
} else if (NextChildOffset() < mContent->ChildCount()) {
|
||||||
// Try and pull-up some children from a next-in-flow
|
// Try and pull-up some children from a next-in-flow
|
||||||
@@ -279,12 +279,12 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
NS_ABORT(); // huge error for tables!
|
NS_ABORT(); // huge error for tables!
|
||||||
} else {
|
} else {
|
||||||
// We were unable to pull-up all the existing frames from the next in flow
|
// We were unable to pull-up all the existing frames from the next in flow
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frComplete == aStatus) {
|
if (NS_FRAME_IS_COMPLETE(aStatus)) {
|
||||||
// Don't forget to add in the bottom margin from our last child.
|
// Don't forget to add in the bottom margin from our last child.
|
||||||
// Only add it in if there's room for it.
|
// Only add it in if there's room for it.
|
||||||
nscoord margin = state.prevMaxPosBottomMargin -
|
nscoord margin = state.prevMaxPosBottomMargin -
|
||||||
@@ -301,7 +301,7 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
/* if we're incomplete, take up all the remaining height so we don't waste time
|
/* if we're incomplete, take up all the remaining height so we don't waste time
|
||||||
* trying to lay out in a slot that we know isn't tall enough to fit our minimum.
|
* trying to lay out in a slot that we know isn't tall enough to fit our minimum.
|
||||||
* otherwise, we're as tall as our kids want us to be */
|
* otherwise, we're as tall as our kids want us to be */
|
||||||
if (frNotComplete == aStatus)
|
if (NS_FRAME_IS_NOT_COMPLETE(aStatus))
|
||||||
aDesiredSize.height = aMaxSize.height;
|
aDesiredSize.height = aMaxSize.height;
|
||||||
else
|
else
|
||||||
aDesiredSize.height = state.y;
|
aDesiredSize.height = state.y;
|
||||||
@@ -310,12 +310,12 @@ NS_METHOD nsTableOuterFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
{
|
{
|
||||||
if (nsnull!=aMaxElementSize)
|
if (nsnull!=aMaxElementSize)
|
||||||
printf("Outer frame Reflow complete, returning %s with aDesiredSize = %d,%d and aMaxElementSize=%d,%d\n",
|
printf("Outer frame Reflow complete, returning %s with aDesiredSize = %d,%d and aMaxElementSize=%d,%d\n",
|
||||||
aStatus==frComplete ? "Complete" : "Not Complete",
|
NS_FRAME_IS_COMPLETE(aStatus)? "Complete" : "Not Complete",
|
||||||
aDesiredSize.width, aDesiredSize.height,
|
aDesiredSize.width, aDesiredSize.height,
|
||||||
aMaxElementSize->width, aMaxElementSize->height);
|
aMaxElementSize->width, aMaxElementSize->height);
|
||||||
else
|
else
|
||||||
printf("Outer frame Reflow complete, returning %s with aDesiredSize = %d,%d and NSNULL aMaxElementSize\n",
|
printf("Outer frame Reflow complete, returning %s with aDesiredSize = %d,%d and NSNULL aMaxElementSize\n",
|
||||||
aStatus==frComplete ? "Complete" : "Not Complete",
|
NS_FRAME_IS_COMPLETE(aStatus)? "Complete" : "Not Complete",
|
||||||
aDesiredSize.width, aDesiredSize.height);
|
aDesiredSize.width, aDesiredSize.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -449,8 +449,8 @@ PRBool nsTableOuterFrame::ReflowMappedChildren( nsIPresContext* aPresContex
|
|||||||
PRBool result = PR_TRUE;
|
PRBool result = PR_TRUE;
|
||||||
aState.availSize.width = aState.innerTableMaxSize.width;
|
aState.availSize.width = aState.innerTableMaxSize.width;
|
||||||
for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) {
|
for (nsIFrame* kidFrame = mFirstChild; nsnull != kidFrame; ) {
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
nsIFrame::ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
SetReflowState(aState, kidFrame);
|
SetReflowState(aState, kidFrame);
|
||||||
|
|
||||||
@@ -517,9 +517,9 @@ PRBool nsTableOuterFrame::ReflowMappedChildren( nsIPresContext* aPresContex
|
|||||||
prevKidFrame = kidFrame;
|
prevKidFrame = kidFrame;
|
||||||
|
|
||||||
// Update mLastContentIsComplete now that this kid fits
|
// Update mLastContentIsComplete now that this kid fits
|
||||||
mLastContentIsComplete = PRBool(status == frComplete);
|
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status);
|
||||||
|
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// No, the child isn't complete
|
// No, the child isn't complete
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
@@ -670,8 +670,8 @@ PRBool nsTableOuterFrame::PullUpChildren( nsIPresContext* aPresContext,
|
|||||||
PRBool result = PR_TRUE;
|
PRBool result = PR_TRUE;
|
||||||
|
|
||||||
while (nsnull != nextInFlow) {
|
while (nsnull != nextInFlow) {
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
// Get the next child
|
// Get the next child
|
||||||
nsIFrame* kidFrame = nextInFlow->mFirstChild;
|
nsIFrame* kidFrame = nextInFlow->mFirstChild;
|
||||||
@@ -756,8 +756,8 @@ PRBool nsTableOuterFrame::PullUpChildren( nsIPresContext* aPresContext,
|
|||||||
prevLastContentIsComplete = mLastContentIsComplete;
|
prevLastContentIsComplete = mLastContentIsComplete;
|
||||||
|
|
||||||
// Is the child we just pulled up complete?
|
// Is the child we just pulled up complete?
|
||||||
mLastContentIsComplete = PRBool(status == frComplete);
|
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status);
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// No the child isn't complete
|
// No the child isn't complete
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
@@ -875,7 +875,7 @@ void nsTableOuterFrame::SetReflowState(OuterTableReflowState& aState, nsIFrame*
|
|||||||
* child is complete and it has next-in-flows (it was a splittable child)
|
* child is complete and it has next-in-flows (it was a splittable child)
|
||||||
* then delete the next-in-flows.
|
* then delete the next-in-flows.
|
||||||
*/
|
*/
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
nsTableOuterFrame::ReflowChild( nsIFrame* aKidFrame,
|
nsTableOuterFrame::ReflowChild( nsIFrame* aKidFrame,
|
||||||
nsIPresContext* aPresContext,
|
nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
@@ -883,7 +883,7 @@ nsTableOuterFrame::ReflowChild( nsIFrame* aKidFrame,
|
|||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
OuterTableReflowState& aState)
|
OuterTableReflowState& aState)
|
||||||
{
|
{
|
||||||
ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
/* call the appropriate reflow method based on the type and position of the child */
|
/* call the appropriate reflow method based on the type and position of the child */
|
||||||
if (PR_TRUE==aState.processingCaption)
|
if (PR_TRUE==aState.processingCaption)
|
||||||
@@ -922,7 +922,7 @@ nsTableOuterFrame::ReflowChild( nsIFrame* aKidFrame,
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frComplete == status) {
|
if (NS_FRAME_IS_COMPLETE(status)) {
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
aKidFrame->GetNextInFlow(kidNextInFlow);
|
aKidFrame->GetNextInFlow(kidNextInFlow);
|
||||||
@@ -1017,7 +1017,7 @@ void nsTableOuterFrame::CreateChildFrames(nsIPresContext* aPresContext)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
nsTableOuterFrame::ResizeReflowCaptionsPass1(nsIPresContext* aPresContext)
|
nsTableOuterFrame::ResizeReflowCaptionsPass1(nsIPresContext* aPresContext)
|
||||||
{
|
{
|
||||||
if (nsnull!=mCaptionFrames)
|
if (nsnull!=mCaptionFrames)
|
||||||
@@ -1029,7 +1029,7 @@ nsTableOuterFrame::ResizeReflowCaptionsPass1(nsIPresContext* aPresContext)
|
|||||||
nsSize maxSize(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
|
nsSize maxSize(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE);
|
||||||
nsReflowMetrics desiredSize;
|
nsReflowMetrics desiredSize;
|
||||||
nsTableCaptionFrame *captionFrame = (nsTableCaptionFrame *)mCaptionFrames->ElementAt(captionIndex);
|
nsTableCaptionFrame *captionFrame = (nsTableCaptionFrame *)mCaptionFrames->ElementAt(captionIndex);
|
||||||
ReflowStatus status;
|
nsReflowStatus status;
|
||||||
captionFrame->ResizeReflow(aPresContext, desiredSize, maxSize, &maxElementSize, status);
|
captionFrame->ResizeReflow(aPresContext, desiredSize, maxSize, &maxElementSize, status);
|
||||||
if (mMinCaptionWidth<maxElementSize.width)
|
if (mMinCaptionWidth<maxElementSize.width)
|
||||||
mMinCaptionWidth = maxElementSize.width;
|
mMinCaptionWidth = maxElementSize.width;
|
||||||
@@ -1039,16 +1039,16 @@ nsTableOuterFrame::ResizeReflowCaptionsPass1(nsIPresContext* aPresContext)
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return frComplete;
|
return NS_FRAME_COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
nsTableOuterFrame::ResizeReflowTopCaptionsPass2(nsIPresContext* aPresContext,
|
nsTableOuterFrame::ResizeReflowTopCaptionsPass2(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize)
|
nsSize* aMaxElementSize)
|
||||||
{
|
{
|
||||||
ReflowStatus result = frComplete;
|
nsReflowStatus result = NS_FRAME_COMPLETE;
|
||||||
nscoord topCaptionY = 0;
|
nscoord topCaptionY = 0;
|
||||||
if (nsnull!=mCaptionFrames)
|
if (nsnull!=mCaptionFrames)
|
||||||
{
|
{
|
||||||
@@ -1074,7 +1074,7 @@ nsTableOuterFrame::ResizeReflowTopCaptionsPass2(nsIPresContext* aPresContext,
|
|||||||
else
|
else
|
||||||
{ // top-align captions, the default
|
{ // top-align captions, the default
|
||||||
// reflow the caption, skipping top captions after the first that doesn't fit
|
// reflow the caption, skipping top captions after the first that doesn't fit
|
||||||
if (frComplete==result)
|
if (NS_FRAME_IS_COMPLETE(result))
|
||||||
{
|
{
|
||||||
nsReflowMetrics desiredSize;
|
nsReflowMetrics desiredSize;
|
||||||
result = nsContainerFrame::ReflowChild(captionFrame, aPresContext, desiredSize, aMaxSize, nsnull);
|
result = nsContainerFrame::ReflowChild(captionFrame, aPresContext, desiredSize, aMaxSize, nsnull);
|
||||||
@@ -1108,14 +1108,14 @@ nsTableOuterFrame::ResizeReflowTopCaptionsPass2(nsIPresContext* aPresContext,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
nsTableOuterFrame::ResizeReflowBottomCaptionsPass2(nsIPresContext* aPresContext,
|
nsTableOuterFrame::ResizeReflowBottomCaptionsPass2(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
nscoord aYOffset)
|
nscoord aYOffset)
|
||||||
{
|
{
|
||||||
ReflowStatus result = frComplete;
|
nsReflowStatus result = NS_FRAME_COMPLETE;
|
||||||
nscoord bottomCaptionY = aYOffset;
|
nscoord bottomCaptionY = aYOffset;
|
||||||
// for now, assume all captions are stacked vertically
|
// for now, assume all captions are stacked vertically
|
||||||
if (nsnull!=mBottomCaptions)
|
if (nsnull!=mBottomCaptions)
|
||||||
@@ -1199,7 +1199,7 @@ nsTableOuterFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
if (PR_TRUE==gsDebug) printf("nsTableOuterFrame::IncrementalReflow\n");
|
if (PR_TRUE==gsDebug) printf("nsTableOuterFrame::IncrementalReflow\n");
|
||||||
// total hack for now, just some hard-coded values
|
// total hack for now, just some hard-coded values
|
||||||
|
|||||||
@@ -87,14 +87,14 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
/** @see nsIFrame::IncrementalReflow */
|
/** @see nsIFrame::IncrementalReflow */
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
/** @see nsContainerFrame */
|
/** @see nsContainerFrame */
|
||||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||||
@@ -134,13 +134,13 @@ protected:
|
|||||||
|
|
||||||
/** reflow the captions in an infinite space, caching the min/max sizes for each
|
/** reflow the captions in an infinite space, caching the min/max sizes for each
|
||||||
*/
|
*/
|
||||||
virtual ReflowStatus ResizeReflowCaptionsPass1(nsIPresContext* aPresContext);
|
virtual nsReflowStatus ResizeReflowCaptionsPass1(nsIPresContext* aPresContext);
|
||||||
|
|
||||||
/** reflow the top captions in a space constrained by the computed table width
|
/** reflow the top captions in a space constrained by the computed table width
|
||||||
* and the heigth given to us by our parent. Top captions are laid down
|
* and the heigth given to us by our parent. Top captions are laid down
|
||||||
* before the inner table.
|
* before the inner table.
|
||||||
*/
|
*/
|
||||||
virtual ReflowStatus ResizeReflowTopCaptionsPass2(nsIPresContext* aPresContext,
|
virtual nsReflowStatus ResizeReflowTopCaptionsPass2(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize);
|
nsSize* aMaxElementSize);
|
||||||
@@ -149,11 +149,11 @@ protected:
|
|||||||
* and the heigth given to us by our parent. Bottom captions are laid down
|
* and the heigth given to us by our parent. Bottom captions are laid down
|
||||||
* after the inner table.
|
* after the inner table.
|
||||||
*/
|
*/
|
||||||
virtual ReflowStatus ResizeReflowBottomCaptionsPass2(nsIPresContext* aPresContext,
|
virtual nsReflowStatus ResizeReflowBottomCaptionsPass2(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
nscoord aYOffset);
|
nscoord aYOffset);
|
||||||
|
|
||||||
nscoord GetTopMarginFor(nsIPresContext* aCX,
|
nscoord GetTopMarginFor(nsIPresContext* aCX,
|
||||||
OuterTableReflowState& aState,
|
OuterTableReflowState& aState,
|
||||||
@@ -192,12 +192,12 @@ protected:
|
|||||||
virtual void SetReflowState(OuterTableReflowState& aState,
|
virtual void SetReflowState(OuterTableReflowState& aState,
|
||||||
nsIFrame* aKidFrame);
|
nsIFrame* aKidFrame);
|
||||||
|
|
||||||
virtual nsIFrame::ReflowStatus ReflowChild( nsIFrame* aKidFrame,
|
virtual nsReflowStatus ReflowChild( nsIFrame* aKidFrame,
|
||||||
nsIPresContext* aPresContext,
|
nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
OuterTableReflowState& aState);
|
OuterTableReflowState& aState);
|
||||||
|
|
||||||
/** overridden here to handle special caption-table relationship
|
/** overridden here to handle special caption-table relationship
|
||||||
* @see nsContainerFrame::VerifyTree
|
* @see nsContainerFrame::VerifyTree
|
||||||
|
|||||||
@@ -273,8 +273,8 @@ PRBool nsTableRowFrame::ReflowMappedChildren(nsIPresContext* aPresContext,
|
|||||||
nsSize kidAvailSize(aState.availSize);
|
nsSize kidAvailSize(aState.availSize);
|
||||||
if (0>=kidAvailSize.height)
|
if (0>=kidAvailSize.height)
|
||||||
kidAvailSize.height = 1; // XXX: HaCk - we don't handle negative heights yet
|
kidAvailSize.height = 1; // XXX: HaCk - we don't handle negative heights yet
|
||||||
nsReflowMetrics desiredSize;
|
nsReflowMetrics desiredSize;
|
||||||
nsIFrame::ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
// Get top margin for this kid
|
// Get top margin for this kid
|
||||||
nsIStyleContext* kidSC;
|
nsIStyleContext* kidSC;
|
||||||
@@ -322,12 +322,12 @@ PRBool nsTableRowFrame::ReflowMappedChildren(nsIPresContext* aPresContext,
|
|||||||
{
|
{
|
||||||
if (nsnull!=pKidMaxElementSize)
|
if (nsnull!=pKidMaxElementSize)
|
||||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
|
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
|
||||||
status==frComplete?"complete":"NOT complete",
|
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||||
desiredSize.width, desiredSize.height,
|
desiredSize.width, desiredSize.height,
|
||||||
pKidMaxElementSize->width, pKidMaxElementSize->height);
|
pKidMaxElementSize->width, pKidMaxElementSize->height);
|
||||||
else
|
else
|
||||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n",
|
printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n",
|
||||||
status==frComplete?"complete":"NOT complete",
|
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||||
desiredSize.width, desiredSize.height);
|
desiredSize.width, desiredSize.height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -372,7 +372,7 @@ PRBool nsTableRowFrame::ReflowMappedChildren(nsIPresContext* aPresContext,
|
|||||||
prevKidFrame = kidFrame;
|
prevKidFrame = kidFrame;
|
||||||
|
|
||||||
// Update mLastContentIsComplete now that this kid fits
|
// Update mLastContentIsComplete now that this kid fits
|
||||||
mLastContentIsComplete = PRBool(status == frComplete);
|
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status);
|
||||||
|
|
||||||
/* Rows should not create continuing frames for cells
|
/* Rows should not create continuing frames for cells
|
||||||
* unless they absolutely have to!
|
* unless they absolutely have to!
|
||||||
@@ -380,7 +380,7 @@ PRBool nsTableRowFrame::ReflowMappedChildren(nsIPresContext* aPresContext,
|
|||||||
* otherwise PushChildren and bail.
|
* otherwise PushChildren and bail.
|
||||||
*/
|
*/
|
||||||
// Special handling for incomplete children
|
// Special handling for incomplete children
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// XXX It's good to assume that we might still have room
|
// XXX It's good to assume that we might still have room
|
||||||
// even if the child didn't complete (floaters will want this)
|
// even if the child didn't complete (floaters will want this)
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
@@ -530,7 +530,7 @@ PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
while (nsnull != nextInFlow) {
|
while (nsnull != nextInFlow) {
|
||||||
nsReflowMetrics desiredSize;
|
nsReflowMetrics desiredSize;
|
||||||
ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
// Get the next child
|
// Get the next child
|
||||||
nsIFrame* kidFrame = nextInFlow->mFirstChild;
|
nsIFrame* kidFrame = nextInFlow->mFirstChild;
|
||||||
@@ -586,12 +586,12 @@ PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
{
|
{
|
||||||
if (nsnull!=pKidMaxElementSize)
|
if (nsnull!=pKidMaxElementSize)
|
||||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
|
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
|
||||||
status==frComplete?"complete":"NOT complete",
|
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||||
desiredSize.width, desiredSize.height,
|
desiredSize.width, desiredSize.height,
|
||||||
pKidMaxElementSize->width, pKidMaxElementSize->height);
|
pKidMaxElementSize->width, pKidMaxElementSize->height);
|
||||||
else
|
else
|
||||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n",
|
printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n",
|
||||||
status==frComplete?"complete":"NOT complete",
|
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||||
desiredSize.width, desiredSize.height);
|
desiredSize.width, desiredSize.height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -646,8 +646,8 @@ PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
prevLastContentIsComplete = mLastContentIsComplete;
|
prevLastContentIsComplete = mLastContentIsComplete;
|
||||||
|
|
||||||
// Is the child we just pulled up complete?
|
// Is the child we just pulled up complete?
|
||||||
mLastContentIsComplete = PRBool(status == frComplete);
|
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status);
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// No the child isn't complete
|
// No the child isn't complete
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
@@ -746,10 +746,10 @@ PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
*
|
*
|
||||||
* @param aPresContext presentation context to use
|
* @param aPresContext presentation context to use
|
||||||
* @param aState current inline state
|
* @param aState current inline state
|
||||||
* @return frComplete if all content has been mapped and frNotComplete
|
* @return NS_FRAME_COMPLETE if all content has been mapped and NS_FRAME_NOT_COMPLETE
|
||||||
* if we should be continued
|
* if we should be continued
|
||||||
*/
|
*/
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext,
|
nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsSize* aMaxElementSize)
|
nsSize* aMaxElementSize)
|
||||||
@@ -758,7 +758,7 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext,
|
|||||||
VerifyLastIsComplete();
|
VerifyLastIsComplete();
|
||||||
#endif
|
#endif
|
||||||
nsIFrame* kidPrevInFlow = nsnull;
|
nsIFrame* kidPrevInFlow = nsnull;
|
||||||
ReflowStatus result = frNotComplete;
|
nsReflowStatus result = 0; // not complete
|
||||||
|
|
||||||
// If we have no children and we have a prev-in-flow then we need to pick
|
// If we have no children and we have a prev-in-flow then we need to pick
|
||||||
// up where it left off. If we have children, e.g. we're being resized, then
|
// up where it left off. If we have children, e.g. we're being resized, then
|
||||||
@@ -789,13 +789,13 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext,
|
|||||||
// Get the next content object
|
// Get the next content object
|
||||||
nsIContent* cell = mContent->ChildAt(kidIndex);
|
nsIContent* cell = mContent->ChildAt(kidIndex);
|
||||||
if (nsnull == cell) {
|
if (nsnull == cell) {
|
||||||
result = frComplete;
|
result = NS_FRAME_COMPLETE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure we still have room left
|
// Make sure we still have room left
|
||||||
if (aState.availSize.height <= 0) {
|
if (aState.availSize.height <= 0) {
|
||||||
// Note: return status was set to frNotComplete above...
|
// Note: return status was set to NS_FRAME_NOT_COMPLETE above...
|
||||||
NS_RELEASE(cell); // cell: REFCNT--(a)
|
NS_RELEASE(cell); // cell: REFCNT--(a)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -826,7 +826,7 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext,
|
|||||||
// Try to reflow the child into the available space. It might not
|
// Try to reflow the child into the available space. It might not
|
||||||
// fit or might need continuing.
|
// fit or might need continuing.
|
||||||
nsReflowMetrics desiredSize;
|
nsReflowMetrics desiredSize;
|
||||||
ReflowStatus status;
|
nsReflowStatus status;
|
||||||
if (NS_UNCONSTRAINEDSIZE == aState.availSize.width)
|
if (NS_UNCONSTRAINEDSIZE == aState.availSize.width)
|
||||||
{
|
{
|
||||||
// Reflow the child into the available space
|
// Reflow the child into the available space
|
||||||
@@ -854,12 +854,12 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext,
|
|||||||
{
|
{
|
||||||
if (nsnull!=pKidMaxElementSize)
|
if (nsnull!=pKidMaxElementSize)
|
||||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
|
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
|
||||||
status==frComplete?"complete":"NOT complete",
|
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||||
desiredSize.width, desiredSize.height,
|
desiredSize.width, desiredSize.height,
|
||||||
pKidMaxElementSize->width, pKidMaxElementSize->height);
|
pKidMaxElementSize->width, pKidMaxElementSize->height);
|
||||||
else
|
else
|
||||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n",
|
printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n",
|
||||||
status==frComplete?"complete":"NOT complete",
|
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||||
desiredSize.width, desiredSize.height);
|
desiredSize.width, desiredSize.height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -900,7 +900,7 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext,
|
|||||||
kidIndex++;
|
kidIndex++;
|
||||||
|
|
||||||
// Did the child complete?
|
// Did the child complete?
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// If the child isn't complete then it means that we've used up
|
// If the child isn't complete then it means that we've used up
|
||||||
// all of our available space
|
// all of our available space
|
||||||
mLastContentIsComplete = PR_FALSE;
|
mLastContentIsComplete = PR_FALSE;
|
||||||
@@ -934,7 +934,7 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
if (gsDebug1==PR_TRUE)
|
if (gsDebug1==PR_TRUE)
|
||||||
printf("nsTableRowFrame::ResizeReflow - aMaxSize = %d, %d\n",
|
printf("nsTableRowFrame::ResizeReflow - aMaxSize = %d, %d\n",
|
||||||
@@ -954,7 +954,7 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
PRBool reflowMappedOK = PR_TRUE;
|
PRBool reflowMappedOK = PR_TRUE;
|
||||||
|
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
// Check for an overflow list
|
// Check for an overflow list
|
||||||
MoveOverflowToChildList();
|
MoveOverflowToChildList();
|
||||||
@@ -966,7 +966,7 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
if (nsnull != mFirstChild) {
|
if (nsnull != mFirstChild) {
|
||||||
reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize);
|
reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize);
|
||||||
if (PR_FALSE == reflowMappedOK) {
|
if (PR_FALSE == reflowMappedOK) {
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -976,7 +976,7 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
if (state.availSize.height <= 0) {
|
if (state.availSize.height <= 0) {
|
||||||
// No space left. Don't try to pull-up children or reflow unmapped
|
// No space left. Don't try to pull-up children or reflow unmapped
|
||||||
if (NextChildOffset() < mContent->ChildCount()) {
|
if (NextChildOffset() < mContent->ChildCount()) {
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
} else if (NextChildOffset() < mContent->ChildCount()) {
|
} else if (NextChildOffset() < mContent->ChildCount()) {
|
||||||
// Try and pull-up some children from a next-in-flow
|
// Try and pull-up some children from a next-in-flow
|
||||||
@@ -988,12 +988,12 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
} else {
|
} else {
|
||||||
// We were unable to pull-up all the existing frames from the
|
// We were unable to pull-up all the existing frames from the
|
||||||
// next in flow
|
// next in flow
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frComplete == aStatus) {
|
if (NS_FRAME_IS_COMPLETE(aStatus)) {
|
||||||
// Don't forget to add in the bottom margin from our last child.
|
// Don't forget to add in the bottom margin from our last child.
|
||||||
// Only add it in if there's room for it.
|
// Only add it in if there's room for it.
|
||||||
nscoord margin = state.prevMaxPosBottomMargin -
|
nscoord margin = state.prevMaxPosBottomMargin -
|
||||||
@@ -1012,12 +1012,12 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
|
|||||||
{
|
{
|
||||||
if (nsnull!=aMaxElementSize)
|
if (nsnull!=aMaxElementSize)
|
||||||
printf("nsTableRowFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=%d,%d\n",
|
printf("nsTableRowFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=%d,%d\n",
|
||||||
aStatus==frComplete?"Complete":"Not Complete",
|
NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete",
|
||||||
aDesiredSize.width, aDesiredSize.height,
|
aDesiredSize.width, aDesiredSize.height,
|
||||||
aMaxElementSize->width, aMaxElementSize->height);
|
aMaxElementSize->width, aMaxElementSize->height);
|
||||||
else
|
else
|
||||||
printf("nsTableRowFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=NSNULL\n",
|
printf("nsTableRowFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=NSNULL\n",
|
||||||
aStatus==frComplete?"Complete":"Not Complete",
|
NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete",
|
||||||
aDesiredSize.width, aDesiredSize.height);
|
aDesiredSize.width, aDesiredSize.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1030,10 +1030,10 @@ nsTableRowFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
if (gsDebug1==PR_TRUE) printf("nsTableRowFrame::IncrementalReflow\n");
|
if (gsDebug1==PR_TRUE) printf("nsTableRowFrame::IncrementalReflow\n");
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,14 +81,14 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
/** @see nsIFrame::IncrementalReflow */
|
/** @see nsIFrame::IncrementalReflow */
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
/** @see nsContainerFrame::CreateContinuingFrame */
|
/** @see nsContainerFrame::CreateContinuingFrame */
|
||||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||||
@@ -159,9 +159,9 @@ protected:
|
|||||||
* @return frComplete if all content has been mapped and frNotComplete
|
* @return frComplete if all content has been mapped and frNotComplete
|
||||||
* if we should be continued
|
* if we should be continued
|
||||||
*/
|
*/
|
||||||
ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
nsReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
||||||
RowReflowState& aState,
|
RowReflowState& aState,
|
||||||
nsSize* aMaxElementSize);
|
nsSize* aMaxElementSize);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -270,8 +270,8 @@ PRBool nsTableRowGroupFrame::ReflowMappedChildren( nsIPresContext* aPresCon
|
|||||||
nsSize kidAvailSize(aState.availSize);
|
nsSize kidAvailSize(aState.availSize);
|
||||||
if (0>=kidAvailSize.height)
|
if (0>=kidAvailSize.height)
|
||||||
kidAvailSize.height = 1; // XXX: HaCk - we don't handle negative heights yet
|
kidAvailSize.height = 1; // XXX: HaCk - we don't handle negative heights yet
|
||||||
nsReflowMetrics desiredSize;
|
nsReflowMetrics desiredSize;
|
||||||
nsIFrame::ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
// Get top margin for this kid
|
// Get top margin for this kid
|
||||||
nsIContentPtr kid;
|
nsIContentPtr kid;
|
||||||
@@ -340,7 +340,7 @@ PRBool nsTableRowGroupFrame::ReflowMappedChildren( nsIPresContext* aPresCon
|
|||||||
prevKidFrame = kidFrame;
|
prevKidFrame = kidFrame;
|
||||||
|
|
||||||
// Update mLastContentIsComplete now that this kid fits
|
// Update mLastContentIsComplete now that this kid fits
|
||||||
mLastContentIsComplete = PRBool(status == frComplete);
|
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status);
|
||||||
|
|
||||||
/* Row groups should not create continuing frames for rows
|
/* Row groups should not create continuing frames for rows
|
||||||
* unless they absolutely have to!
|
* unless they absolutely have to!
|
||||||
@@ -348,7 +348,7 @@ PRBool nsTableRowGroupFrame::ReflowMappedChildren( nsIPresContext* aPresCon
|
|||||||
* otherwise PushChildren and bail.
|
* otherwise PushChildren and bail.
|
||||||
*/
|
*/
|
||||||
// Special handling for incomplete children
|
// Special handling for incomplete children
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// XXX It's good to assume that we might still have room
|
// XXX It's good to assume that we might still have room
|
||||||
// even if the child didn't complete (floaters will want this)
|
// even if the child didn't complete (floaters will want this)
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
@@ -495,7 +495,7 @@ PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
while (nsnull != nextInFlow) {
|
while (nsnull != nextInFlow) {
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
ReflowStatus status;
|
nsReflowStatus status;
|
||||||
|
|
||||||
// Get the next child
|
// Get the next child
|
||||||
nsIFrame* kidFrame = nextInFlow->mFirstChild;
|
nsIFrame* kidFrame = nextInFlow->mFirstChild;
|
||||||
@@ -579,8 +579,8 @@ PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
prevLastContentIsComplete = mLastContentIsComplete;
|
prevLastContentIsComplete = mLastContentIsComplete;
|
||||||
|
|
||||||
// Is the child we just pulled up complete?
|
// Is the child we just pulled up complete?
|
||||||
mLastContentIsComplete = PRBool(status == frComplete);
|
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status);
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// No the child isn't complete
|
// No the child isn't complete
|
||||||
nsIFrame* kidNextInFlow;
|
nsIFrame* kidNextInFlow;
|
||||||
|
|
||||||
@@ -682,7 +682,7 @@ PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||||||
* @return frComplete if all content has been mapped and frNotComplete
|
* @return frComplete if all content has been mapped and frNotComplete
|
||||||
* if we should be continued
|
* if we should be continued
|
||||||
*/
|
*/
|
||||||
nsIFrame::ReflowStatus
|
nsReflowStatus
|
||||||
nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
||||||
RowGroupReflowState& aState,
|
RowGroupReflowState& aState,
|
||||||
nsSize* aMaxElementSize)
|
nsSize* aMaxElementSize)
|
||||||
@@ -690,8 +690,8 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
VerifyLastIsComplete();
|
VerifyLastIsComplete();
|
||||||
#endif
|
#endif
|
||||||
nsIFrame* kidPrevInFlow = nsnull;
|
nsIFrame* kidPrevInFlow = nsnull;
|
||||||
ReflowStatus result = frNotComplete;
|
nsReflowStatus result = 0; // not complete
|
||||||
|
|
||||||
// If we have no children and we have a prev-in-flow then we need to pick
|
// If we have no children and we have a prev-in-flow then we need to pick
|
||||||
// up where it left off. If we have children, e.g. we're being resized, then
|
// up where it left off. If we have children, e.g. we're being resized, then
|
||||||
@@ -721,7 +721,7 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
// Get the next content object
|
// Get the next content object
|
||||||
nsIContentPtr kid = mContent->ChildAt(kidIndex);
|
nsIContentPtr kid = mContent->ChildAt(kidIndex);
|
||||||
if (kid.IsNull()) {
|
if (kid.IsNull()) {
|
||||||
result = frComplete;
|
result = NS_FRAME_COMPLETE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -756,8 +756,8 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
// Try to reflow the child into the available space. It might not
|
// Try to reflow the child into the available space. It might not
|
||||||
// fit or might need continuing.
|
// fit or might need continuing.
|
||||||
nsReflowMetrics kidSize;
|
nsReflowMetrics kidSize;
|
||||||
ReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize,
|
nsReflowStatus status = ReflowChild(kidFrame,aPresContext, kidSize,
|
||||||
aState.availSize, pKidMaxElementSize);
|
aState.availSize, pKidMaxElementSize);
|
||||||
|
|
||||||
// Did the child fit?
|
// Did the child fit?
|
||||||
if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) {
|
if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) {
|
||||||
@@ -788,7 +788,7 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
|||||||
kidIndex++;
|
kidIndex++;
|
||||||
|
|
||||||
// Did the child complete?
|
// Did the child complete?
|
||||||
if (frNotComplete == status) {
|
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
|
||||||
// If the child isn't complete then it means that we've used up
|
// If the child isn't complete then it means that we've used up
|
||||||
// all of our available space
|
// all of our available space
|
||||||
mLastContentIsComplete = PR_FALSE;
|
mLastContentIsComplete = PR_FALSE;
|
||||||
@@ -820,7 +820,7 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
if (gsDebug1==PR_TRUE)
|
if (gsDebug1==PR_TRUE)
|
||||||
printf("nsTableRowGroupFrame::ResizeReflow - aMaxSize = %d, %d\n",
|
printf("nsTableRowGroupFrame::ResizeReflow - aMaxSize = %d, %d\n",
|
||||||
@@ -837,7 +837,7 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext,
|
|||||||
|
|
||||||
PRBool reflowMappedOK = PR_TRUE;
|
PRBool reflowMappedOK = PR_TRUE;
|
||||||
|
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
|
|
||||||
// Check for an overflow list
|
// Check for an overflow list
|
||||||
MoveOverflowToChildList();
|
MoveOverflowToChildList();
|
||||||
@@ -848,7 +848,7 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext,
|
|||||||
if (nsnull != mFirstChild) {
|
if (nsnull != mFirstChild) {
|
||||||
reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize);
|
reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize);
|
||||||
if (PR_FALSE == reflowMappedOK) {
|
if (PR_FALSE == reflowMappedOK) {
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -858,7 +858,7 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext,
|
|||||||
if (state.availSize.height <= 0) {
|
if (state.availSize.height <= 0) {
|
||||||
// No space left. Don't try to pull-up children or reflow unmapped
|
// No space left. Don't try to pull-up children or reflow unmapped
|
||||||
if (NextChildOffset() < mContent->ChildCount()) {
|
if (NextChildOffset() < mContent->ChildCount()) {
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
} else if (NextChildOffset() < mContent->ChildCount()) {
|
} else if (NextChildOffset() < mContent->ChildCount()) {
|
||||||
// Try and pull-up some children from a next-in-flow
|
// Try and pull-up some children from a next-in-flow
|
||||||
@@ -870,12 +870,12 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext,
|
|||||||
} else {
|
} else {
|
||||||
// We were unable to pull-up all the existing frames from the
|
// We were unable to pull-up all the existing frames from the
|
||||||
// next in flow
|
// next in flow
|
||||||
aStatus = frNotComplete;
|
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frComplete == aStatus) {
|
if (NS_FRAME_IS_COMPLETE(aStatus)) {
|
||||||
// Don't forget to add in the bottom margin from our last child.
|
// Don't forget to add in the bottom margin from our last child.
|
||||||
// Only add it in if there's room for it.
|
// Only add it in if there's room for it.
|
||||||
nscoord margin = state.prevMaxPosBottomMargin -
|
nscoord margin = state.prevMaxPosBottomMargin -
|
||||||
@@ -899,12 +899,12 @@ nsTableRowGroupFrame::ResizeReflow( nsIPresContext* aPresContext,
|
|||||||
{
|
{
|
||||||
if (nsnull!=aMaxElementSize)
|
if (nsnull!=aMaxElementSize)
|
||||||
printf("nsTableRowGroupFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=%d,%d\n",
|
printf("nsTableRowGroupFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=%d,%d\n",
|
||||||
aStatus==frComplete?"Complete":"Not Complete",
|
NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete",
|
||||||
aDesiredSize.width, aDesiredSize.height,
|
aDesiredSize.width, aDesiredSize.height,
|
||||||
aMaxElementSize->width, aMaxElementSize->height);
|
aMaxElementSize->width, aMaxElementSize->height);
|
||||||
else
|
else
|
||||||
printf("nsTableRowGroupFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=NSNULL\n",
|
printf("nsTableRowGroupFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=NSNULL\n",
|
||||||
aStatus==frComplete?"Complete":"Not Complete",
|
NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete",
|
||||||
aDesiredSize.width, aDesiredSize.height);
|
aDesiredSize.width, aDesiredSize.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -917,7 +917,7 @@ nsTableRowGroupFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus)
|
nsReflowStatus& aStatus)
|
||||||
{
|
{
|
||||||
if (gsDebug1==PR_TRUE) printf("nsTableRowGroupFrame::IncrementalReflow\n");
|
if (gsDebug1==PR_TRUE) printf("nsTableRowGroupFrame::IncrementalReflow\n");
|
||||||
|
|
||||||
@@ -925,7 +925,7 @@ nsTableRowGroupFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
|||||||
aDesiredSize.width = aMaxSize.width;
|
aDesiredSize.width = aMaxSize.width;
|
||||||
aDesiredSize.height = aMaxSize.height;
|
aDesiredSize.height = aMaxSize.height;
|
||||||
|
|
||||||
aStatus = frComplete;
|
aStatus = NS_FRAME_COMPLETE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,13 +76,13 @@ public:
|
|||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsSize* aMaxElementSize,
|
nsSize* aMaxElementSize,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
/** @see nsIFrame::IncrementalReflow */
|
/** @see nsIFrame::IncrementalReflow */
|
||||||
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
NS_IMETHOD IncrementalReflow(nsIPresContext* aPresContext,
|
||||||
nsReflowMetrics& aDesiredSize,
|
nsReflowMetrics& aDesiredSize,
|
||||||
const nsSize& aMaxSize,
|
const nsSize& aMaxSize,
|
||||||
nsReflowCommand& aReflowCommand,
|
nsReflowCommand& aReflowCommand,
|
||||||
ReflowStatus& aStatus);
|
nsReflowStatus& aStatus);
|
||||||
|
|
||||||
/** @see nsContainerFrame::CreateContinuingFrame */
|
/** @see nsContainerFrame::CreateContinuingFrame */
|
||||||
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
NS_IMETHOD CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||||
@@ -152,9 +152,9 @@ protected:
|
|||||||
* @return frComplete if all content has been mapped and frNotComplete
|
* @return frComplete if all content has been mapped and frNotComplete
|
||||||
* if we should be continued
|
* if we should be continued
|
||||||
*/
|
*/
|
||||||
ReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
nsReflowStatus ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
||||||
RowGroupReflowState& aState,
|
RowGroupReflowState& aState,
|
||||||
nsSize* aMaxElementSize);
|
nsSize* aMaxElementSize);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nsIAtom *mType;
|
nsIAtom *mType;
|
||||||
|
|||||||
Reference in New Issue
Block a user