зеркало из https://github.com/mozilla/gecko-dev.git
Changed ReflowChild() to send the WillReflow() notification as well
This commit is contained in:
Родитель
6fa89e5506
Коммит
7e64653dab
|
@ -285,30 +285,36 @@ NS_METHOD nsContainerFrame::GetCursorAndContentAt(nsIPresContext& aPresContext,
|
|||
// Helper member functions
|
||||
|
||||
/**
|
||||
* Reflow a child frame and return the status of the reflow. If the
|
||||
* child is complete and it has next-in-flows (it was a splittable child)
|
||||
* then delete the next-in-flows.
|
||||
* Queries the child frame for the nsIHTMLReflow interface and if it's
|
||||
* supported invokes the WillReflow() and Reflow() member functions. If
|
||||
* the reflow succeeds and the child frame is complete, deletes any
|
||||
* next-in-flows using DeleteChildsNextInFlow()
|
||||
*/
|
||||
nsReflowStatus nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
||||
nsIPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState)
|
||||
nsresult
|
||||
nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
||||
nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
nsReflowStatus status;
|
||||
|
||||
NS_PRECONDITION(aReflowState.frame == aKidFrame, "bad reflow state");
|
||||
#ifdef NS_DEBUG
|
||||
nsFrameState kidFrameState;
|
||||
|
||||
aKidFrame->GetFrameState(kidFrameState);
|
||||
NS_ASSERTION(kidFrameState & NS_FRAME_IN_REFLOW, "kid frame is not in reflow");
|
||||
#endif
|
||||
// Query for the nsIHTMLReflow interface
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
if (NS_OK == aKidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->Reflow(*aPresContext, aDesiredSize, aReflowState, status);
|
||||
nsresult result;
|
||||
|
||||
result = aKidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow);
|
||||
if (NS_FAILED(result)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
if (NS_FRAME_IS_COMPLETE(status)) {
|
||||
// Send the WillReflow notification, and reflow the child frame
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
result = htmlReflow->Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
|
||||
|
||||
// If the reflow was successful and the child frame is complete, delete any
|
||||
// next-in-flows
|
||||
if (NS_SUCCEEDED(result) && NS_FRAME_IS_COMPLETE(aStatus)) {
|
||||
nsIFrame* kidNextInFlow;
|
||||
|
||||
aKidFrame->GetNextInFlow(kidNextInFlow);
|
||||
|
@ -318,10 +324,11 @@ nsReflowStatus nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
|||
// parent is not this because we are executing pullup code)
|
||||
nsIFrame* parent;
|
||||
aKidFrame->GetGeometricParent(parent);
|
||||
((nsContainerFrame*)parent)->DeleteChildsNextInFlow(*aPresContext, aKidFrame);
|
||||
((nsContainerFrame*)parent)->DeleteChildsNextInFlow(aPresContext, aKidFrame);
|
||||
}
|
||||
}
|
||||
return status;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -401,7 +408,7 @@ nsContainerFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, nsIFrame*
|
|||
aChild->SetNextSibling(nextSibling);
|
||||
}
|
||||
|
||||
// Delete the next-in-flow frame and adjust its parents child count
|
||||
// Delete the next-in-flow frame
|
||||
WillDeleteNextInFlowFrame(nextInFlow);
|
||||
nextInFlow->DeleteFrame(aPresContext);
|
||||
|
||||
|
|
|
@ -110,13 +110,16 @@ protected:
|
|||
const nsRect& aDirtyRect);
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* Queries the child frame for the nsIHTMLReflow interface and if it's
|
||||
* supported invokes the WillReflow() and Reflow() member functions. If
|
||||
* the reflow succeeds and the child frame is complete, deletes any
|
||||
* next-in-flows using DeleteChildsNextInFlow()
|
||||
*/
|
||||
nsReflowStatus ReflowChild(nsIFrame* aKidFrame,
|
||||
nsIPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState);
|
||||
nsresult ReflowChild(nsIFrame* aKidFrame,
|
||||
nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
/**
|
||||
* Moves any frames on both the prev-in-flow's overflow list and the receiver's
|
||||
|
|
|
@ -328,8 +328,7 @@ nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext,
|
|||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(mFirstChild, &aPresContext, kidMetrics, kidReflowState);
|
||||
ReflowChild(mFirstChild, aPresContext, kidMetrics, kidReflowState, aStatus);
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
|
||||
|
||||
// Place and size the child
|
||||
|
|
|
@ -674,18 +674,17 @@ nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
|
|||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == aChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
|
||||
nsHTMLReflowMetrics metrics(nsnull);
|
||||
metrics.width = aSize.width;
|
||||
metrics.height= aSize.height;
|
||||
nsReflowStatus status;
|
||||
|
||||
if (needFramesetReflow) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
status = ((nsHTMLFramesetFrame*)aChild)->Reflow(aPresContext, childDrag, metrics,
|
||||
reflowState, status);
|
||||
} else {
|
||||
status = ReflowChild(aChild, &aPresContext, metrics, reflowState);
|
||||
ReflowChild(aChild, aPresContext, metrics, reflowState, status);
|
||||
}
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "bad status");
|
||||
|
||||
|
|
|
@ -151,12 +151,14 @@ RootFrame::Reflow(nsIPresContext& aPresContext,
|
|||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(mFirstChild, &aPresContext, desiredSize, kidReflowState);
|
||||
ReflowChild(mFirstChild, aPresContext, desiredSize, kidReflowState, aStatus);
|
||||
|
||||
// Place and size the child
|
||||
nsRect rect(0, 0, desiredSize.width, desiredSize.height);
|
||||
mFirstChild->SetRect(rect);
|
||||
|
||||
// XXX We should resolve the details of who/when DidReflow() notifications
|
||||
// are sent...
|
||||
htmlReflow->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
|
||||
}
|
||||
}
|
||||
|
@ -363,18 +365,14 @@ RootContentFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
nsSize maxSize(availWidth, NS_UNCONSTRAINEDSIZE);
|
||||
nsHTMLReflowState kidReflowState(next, aReflowState, maxSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
// Dispatch the reflow command to our child frame. Allow it to be as high
|
||||
// as it wants
|
||||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
|
||||
ReflowChild(mFirstChild, aPresContext, aDesiredSize, kidReflowState, aStatus);
|
||||
|
||||
// Place and size the child
|
||||
nsRect rect(left, top, aDesiredSize.width, aDesiredSize.height);
|
||||
mFirstChild->SetRect(rect);
|
||||
}
|
||||
// Place and size the child
|
||||
nsRect rect(left, top, aDesiredSize.width, aDesiredSize.height);
|
||||
mFirstChild->SetRect(rect);
|
||||
|
||||
// Compute our desired size
|
||||
aDesiredSize.width += left + right + sbarWidth;
|
||||
|
@ -415,46 +413,41 @@ RootContentFrame::Reflow(nsIPresContext& aPresContext,
|
|||
// Reflow the page
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aReflowState, pageSize,
|
||||
reflowReason);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
nsReflowStatus status;
|
||||
|
||||
// Place and size the page. If the page is narrower than our
|
||||
// max width then center it horizontally
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
status = ReflowChild(kidFrame, &aPresContext, kidSize,
|
||||
kidReflowState);
|
||||
kidFrame->SetRect(nsRect(x, y, kidSize.width, kidSize.height));
|
||||
y += kidSize.height;
|
||||
ReflowChild(kidFrame, aPresContext, kidSize, kidReflowState, status);
|
||||
kidFrame->SetRect(nsRect(x, y, kidSize.width, kidSize.height));
|
||||
y += kidSize.height;
|
||||
|
||||
// Leave a slight gap between the pages
|
||||
y += PAGE_SPACING_TWIPS;
|
||||
// Leave a slight gap between the pages
|
||||
y += PAGE_SPACING_TWIPS;
|
||||
|
||||
// Is the page complete?
|
||||
nsIFrame* kidNextInFlow;
|
||||
// Is the page complete?
|
||||
nsIFrame* kidNextInFlow;
|
||||
|
||||
kidFrame->GetNextInFlow(kidNextInFlow);
|
||||
if (NS_FRAME_IS_COMPLETE(status)) {
|
||||
NS_ASSERTION(nsnull == kidNextInFlow, "bad child flow list");
|
||||
} else if (nsnull == kidNextInFlow) {
|
||||
// The page isn't complete and it doesn't have a next-in-flow so
|
||||
// create a continuing page
|
||||
nsIStyleContext* kidSC;
|
||||
kidFrame->GetStyleContext(&aPresContext, kidSC);
|
||||
nsIFrame* continuingPage;
|
||||
nsresult rv = kidFrame->CreateContinuingFrame(aPresContext, this,
|
||||
kidSC, continuingPage);
|
||||
NS_RELEASE(kidSC);
|
||||
reflowReason = eReflowReason_Initial;
|
||||
kidFrame->GetNextInFlow(kidNextInFlow);
|
||||
if (NS_FRAME_IS_COMPLETE(status)) {
|
||||
NS_ASSERTION(nsnull == kidNextInFlow, "bad child flow list");
|
||||
} else if (nsnull == kidNextInFlow) {
|
||||
// The page isn't complete and it doesn't have a next-in-flow so
|
||||
// create a continuing page
|
||||
nsIStyleContext* kidSC;
|
||||
kidFrame->GetStyleContext(&aPresContext, kidSC);
|
||||
nsIFrame* continuingPage;
|
||||
nsresult rv = kidFrame->CreateContinuingFrame(aPresContext, this,
|
||||
kidSC, continuingPage);
|
||||
NS_RELEASE(kidSC);
|
||||
reflowReason = eReflowReason_Initial;
|
||||
|
||||
// Add it to our child list
|
||||
// Add it to our child list
|
||||
#ifdef NS_DEBUG
|
||||
nsIFrame* kidNextSibling;
|
||||
kidFrame->GetNextSibling(kidNextSibling);
|
||||
NS_ASSERTION(nsnull == kidNextSibling, "unexpected sibling");
|
||||
nsIFrame* kidNextSibling;
|
||||
kidFrame->GetNextSibling(kidNextSibling);
|
||||
NS_ASSERTION(nsnull == kidNextSibling, "unexpected sibling");
|
||||
#endif
|
||||
kidFrame->SetNextSibling(continuingPage);
|
||||
}
|
||||
kidFrame->SetNextSibling(continuingPage);
|
||||
}
|
||||
|
||||
// Get the next page
|
||||
|
@ -475,25 +468,21 @@ RootContentFrame::Reflow(nsIPresContext& aPresContext,
|
|||
nsSize maxSize(availWidth, NS_UNCONSTRAINEDSIZE);
|
||||
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, maxSize,
|
||||
reflowReason);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
// Get the child's desired size. Our child's desired height is our
|
||||
// desired size
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
|
||||
// Get the child's desired size. Our child's desired height is our
|
||||
// desired size
|
||||
ReflowChild(mFirstChild, aPresContext, aDesiredSize, kidReflowState, aStatus);
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
|
||||
|
||||
// Place and size the child
|
||||
nsRect rect(left, top, aDesiredSize.width, aDesiredSize.height);
|
||||
mFirstChild->SetRect(rect);
|
||||
// Place and size the child
|
||||
nsRect rect(left, top, aDesiredSize.width, aDesiredSize.height);
|
||||
mFirstChild->SetRect(rect);
|
||||
|
||||
// Compute our desired size
|
||||
aDesiredSize.width += left + right + sbarWidth;
|
||||
aDesiredSize.height += top + bottom;
|
||||
if (aDesiredSize.height < aReflowState.maxSize.height) {
|
||||
aDesiredSize.height = aReflowState.maxSize.height;
|
||||
}
|
||||
// Compute our desired size
|
||||
aDesiredSize.width += left + right + sbarWidth;
|
||||
aDesiredSize.height += top + bottom;
|
||||
if (aDesiredSize.height < aReflowState.maxSize.height) {
|
||||
aDesiredSize.height = aReflowState.maxSize.height;
|
||||
}
|
||||
|
||||
// Do the necessary repainting
|
||||
|
|
|
@ -92,7 +92,7 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
|
|||
nsSize maxSize(aReflowState.maxSize.width, NS_UNCONSTRAINEDSIZE);
|
||||
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, maxSize);
|
||||
|
||||
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
|
||||
ReflowChild(mFirstChild, aPresContext, aDesiredSize, kidReflowState, aStatus);
|
||||
|
||||
// Place and size the child. Make sure the child is at least as
|
||||
// tall as our max size (the containing window)
|
||||
|
@ -131,8 +131,7 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
// Get the child's desired size
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
|
||||
ReflowChild(mFirstChild, aPresContext, aDesiredSize, kidReflowState, aStatus);
|
||||
|
||||
// Make sure the child is at least as tall as our max size (the containing window)
|
||||
if (aDesiredSize.height < aReflowState.maxSize.height) {
|
||||
|
@ -142,6 +141,7 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
|
|||
// Place and size the child
|
||||
nsRect rect(0, 0, aDesiredSize.width, aDesiredSize.height);
|
||||
mFirstChild->SetRect(rect);
|
||||
// XXX Should we be sending the DidReflow?
|
||||
htmlReflow->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
|
||||
|
||||
// Is the frame complete?
|
||||
|
|
|
@ -285,30 +285,36 @@ NS_METHOD nsContainerFrame::GetCursorAndContentAt(nsIPresContext& aPresContext,
|
|||
// Helper member functions
|
||||
|
||||
/**
|
||||
* Reflow a child frame and return the status of the reflow. If the
|
||||
* child is complete and it has next-in-flows (it was a splittable child)
|
||||
* then delete the next-in-flows.
|
||||
* Queries the child frame for the nsIHTMLReflow interface and if it's
|
||||
* supported invokes the WillReflow() and Reflow() member functions. If
|
||||
* the reflow succeeds and the child frame is complete, deletes any
|
||||
* next-in-flows using DeleteChildsNextInFlow()
|
||||
*/
|
||||
nsReflowStatus nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
||||
nsIPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState)
|
||||
nsresult
|
||||
nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
||||
nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
nsReflowStatus status;
|
||||
|
||||
NS_PRECONDITION(aReflowState.frame == aKidFrame, "bad reflow state");
|
||||
#ifdef NS_DEBUG
|
||||
nsFrameState kidFrameState;
|
||||
|
||||
aKidFrame->GetFrameState(kidFrameState);
|
||||
NS_ASSERTION(kidFrameState & NS_FRAME_IN_REFLOW, "kid frame is not in reflow");
|
||||
#endif
|
||||
// Query for the nsIHTMLReflow interface
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
if (NS_OK == aKidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->Reflow(*aPresContext, aDesiredSize, aReflowState, status);
|
||||
nsresult result;
|
||||
|
||||
result = aKidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow);
|
||||
if (NS_FAILED(result)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
if (NS_FRAME_IS_COMPLETE(status)) {
|
||||
// Send the WillReflow notification, and reflow the child frame
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
result = htmlReflow->Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
|
||||
|
||||
// If the reflow was successful and the child frame is complete, delete any
|
||||
// next-in-flows
|
||||
if (NS_SUCCEEDED(result) && NS_FRAME_IS_COMPLETE(aStatus)) {
|
||||
nsIFrame* kidNextInFlow;
|
||||
|
||||
aKidFrame->GetNextInFlow(kidNextInFlow);
|
||||
|
@ -318,10 +324,11 @@ nsReflowStatus nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
|
|||
// parent is not this because we are executing pullup code)
|
||||
nsIFrame* parent;
|
||||
aKidFrame->GetGeometricParent(parent);
|
||||
((nsContainerFrame*)parent)->DeleteChildsNextInFlow(*aPresContext, aKidFrame);
|
||||
((nsContainerFrame*)parent)->DeleteChildsNextInFlow(aPresContext, aKidFrame);
|
||||
}
|
||||
}
|
||||
return status;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -401,7 +408,7 @@ nsContainerFrame::DeleteChildsNextInFlow(nsIPresContext& aPresContext, nsIFrame*
|
|||
aChild->SetNextSibling(nextSibling);
|
||||
}
|
||||
|
||||
// Delete the next-in-flow frame and adjust its parents child count
|
||||
// Delete the next-in-flow frame
|
||||
WillDeleteNextInFlowFrame(nextInFlow);
|
||||
nextInFlow->DeleteFrame(aPresContext);
|
||||
|
||||
|
|
|
@ -110,13 +110,16 @@ protected:
|
|||
const nsRect& aDirtyRect);
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* Queries the child frame for the nsIHTMLReflow interface and if it's
|
||||
* supported invokes the WillReflow() and Reflow() member functions. If
|
||||
* the reflow succeeds and the child frame is complete, deletes any
|
||||
* next-in-flows using DeleteChildsNextInFlow()
|
||||
*/
|
||||
nsReflowStatus ReflowChild(nsIFrame* aKidFrame,
|
||||
nsIPresContext* aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState);
|
||||
nsresult ReflowChild(nsIFrame* aKidFrame,
|
||||
nsIPresContext& aPresContext,
|
||||
nsHTMLReflowMetrics& aDesiredSize,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus);
|
||||
|
||||
/**
|
||||
* Moves any frames on both the prev-in-flow's overflow list and the receiver's
|
||||
|
|
|
@ -151,12 +151,14 @@ RootFrame::Reflow(nsIPresContext& aPresContext,
|
|||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(mFirstChild, &aPresContext, desiredSize, kidReflowState);
|
||||
ReflowChild(mFirstChild, aPresContext, desiredSize, kidReflowState, aStatus);
|
||||
|
||||
// Place and size the child
|
||||
nsRect rect(0, 0, desiredSize.width, desiredSize.height);
|
||||
mFirstChild->SetRect(rect);
|
||||
|
||||
// XXX We should resolve the details of who/when DidReflow() notifications
|
||||
// are sent...
|
||||
htmlReflow->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
|
||||
}
|
||||
}
|
||||
|
@ -363,18 +365,14 @@ RootContentFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
nsSize maxSize(availWidth, NS_UNCONSTRAINEDSIZE);
|
||||
nsHTMLReflowState kidReflowState(next, aReflowState, maxSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
// Dispatch the reflow command to our child frame. Allow it to be as high
|
||||
// as it wants
|
||||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
|
||||
ReflowChild(mFirstChild, aPresContext, aDesiredSize, kidReflowState, aStatus);
|
||||
|
||||
// Place and size the child
|
||||
nsRect rect(left, top, aDesiredSize.width, aDesiredSize.height);
|
||||
mFirstChild->SetRect(rect);
|
||||
}
|
||||
// Place and size the child
|
||||
nsRect rect(left, top, aDesiredSize.width, aDesiredSize.height);
|
||||
mFirstChild->SetRect(rect);
|
||||
|
||||
// Compute our desired size
|
||||
aDesiredSize.width += left + right + sbarWidth;
|
||||
|
@ -415,46 +413,41 @@ RootContentFrame::Reflow(nsIPresContext& aPresContext,
|
|||
// Reflow the page
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aReflowState, pageSize,
|
||||
reflowReason);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
nsReflowStatus status;
|
||||
|
||||
// Place and size the page. If the page is narrower than our
|
||||
// max width then center it horizontally
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
status = ReflowChild(kidFrame, &aPresContext, kidSize,
|
||||
kidReflowState);
|
||||
kidFrame->SetRect(nsRect(x, y, kidSize.width, kidSize.height));
|
||||
y += kidSize.height;
|
||||
ReflowChild(kidFrame, aPresContext, kidSize, kidReflowState, status);
|
||||
kidFrame->SetRect(nsRect(x, y, kidSize.width, kidSize.height));
|
||||
y += kidSize.height;
|
||||
|
||||
// Leave a slight gap between the pages
|
||||
y += PAGE_SPACING_TWIPS;
|
||||
// Leave a slight gap between the pages
|
||||
y += PAGE_SPACING_TWIPS;
|
||||
|
||||
// Is the page complete?
|
||||
nsIFrame* kidNextInFlow;
|
||||
// Is the page complete?
|
||||
nsIFrame* kidNextInFlow;
|
||||
|
||||
kidFrame->GetNextInFlow(kidNextInFlow);
|
||||
if (NS_FRAME_IS_COMPLETE(status)) {
|
||||
NS_ASSERTION(nsnull == kidNextInFlow, "bad child flow list");
|
||||
} else if (nsnull == kidNextInFlow) {
|
||||
// The page isn't complete and it doesn't have a next-in-flow so
|
||||
// create a continuing page
|
||||
nsIStyleContext* kidSC;
|
||||
kidFrame->GetStyleContext(&aPresContext, kidSC);
|
||||
nsIFrame* continuingPage;
|
||||
nsresult rv = kidFrame->CreateContinuingFrame(aPresContext, this,
|
||||
kidSC, continuingPage);
|
||||
NS_RELEASE(kidSC);
|
||||
reflowReason = eReflowReason_Initial;
|
||||
kidFrame->GetNextInFlow(kidNextInFlow);
|
||||
if (NS_FRAME_IS_COMPLETE(status)) {
|
||||
NS_ASSERTION(nsnull == kidNextInFlow, "bad child flow list");
|
||||
} else if (nsnull == kidNextInFlow) {
|
||||
// The page isn't complete and it doesn't have a next-in-flow so
|
||||
// create a continuing page
|
||||
nsIStyleContext* kidSC;
|
||||
kidFrame->GetStyleContext(&aPresContext, kidSC);
|
||||
nsIFrame* continuingPage;
|
||||
nsresult rv = kidFrame->CreateContinuingFrame(aPresContext, this,
|
||||
kidSC, continuingPage);
|
||||
NS_RELEASE(kidSC);
|
||||
reflowReason = eReflowReason_Initial;
|
||||
|
||||
// Add it to our child list
|
||||
// Add it to our child list
|
||||
#ifdef NS_DEBUG
|
||||
nsIFrame* kidNextSibling;
|
||||
kidFrame->GetNextSibling(kidNextSibling);
|
||||
NS_ASSERTION(nsnull == kidNextSibling, "unexpected sibling");
|
||||
nsIFrame* kidNextSibling;
|
||||
kidFrame->GetNextSibling(kidNextSibling);
|
||||
NS_ASSERTION(nsnull == kidNextSibling, "unexpected sibling");
|
||||
#endif
|
||||
kidFrame->SetNextSibling(continuingPage);
|
||||
}
|
||||
kidFrame->SetNextSibling(continuingPage);
|
||||
}
|
||||
|
||||
// Get the next page
|
||||
|
@ -475,25 +468,21 @@ RootContentFrame::Reflow(nsIPresContext& aPresContext,
|
|||
nsSize maxSize(availWidth, NS_UNCONSTRAINEDSIZE);
|
||||
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, maxSize,
|
||||
reflowReason);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
// Get the child's desired size. Our child's desired height is our
|
||||
// desired size
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
|
||||
// Get the child's desired size. Our child's desired height is our
|
||||
// desired size
|
||||
ReflowChild(mFirstChild, aPresContext, aDesiredSize, kidReflowState, aStatus);
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
|
||||
|
||||
// Place and size the child
|
||||
nsRect rect(left, top, aDesiredSize.width, aDesiredSize.height);
|
||||
mFirstChild->SetRect(rect);
|
||||
// Place and size the child
|
||||
nsRect rect(left, top, aDesiredSize.width, aDesiredSize.height);
|
||||
mFirstChild->SetRect(rect);
|
||||
|
||||
// Compute our desired size
|
||||
aDesiredSize.width += left + right + sbarWidth;
|
||||
aDesiredSize.height += top + bottom;
|
||||
if (aDesiredSize.height < aReflowState.maxSize.height) {
|
||||
aDesiredSize.height = aReflowState.maxSize.height;
|
||||
}
|
||||
// Compute our desired size
|
||||
aDesiredSize.width += left + right + sbarWidth;
|
||||
aDesiredSize.height += top + bottom;
|
||||
if (aDesiredSize.height < aReflowState.maxSize.height) {
|
||||
aDesiredSize.height = aReflowState.maxSize.height;
|
||||
}
|
||||
|
||||
// Do the necessary repainting
|
||||
|
|
|
@ -92,7 +92,7 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
|
|||
nsSize maxSize(aReflowState.maxSize.width, NS_UNCONSTRAINEDSIZE);
|
||||
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, maxSize);
|
||||
|
||||
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
|
||||
ReflowChild(mFirstChild, aPresContext, aDesiredSize, kidReflowState, aStatus);
|
||||
|
||||
// Place and size the child. Make sure the child is at least as
|
||||
// tall as our max size (the containing window)
|
||||
|
@ -131,8 +131,7 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
// Get the child's desired size
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
|
||||
ReflowChild(mFirstChild, aPresContext, aDesiredSize, kidReflowState, aStatus);
|
||||
|
||||
// Make sure the child is at least as tall as our max size (the containing window)
|
||||
if (aDesiredSize.height < aReflowState.maxSize.height) {
|
||||
|
@ -142,6 +141,7 @@ NS_METHOD nsPageFrame::Reflow(nsIPresContext& aPresContext,
|
|||
// Place and size the child
|
||||
nsRect rect(0, 0, aDesiredSize.width, aDesiredSize.height);
|
||||
mFirstChild->SetRect(rect);
|
||||
// XXX Should we be sending the DidReflow?
|
||||
htmlReflow->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
|
||||
|
||||
// Is the frame complete?
|
||||
|
|
|
@ -127,8 +127,7 @@ nsScrollBodyFrame::Reflow(nsIPresContext& aPresContext,
|
|||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
// Dispatch the reflow command to our child frame. Allow it to be as high
|
||||
// as it wants
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
|
||||
ReflowChild(mFirstChild, aPresContext, aDesiredSize, kidReflowState, aStatus);
|
||||
|
||||
// Place and size the child. Make sure the child is at least as
|
||||
// tall as our max size (the containing window)
|
||||
|
@ -138,6 +137,7 @@ nsScrollBodyFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
nsRect rect(0, 0, aDesiredSize.width, aDesiredSize.height);
|
||||
mFirstChild->SetRect(rect);
|
||||
// XXX Why are we sending a DidReflow() notification here?
|
||||
htmlReflow->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
|
||||
}
|
||||
|
||||
|
@ -175,7 +175,7 @@ nsScrollBodyFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
status = ReflowChild(kidFrame, &aPresContext, kidSize, kidReflowState);
|
||||
ReflowChild(kidFrame, aPresContext, kidSize, kidReflowState, status);
|
||||
|
||||
kidFrame->SetRect(nsRect(x, y, kidSize.width, kidSize.height));
|
||||
htmlReflow->DidReflow(aPresContext, NS_FRAME_REFLOW_FINISHED);
|
||||
|
@ -230,7 +230,7 @@ nsScrollBodyFrame::Reflow(nsIPresContext& aPresContext,
|
|||
// Get the child's desired size. Our child's desired height is our
|
||||
// desired size
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize, kidReflowState);
|
||||
ReflowChild(mFirstChild, aPresContext, aDesiredSize, kidReflowState, aStatus);
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
|
||||
|
||||
#if 0
|
||||
|
@ -393,8 +393,7 @@ nsScrollInnerFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(mFirstChild, &aPresContext, kidMetrics,
|
||||
kidReflowState);
|
||||
ReflowChild(mFirstChild, aPresContext, kidMetrics, kidReflowState, aStatus);
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
|
||||
|
||||
// Place and size the child
|
||||
|
@ -507,8 +506,7 @@ nsScrollOuterFrame::Reflow(nsIPresContext& aPresContext,
|
|||
|
||||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(mFirstChild, &aPresContext, aDesiredSize,
|
||||
kidReflowState);
|
||||
ReflowChild(mFirstChild, aPresContext, aDesiredSize, kidReflowState, aStatus);
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
|
||||
|
||||
// Place and size the child
|
||||
|
|
|
@ -328,8 +328,7 @@ nsHTMLFrameOuterFrame::Reflow(nsIPresContext& aPresContext,
|
|||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(mFirstChild, &aPresContext, kidMetrics, kidReflowState);
|
||||
ReflowChild(mFirstChild, aPresContext, kidMetrics, kidReflowState, aStatus);
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
|
||||
|
||||
// Place and size the child
|
||||
|
|
|
@ -674,18 +674,17 @@ nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
|
|||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == aChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
|
||||
nsHTMLReflowMetrics metrics(nsnull);
|
||||
metrics.width = aSize.width;
|
||||
metrics.height= aSize.height;
|
||||
nsReflowStatus status;
|
||||
|
||||
if (needFramesetReflow) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
status = ((nsHTMLFramesetFrame*)aChild)->Reflow(aPresContext, childDrag, metrics,
|
||||
reflowState, status);
|
||||
} else {
|
||||
status = ReflowChild(aChild, &aPresContext, metrics, reflowState);
|
||||
ReflowChild(aChild, aPresContext, metrics, reflowState, status);
|
||||
}
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "bad status");
|
||||
|
||||
|
|
|
@ -326,19 +326,15 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext,
|
|||
kidSize.width=kidSize.height=kidSize.ascent=kidSize.descent=0;
|
||||
SetPriorAvailWidth(aReflowState.maxSize.width);
|
||||
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, availSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(mFirstChild, &aPresContext, kidSize, kidReflowState);
|
||||
ReflowChild(mFirstChild, aPresContext, kidSize, kidReflowState, aStatus);
|
||||
#ifdef NS_DEBUG
|
||||
if (kidSize.width > availSize.width)
|
||||
{
|
||||
printf("WARNING: cell content returned desired width %d given avail width %d\n",
|
||||
kidSize.width, availSize.width);
|
||||
}
|
||||
#endif
|
||||
if (kidSize.width > availSize.width)
|
||||
{
|
||||
printf("WARNING: cell content returned desired width %d given avail width %d\n",
|
||||
kidSize.width, availSize.width);
|
||||
}
|
||||
#endif
|
||||
if (PR_TRUE==gsDebug || PR_TRUE==gsDebugNT)
|
||||
{
|
||||
if (nsnull!=pMaxElementSize)
|
||||
|
|
|
@ -208,15 +208,11 @@ NS_METHOD nsTableColGroupFrame::Reflow(nsIPresContext& aPresContext,
|
|||
nsHTMLReflowMetrics kidSize(nsnull);
|
||||
// XXX Use a valid reason...
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aReflowState, nsSize(0,0), eReflowReason_Initial);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
nsReflowStatus status = ReflowChild(kidFrame,&aPresContext, kidSize,
|
||||
kidReflowState);
|
||||
// note that DidReflow is called as the result of some ancestor firing off a DidReflow above me
|
||||
kidFrame->SetRect(nsRect(0,0,0,0));
|
||||
}
|
||||
nsReflowStatus status;
|
||||
ReflowChild(kidFrame, aPresContext, kidSize, kidReflowState, status);
|
||||
// note that DidReflow is called as the result of some ancestor firing off a DidReflow above me
|
||||
kidFrame->SetRect(nsRect(0,0,0,0));
|
||||
}
|
||||
|
||||
aDesiredSize.width=0;
|
||||
|
|
|
@ -1535,17 +1535,13 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext& aPresContext,
|
|||
nsHTMLReflowMetrics desiredSize(nsnull);
|
||||
// XXX Correctly compute the available space...
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aReflowState, aReflowState.maxSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(kidFrame, &aPresContext, desiredSize, kidReflowState);
|
||||
ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState, aStatus);
|
||||
|
||||
// Resize the row group frame
|
||||
nsRect kidRect;
|
||||
kidFrame->GetRect(kidRect);
|
||||
kidFrame->SizeTo(desiredSize.width, desiredSize.height);
|
||||
}
|
||||
// Resize the row group frame
|
||||
nsRect kidRect;
|
||||
kidFrame->GetRect(kidRect);
|
||||
kidFrame->SizeTo(desiredSize.width, desiredSize.height);
|
||||
|
||||
#if 1
|
||||
// XXX For the time being just fall through and treat it like a
|
||||
|
@ -1681,38 +1677,33 @@ nsReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresContext,
|
|||
}
|
||||
nsSize maxKidElementSize(0,0);
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aReflowState, availSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
PRInt32 yCoord = y;
|
||||
if (NS_UNCONSTRAINEDSIZE!=yCoord)
|
||||
yCoord+= topInset;
|
||||
htmlReflow->WillReflow(*aPresContext);
|
||||
result = ReflowChild(kidFrame, aPresContext, kidSize, kidReflowState);
|
||||
PRInt32 yCoord = y;
|
||||
if (NS_UNCONSTRAINEDSIZE!=yCoord)
|
||||
yCoord+= topInset;
|
||||
ReflowChild(kidFrame, *aPresContext, kidSize, kidReflowState, result);
|
||||
|
||||
// Place the child since some of its content fit in us.
|
||||
if (PR_TRUE==gsDebugNT) {
|
||||
printf ("%p: reflow of row group returned desired=%d,%d, max-element=%d,%d\n",
|
||||
this, kidSize.width, kidSize.height, kidMaxSize.width, kidMaxSize.height);
|
||||
}
|
||||
kidFrame->SetRect(nsRect(leftInset, yCoord,
|
||||
kidSize.width, kidSize.height));
|
||||
if (NS_UNCONSTRAINEDSIZE==kidSize.height)
|
||||
y = NS_UNCONSTRAINEDSIZE;
|
||||
else
|
||||
y += kidSize.height;
|
||||
if (kidMaxSize.width > maxSize.width) {
|
||||
maxSize.width = kidMaxSize.width;
|
||||
}
|
||||
if (kidMaxSize.height > maxSize.height) {
|
||||
maxSize.height = kidMaxSize.height;
|
||||
}
|
||||
// Place the child since some of its content fit in us.
|
||||
if (PR_TRUE==gsDebugNT) {
|
||||
printf ("%p: reflow of row group returned desired=%d,%d, max-element=%d,%d\n",
|
||||
this, kidSize.width, kidSize.height, kidMaxSize.width, kidMaxSize.height);
|
||||
}
|
||||
kidFrame->SetRect(nsRect(leftInset, yCoord, kidSize.width, kidSize.height));
|
||||
if (NS_UNCONSTRAINEDSIZE==kidSize.height)
|
||||
y = NS_UNCONSTRAINEDSIZE;
|
||||
else
|
||||
y += kidSize.height;
|
||||
if (kidMaxSize.width > maxSize.width) {
|
||||
maxSize.width = kidMaxSize.width;
|
||||
}
|
||||
if (kidMaxSize.height > maxSize.height) {
|
||||
maxSize.height = kidMaxSize.height;
|
||||
}
|
||||
|
||||
if (NS_FRAME_IS_NOT_COMPLETE(result)) {
|
||||
// If the child didn't finish layout then it means that it used
|
||||
// up all of our available space (or needs us to split).
|
||||
break;
|
||||
}
|
||||
if (NS_FRAME_IS_NOT_COMPLETE(result)) {
|
||||
// If the child didn't finish layout then it means that it used
|
||||
// up all of our available space (or needs us to split).
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1998,42 +1989,38 @@ PRBool nsTableFrame::ReflowMappedChildren( nsIPresContext* aPresContext,
|
|||
// Reflow the child into the available space
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aState.reflowState, kidAvailSize,
|
||||
reason);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(*aPresContext);
|
||||
nscoord x = aState.leftInset + kidMargin.left;
|
||||
nscoord y = aState.topInset + aState.y + topMargin;
|
||||
status = ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState);
|
||||
// Did the child fit?
|
||||
if ((kidFrame != mFirstChild) && (desiredSize.height > kidAvailSize.height))
|
||||
{
|
||||
// The child is too wide to fit in the available space, and it's
|
||||
// not our first child
|
||||
PushChildren(kidFrame, prevKidFrame);
|
||||
result = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
nscoord x = aState.leftInset + kidMargin.left;
|
||||
nscoord y = aState.topInset + aState.y + topMargin;
|
||||
ReflowChild(kidFrame, *aPresContext, desiredSize, kidReflowState, status);
|
||||
// Did the child fit?
|
||||
if ((kidFrame != mFirstChild) && (desiredSize.height > kidAvailSize.height))
|
||||
{
|
||||
// The child is too wide to fit in the available space, and it's
|
||||
// not our first child
|
||||
PushChildren(kidFrame, prevKidFrame);
|
||||
result = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
// Place the child after taking into account it's margin
|
||||
aState.y += topMargin;
|
||||
nsRect kidRect (x, y, desiredSize.width, desiredSize.height);
|
||||
if (NS_STYLE_DISPLAY_TABLE_ROW_GROUP == childDisplay->mDisplay ||
|
||||
NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == childDisplay->mDisplay ||
|
||||
NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == childDisplay->mDisplay )
|
||||
{
|
||||
// we don't want to adjust the maxElementSize if this is an initial reflow
|
||||
// it was set by the TableLayoutStrategy and shouldn't be changed.
|
||||
nsSize *requestedMaxElementSize = nsnull;
|
||||
if (eReflowReason_Initial != aState.reflowState.reason)
|
||||
requestedMaxElementSize = aMaxElementSize;
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect,
|
||||
requestedMaxElementSize, kidMaxElementSize);
|
||||
if (bottomMargin < 0) {
|
||||
aState.prevMaxNegBottomMargin = -bottomMargin;
|
||||
} else {
|
||||
aState.prevMaxPosBottomMargin = bottomMargin;
|
||||
}
|
||||
// Place the child after taking into account it's margin
|
||||
aState.y += topMargin;
|
||||
nsRect kidRect (x, y, desiredSize.width, desiredSize.height);
|
||||
if (NS_STYLE_DISPLAY_TABLE_ROW_GROUP == childDisplay->mDisplay ||
|
||||
NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == childDisplay->mDisplay ||
|
||||
NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == childDisplay->mDisplay )
|
||||
{
|
||||
// we don't want to adjust the maxElementSize if this is an initial reflow
|
||||
// it was set by the TableLayoutStrategy and shouldn't be changed.
|
||||
nsSize *requestedMaxElementSize = nsnull;
|
||||
if (eReflowReason_Initial != aState.reflowState.reason)
|
||||
requestedMaxElementSize = aMaxElementSize;
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect,
|
||||
requestedMaxElementSize, kidMaxElementSize);
|
||||
if (bottomMargin < 0) {
|
||||
aState.prevMaxNegBottomMargin = -bottomMargin;
|
||||
} else {
|
||||
aState.prevMaxPosBottomMargin = bottomMargin;
|
||||
}
|
||||
}
|
||||
childCount++;
|
||||
|
@ -2143,38 +2130,34 @@ PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||
}
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aState.reflowState, aState.availSize,
|
||||
eReflowReason_Resize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(*aPresContext);
|
||||
status = ReflowChild(kidFrame, aPresContext, kidSize, kidReflowState);
|
||||
ReflowChild(kidFrame, *aPresContext, kidSize, kidReflowState, status);
|
||||
|
||||
// Did the child fit?
|
||||
if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) {
|
||||
// The child is too wide to fit in the available space, and it's
|
||||
// not our first child
|
||||
result = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
// Did the child fit?
|
||||
if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) {
|
||||
// The child is too wide to fit in the available space, and it's
|
||||
// not our first child
|
||||
result = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
// Advance y by the topMargin between children. Zero out the
|
||||
// topMargin in case this frame is continued because
|
||||
// continuations do not have a top margin. Update the prev
|
||||
// bottom margin state in the body reflow state so that we can
|
||||
// apply the bottom margin when we hit the next child (or
|
||||
// finish).
|
||||
//aState.y += topMargin;
|
||||
nsRect kidRect (0, 0, kidSize.width, kidSize.height);
|
||||
//kidRect.x += kidMol->margin.left;
|
||||
kidRect.y += aState.y;
|
||||
const nsStyleDisplay *childDisplay;
|
||||
kidFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
|
||||
if (NS_STYLE_DISPLAY_TABLE_ROW_GROUP == childDisplay->mDisplay ||
|
||||
NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == childDisplay->mDisplay ||
|
||||
NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == childDisplay->mDisplay )
|
||||
{
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize);
|
||||
}
|
||||
// Advance y by the topMargin between children. Zero out the
|
||||
// topMargin in case this frame is continued because
|
||||
// continuations do not have a top margin. Update the prev
|
||||
// bottom margin state in the body reflow state so that we can
|
||||
// apply the bottom margin when we hit the next child (or
|
||||
// finish).
|
||||
//aState.y += topMargin;
|
||||
nsRect kidRect (0, 0, kidSize.width, kidSize.height);
|
||||
//kidRect.x += kidMol->margin.left;
|
||||
kidRect.y += aState.y;
|
||||
const nsStyleDisplay *childDisplay;
|
||||
kidFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
|
||||
if (NS_STYLE_DISPLAY_TABLE_ROW_GROUP == childDisplay->mDisplay ||
|
||||
NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == childDisplay->mDisplay ||
|
||||
NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == childDisplay->mDisplay )
|
||||
{
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize);
|
||||
}
|
||||
|
||||
// Remove the frame from its current parent
|
||||
|
|
|
@ -464,19 +464,14 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext& aPresContext,
|
|||
nsHTMLReflowState innerReflowState(mInnerTableFrame, aReflowState,
|
||||
nsSize(tableWidth, aReflowState.maxSize.height));
|
||||
nsHTMLReflowMetrics innerSize(aDesiredSize.maxElementSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == mInnerTableFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(mInnerTableFrame, &aPresContext, innerSize,
|
||||
innerReflowState);
|
||||
ReflowChild(mInnerTableFrame, aPresContext, innerSize, innerReflowState, aStatus);
|
||||
|
||||
// Table's max element size is the MAX of the caption's max element size
|
||||
// and the inner table's max element size...
|
||||
if (nsnull != aDesiredSize.maxElementSize) {
|
||||
if (mMinCaptionWidth > aDesiredSize.maxElementSize->width) {
|
||||
aDesiredSize.maxElementSize->width = mMinCaptionWidth;
|
||||
}
|
||||
// Table's max element size is the MAX of the caption's max element size
|
||||
// and the inner table's max element size...
|
||||
if (nsnull != aDesiredSize.maxElementSize) {
|
||||
if (mMinCaptionWidth > aDesiredSize.maxElementSize->width) {
|
||||
aDesiredSize.maxElementSize->width = mMinCaptionWidth;
|
||||
}
|
||||
}
|
||||
state.innerTableMaxSize.width = innerSize.width;
|
||||
|
|
|
@ -477,37 +477,32 @@ nsresult nsTableRowFrame::ResizeReflow(nsIPresContext& aPresContext,
|
|||
nsSize kidAvailSize(availWidth, NS_UNCONSTRAINEDSIZE);
|
||||
|
||||
// Reflow the child
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aState.reflowState, kidAvailSize,
|
||||
eReflowReason_Resize);
|
||||
if (gsDebug) printf ("%p RR: avail=%d\n", this, availWidth);
|
||||
nsReflowStatus status = ReflowChild(kidFrame, &aPresContext, desiredSize,
|
||||
kidReflowState);
|
||||
if (gsDebug) printf ("%p RR: desired=%d\n", this, desiredSize.width);
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aState.reflowState, kidAvailSize,
|
||||
eReflowReason_Resize);
|
||||
if (gsDebug) printf ("%p RR: avail=%d\n", this, availWidth);
|
||||
nsReflowStatus status;
|
||||
ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState, status);
|
||||
if (gsDebug) printf ("%p RR: desired=%d\n", this, desiredSize.width);
|
||||
#ifdef NS_DEBUG
|
||||
if (desiredSize.width > availWidth)
|
||||
{
|
||||
printf("WARNING: cell returned desired width %d given avail width %d\n",
|
||||
desiredSize.width, availWidth);
|
||||
}
|
||||
if (desiredSize.width > availWidth)
|
||||
{
|
||||
printf("WARNING: cell returned desired width %d given avail width %d\n",
|
||||
desiredSize.width, availWidth);
|
||||
}
|
||||
#endif
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "unexpected reflow status");
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "unexpected reflow status");
|
||||
|
||||
if (gsDebug)
|
||||
{
|
||||
if (nsnull!=pKidMaxElementSize)
|
||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
|
||||
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||
desiredSize.width, desiredSize.height,
|
||||
pKidMaxElementSize->width, pKidMaxElementSize->height);
|
||||
else
|
||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n",
|
||||
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||
desiredSize.width, desiredSize.height);
|
||||
}
|
||||
if (gsDebug)
|
||||
{
|
||||
if (nsnull!=pKidMaxElementSize)
|
||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
|
||||
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||
desiredSize.width, desiredSize.height,
|
||||
pKidMaxElementSize->width, pKidMaxElementSize->height);
|
||||
else
|
||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n",
|
||||
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||
desiredSize.width, desiredSize.height);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -652,40 +647,37 @@ nsTableRowFrame::InitialReflow(nsIPresContext& aPresContext,
|
|||
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aState.reflowState, kidAvailSize,
|
||||
eReflowReason_Initial);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
if (gsDebug) printf ("%p InitR: avail=%d\n", this, kidAvailSize.width);
|
||||
nsresult status = ReflowChild(kidFrame, &aPresContext, kidSize, kidReflowState);
|
||||
if (gsDebug)
|
||||
printf ("TR %p for cell %p Initial Reflow: desired=%d, MES=%d\n",
|
||||
this, kidFrame, kidSize.width, kidMaxElementSize.width);
|
||||
//XXX: this is a hack, shouldn't it be the case that a min size is
|
||||
// never larger than a desired size?
|
||||
if (kidMaxElementSize.width>kidSize.width)
|
||||
kidSize.width = kidMaxElementSize.width;
|
||||
if (kidMaxElementSize.height>kidSize.height)
|
||||
kidSize.height = kidMaxElementSize.height;
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1DesiredSize(kidSize);
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1MaxElementSize(kidMaxElementSize);
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "unexpected child reflow status");
|
||||
if (gsDebug) printf ("%p InitR: avail=%d\n", this, kidAvailSize.width);
|
||||
nsresult status;
|
||||
ReflowChild(kidFrame, aPresContext, kidSize, kidReflowState, status);
|
||||
if (gsDebug)
|
||||
printf ("TR %p for cell %p Initial Reflow: desired=%d, MES=%d\n",
|
||||
this, kidFrame, kidSize.width, kidMaxElementSize.width);
|
||||
//XXX: this is a hack, shouldn't it be the case that a min size is
|
||||
// never larger than a desired size?
|
||||
if (kidMaxElementSize.width>kidSize.width)
|
||||
kidSize.width = kidMaxElementSize.width;
|
||||
if (kidMaxElementSize.height>kidSize.height)
|
||||
kidSize.height = kidMaxElementSize.height;
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1DesiredSize(kidSize);
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1MaxElementSize(kidMaxElementSize);
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "unexpected child reflow status");
|
||||
|
||||
if (gsDebug)
|
||||
{
|
||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
|
||||
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||
kidSize.width, kidSize.height,
|
||||
kidMaxElementSize.width, kidMaxElementSize.height);
|
||||
}
|
||||
|
||||
// Place the child
|
||||
x += margin.left;
|
||||
nsRect kidRect(x, topMargin, kidSize.width, kidSize.height);
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect, aDesiredSize.maxElementSize,
|
||||
&kidMaxElementSize);
|
||||
x += kidSize.width + margin.right;
|
||||
if (gsDebug)
|
||||
{
|
||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
|
||||
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||
kidSize.width, kidSize.height,
|
||||
kidMaxElementSize.width, kidMaxElementSize.height);
|
||||
}
|
||||
|
||||
// Place the child
|
||||
x += margin.left;
|
||||
nsRect kidRect(x, topMargin, kidSize.width, kidSize.height);
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect, aDesiredSize.maxElementSize,
|
||||
&kidMaxElementSize);
|
||||
x += kidSize.width + margin.right;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -850,83 +842,78 @@ nsresult nsTableRowFrame::IncrementalReflow(nsIPresContext& aPresContext,
|
|||
nsSize kidMaxElementSize;
|
||||
nsHTMLReflowMetrics desiredSize(&kidMaxElementSize);
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aState.reflowState, kidAvailSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
// XXX Unfortunately we need to reflow the child several times.
|
||||
// The first time is for the incremental reflow command. We can't pass in
|
||||
// a max width of NS_UNCONSTRAINEDSIZE, because the max width must match
|
||||
// the width of the previous reflow...
|
||||
ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState, status);
|
||||
|
||||
// XXX Unfortunately we need to reflow the child several times.
|
||||
// The first time is for the incremental reflow command. We can't pass in
|
||||
// a max width of NS_UNCONSTRAINEDSIZE, because the max width must match
|
||||
// the width of the previous reflow...
|
||||
status = ReflowChild(kidFrame, &aPresContext, desiredSize, kidReflowState);
|
||||
// Now do the regular pass 1 reflow and gather the max width and max element
|
||||
// size.
|
||||
// XXX It would be nice if we could skip this step and the next step if the
|
||||
// column width isn't dependent on the max cell width...
|
||||
kidReflowState.reason = eReflowReason_Resize;
|
||||
kidReflowState.reflowCommand = nsnull;
|
||||
kidReflowState.maxSize.width = NS_UNCONSTRAINEDSIZE;
|
||||
ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState, status);
|
||||
if (gsDebug)
|
||||
printf ("TR %p for cell %p Incremental Reflow: desired=%d, MES=%d\n",
|
||||
this, kidFrame, desiredSize.width, kidMaxElementSize.width);
|
||||
// Update the cell layout data.
|
||||
//XXX: this is a hack, shouldn't it be the case that a min size is
|
||||
// never larger than a desired size?
|
||||
if (kidMaxElementSize.width>desiredSize.width)
|
||||
desiredSize.width = kidMaxElementSize.width;
|
||||
if (kidMaxElementSize.height>desiredSize.height)
|
||||
desiredSize.height = kidMaxElementSize.height;
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1DesiredSize(desiredSize);
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1MaxElementSize(kidMaxElementSize);
|
||||
|
||||
// Now reflow the cell again this time constraining the width
|
||||
// XXX Ignore for now the possibility that the column width has changed...
|
||||
kidReflowState.maxSize.width = availWidth;
|
||||
ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState, status);
|
||||
|
||||
// Place the child after taking into account it's margin and attributes
|
||||
// XXX We need to ask the table (or the table layout strategy) if the column
|
||||
// widths have changed. If so, we just bail and return a status indicating
|
||||
// what happened and let the table reflow all the table cells...
|
||||
nscoord specifiedHeight = 0;
|
||||
nscoord cellHeight = desiredSize.height;
|
||||
nsIStyleContextPtr kidSC;
|
||||
kidFrame->GetStyleContext(&aPresContext, kidSC.AssignRef());
|
||||
const nsStylePosition* kidPosition = (const nsStylePosition*)
|
||||
kidSC->GetStyleData(eStyleStruct_Position);
|
||||
switch (kidPosition->mHeight.GetUnit()) {
|
||||
case eStyleUnit_Coord:
|
||||
specifiedHeight = kidPosition->mHeight.GetCoordValue();
|
||||
break;
|
||||
|
||||
// Now do the regular pass 1 reflow and gather the max width and max element
|
||||
// size.
|
||||
// XXX It would be nice if we could skip this step and the next step if the
|
||||
// column width isn't dependent on the max cell width...
|
||||
kidReflowState.reason = eReflowReason_Resize;
|
||||
kidReflowState.reflowCommand = nsnull;
|
||||
kidReflowState.maxSize.width = NS_UNCONSTRAINEDSIZE;
|
||||
status = ReflowChild(kidFrame, &aPresContext, desiredSize, kidReflowState);
|
||||
if (gsDebug)
|
||||
printf ("TR %p for cell %p Incremental Reflow: desired=%d, MES=%d\n",
|
||||
this, kidFrame, desiredSize.width, kidMaxElementSize.width);
|
||||
// Update the cell layout data.
|
||||
//XXX: this is a hack, shouldn't it be the case that a min size is
|
||||
// never larger than a desired size?
|
||||
if (kidMaxElementSize.width>desiredSize.width)
|
||||
desiredSize.width = kidMaxElementSize.width;
|
||||
if (kidMaxElementSize.height>desiredSize.height)
|
||||
desiredSize.height = kidMaxElementSize.height;
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1DesiredSize(desiredSize);
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1MaxElementSize(kidMaxElementSize);
|
||||
|
||||
// Now reflow the cell again this time constraining the width
|
||||
// XXX Ignore for now the possibility that the column width has changed...
|
||||
kidReflowState.maxSize.width = availWidth;
|
||||
status = ReflowChild(kidFrame, &aPresContext, desiredSize, kidReflowState);
|
||||
|
||||
// Place the child after taking into account it's margin and attributes
|
||||
// XXX We need to ask the table (or the table layout strategy) if the column
|
||||
// widths have changed. If so, we just bail and return a status indicating
|
||||
// what happened and let the table reflow all the table cells...
|
||||
nscoord specifiedHeight = 0;
|
||||
nscoord cellHeight = desiredSize.height;
|
||||
nsIStyleContextPtr kidSC;
|
||||
kidFrame->GetStyleContext(&aPresContext, kidSC.AssignRef());
|
||||
const nsStylePosition* kidPosition = (const nsStylePosition*)
|
||||
kidSC->GetStyleData(eStyleStruct_Position);
|
||||
switch (kidPosition->mHeight.GetUnit()) {
|
||||
case eStyleUnit_Coord:
|
||||
specifiedHeight = kidPosition->mHeight.GetCoordValue();
|
||||
break;
|
||||
|
||||
case eStyleUnit_Inherit:
|
||||
// XXX for now, do nothing
|
||||
default:
|
||||
case eStyleUnit_Auto:
|
||||
break;
|
||||
}
|
||||
if (specifiedHeight>cellHeight)
|
||||
cellHeight = specifiedHeight;
|
||||
|
||||
nscoord cellWidth = desiredSize.width;
|
||||
// begin special Nav4 compatibility code
|
||||
if (0==cellWidth)
|
||||
{
|
||||
cellWidth = aState.tableFrame->GetColumnWidth(cellColIndex);
|
||||
}
|
||||
// end special Nav4 compatibility code
|
||||
|
||||
// Now place the child
|
||||
nsRect kidRect (aState.x, kidMargin.top, cellWidth, cellHeight);
|
||||
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect, aDesiredSize.maxElementSize,
|
||||
&kidMaxElementSize);
|
||||
|
||||
SetMaxChildHeight(aState.maxCellHeight, maxCellTopMargin, maxCellBottomMargin);
|
||||
case eStyleUnit_Inherit:
|
||||
// XXX for now, do nothing
|
||||
default:
|
||||
case eStyleUnit_Auto:
|
||||
break;
|
||||
}
|
||||
if (specifiedHeight>cellHeight)
|
||||
cellHeight = specifiedHeight;
|
||||
|
||||
nscoord cellWidth = desiredSize.width;
|
||||
// begin special Nav4 compatibility code
|
||||
if (0==cellWidth)
|
||||
{
|
||||
cellWidth = aState.tableFrame->GetColumnWidth(cellColIndex);
|
||||
}
|
||||
// end special Nav4 compatibility code
|
||||
|
||||
// Now place the child
|
||||
nsRect kidRect (aState.x, kidMargin.top, cellWidth, cellHeight);
|
||||
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect, aDesiredSize.maxElementSize,
|
||||
&kidMaxElementSize);
|
||||
|
||||
SetMaxChildHeight(aState.maxCellHeight, maxCellTopMargin, maxCellBottomMargin);
|
||||
|
||||
// Return our desired size. Note that our desired width is just whatever width
|
||||
// we were given by the row group frame
|
||||
|
|
|
@ -301,40 +301,36 @@ PRBool nsTableRowGroupFrame::ReflowMappedChildren( nsIPresContext* aPresCon
|
|||
|
||||
// Reflow the child into the available space
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aState.reflowState, kidAvailSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(*aPresContext);
|
||||
if (gsDebug) printf("%p RG reflowing child %d (frame=%p) with avail width = %d\n",
|
||||
this, debugCounter, kidFrame, kidAvailSize.width);
|
||||
status = ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState);
|
||||
if (gsDebug) printf("%p RG child %d (frame=%p) returned desired width = %d\n",
|
||||
this, debugCounter, kidFrame, desiredSize.width);
|
||||
if (gsDebug) printf("%p RG reflowing child %d (frame=%p) with avail width = %d\n",
|
||||
this, debugCounter, kidFrame, kidAvailSize.width);
|
||||
ReflowChild(kidFrame, *aPresContext, desiredSize, kidReflowState, status);
|
||||
if (gsDebug) printf("%p RG child %d (frame=%p) returned desired width = %d\n",
|
||||
this, debugCounter, kidFrame, desiredSize.width);
|
||||
|
||||
// Did the child fit?
|
||||
if ((kidFrame != mFirstChild) &&
|
||||
((kidAvailSize.height <= 0) ||
|
||||
(desiredSize.height > kidAvailSize.height)))
|
||||
{
|
||||
// The child's height is too big to fit at all in our remaining space,
|
||||
// and it's not our first child.
|
||||
//
|
||||
// Note that if the width is too big that's okay and we allow the
|
||||
// child to extend horizontally outside of the reflow area
|
||||
PushChildren(kidFrame, prevKidFrame);
|
||||
result = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
// Did the child fit?
|
||||
if ((kidFrame != mFirstChild) &&
|
||||
((kidAvailSize.height <= 0) ||
|
||||
(desiredSize.height > kidAvailSize.height)))
|
||||
{
|
||||
// The child's height is too big to fit at all in our remaining space,
|
||||
// and it's not our first child.
|
||||
//
|
||||
// Note that if the width is too big that's okay and we allow the
|
||||
// child to extend horizontally outside of the reflow area
|
||||
PushChildren(kidFrame, prevKidFrame);
|
||||
result = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
// Place the child after taking into account it's margin
|
||||
nsRect kidRect (kidMargin.left, aState.y, desiredSize.width, desiredSize.height);
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize,
|
||||
kidMaxElementSize);
|
||||
if (bottomMargin < 0) {
|
||||
aState.prevMaxNegBottomMargin = -bottomMargin;
|
||||
} else {
|
||||
aState.prevMaxPosBottomMargin = bottomMargin;
|
||||
}
|
||||
// Place the child after taking into account it's margin
|
||||
nsRect kidRect (kidMargin.left, aState.y, desiredSize.width, desiredSize.height);
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize,
|
||||
kidMaxElementSize);
|
||||
if (bottomMargin < 0) {
|
||||
aState.prevMaxNegBottomMargin = -bottomMargin;
|
||||
} else {
|
||||
aState.prevMaxPosBottomMargin = bottomMargin;
|
||||
}
|
||||
|
||||
// Remember where we just were in case we end up pushing children
|
||||
|
@ -453,28 +449,24 @@ PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||
}
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aState.reflowState, aState.availSize,
|
||||
eReflowReason_Resize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(*aPresContext);
|
||||
status = ReflowChild(kidFrame, aPresContext, kidSize, kidReflowState);
|
||||
ReflowChild(kidFrame, *aPresContext, kidSize, kidReflowState, status);
|
||||
|
||||
// Did the child fit?
|
||||
if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) {
|
||||
// The child is too wide to fit in the available space, and it's
|
||||
// not our first child
|
||||
result = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
// Place the child
|
||||
//aState.y += topMargin;
|
||||
nsRect kidRect (0, 0, kidSize.width, kidSize.height);
|
||||
//kidRect.x += kidMol->margin.left;
|
||||
kidRect.y += aState.y;
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize);
|
||||
// Did the child fit?
|
||||
if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) {
|
||||
// The child is too wide to fit in the available space, and it's
|
||||
// not our first child
|
||||
result = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
// Place the child
|
||||
//aState.y += topMargin;
|
||||
nsRect kidRect (0, 0, kidSize.width, kidSize.height);
|
||||
//kidRect.x += kidMol->margin.left;
|
||||
kidRect.y += aState.y;
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize);
|
||||
|
||||
// Remove the frame from its current parent
|
||||
kidFrame->GetNextSibling(nextInFlow->mFirstChild);
|
||||
|
||||
|
@ -780,21 +772,17 @@ nsTableRowGroupFrame::Reflow(nsIPresContext& aPresContext,
|
|||
// XXX Correctly compute the available space...
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aReflowState, aReflowState.maxSize);
|
||||
nsHTMLReflowMetrics desiredSize(nsnull);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(kidFrame, &aPresContext, desiredSize, kidReflowState);
|
||||
ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState, aStatus);
|
||||
|
||||
// Resize the row frame
|
||||
nsRect kidRect;
|
||||
kidFrame->GetRect(kidRect);
|
||||
kidFrame->SizeTo(desiredSize.width, desiredSize.height);
|
||||
// Resize the row frame
|
||||
nsRect kidRect;
|
||||
kidFrame->GetRect(kidRect);
|
||||
kidFrame->SizeTo(desiredSize.width, desiredSize.height);
|
||||
|
||||
// Adjust the frames that follow...
|
||||
AdjustSiblingsAfterReflow(&aPresContext, state, kidFrame, desiredSize.height -
|
||||
oldKidRect.height);
|
||||
}
|
||||
// Adjust the frames that follow...
|
||||
AdjustSiblingsAfterReflow(&aPresContext, state, kidFrame, desiredSize.height -
|
||||
oldKidRect.height);
|
||||
|
||||
// Return of desired size
|
||||
aDesiredSize.width = aReflowState.maxSize.width;
|
||||
|
|
|
@ -326,19 +326,15 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext& aPresContext,
|
|||
kidSize.width=kidSize.height=kidSize.ascent=kidSize.descent=0;
|
||||
SetPriorAvailWidth(aReflowState.maxSize.width);
|
||||
nsHTMLReflowState kidReflowState(mFirstChild, aReflowState, availSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == mFirstChild->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(mFirstChild, &aPresContext, kidSize, kidReflowState);
|
||||
ReflowChild(mFirstChild, aPresContext, kidSize, kidReflowState, aStatus);
|
||||
#ifdef NS_DEBUG
|
||||
if (kidSize.width > availSize.width)
|
||||
{
|
||||
printf("WARNING: cell content returned desired width %d given avail width %d\n",
|
||||
kidSize.width, availSize.width);
|
||||
}
|
||||
#endif
|
||||
if (kidSize.width > availSize.width)
|
||||
{
|
||||
printf("WARNING: cell content returned desired width %d given avail width %d\n",
|
||||
kidSize.width, availSize.width);
|
||||
}
|
||||
#endif
|
||||
if (PR_TRUE==gsDebug || PR_TRUE==gsDebugNT)
|
||||
{
|
||||
if (nsnull!=pMaxElementSize)
|
||||
|
|
|
@ -208,15 +208,11 @@ NS_METHOD nsTableColGroupFrame::Reflow(nsIPresContext& aPresContext,
|
|||
nsHTMLReflowMetrics kidSize(nsnull);
|
||||
// XXX Use a valid reason...
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aReflowState, nsSize(0,0), eReflowReason_Initial);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
nsReflowStatus status = ReflowChild(kidFrame,&aPresContext, kidSize,
|
||||
kidReflowState);
|
||||
// note that DidReflow is called as the result of some ancestor firing off a DidReflow above me
|
||||
kidFrame->SetRect(nsRect(0,0,0,0));
|
||||
}
|
||||
nsReflowStatus status;
|
||||
ReflowChild(kidFrame, aPresContext, kidSize, kidReflowState, status);
|
||||
// note that DidReflow is called as the result of some ancestor firing off a DidReflow above me
|
||||
kidFrame->SetRect(nsRect(0,0,0,0));
|
||||
}
|
||||
|
||||
aDesiredSize.width=0;
|
||||
|
|
|
@ -1535,17 +1535,13 @@ NS_METHOD nsTableFrame::Reflow(nsIPresContext& aPresContext,
|
|||
nsHTMLReflowMetrics desiredSize(nsnull);
|
||||
// XXX Correctly compute the available space...
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aReflowState, aReflowState.maxSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(kidFrame, &aPresContext, desiredSize, kidReflowState);
|
||||
ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState, aStatus);
|
||||
|
||||
// Resize the row group frame
|
||||
nsRect kidRect;
|
||||
kidFrame->GetRect(kidRect);
|
||||
kidFrame->SizeTo(desiredSize.width, desiredSize.height);
|
||||
}
|
||||
// Resize the row group frame
|
||||
nsRect kidRect;
|
||||
kidFrame->GetRect(kidRect);
|
||||
kidFrame->SizeTo(desiredSize.width, desiredSize.height);
|
||||
|
||||
#if 1
|
||||
// XXX For the time being just fall through and treat it like a
|
||||
|
@ -1681,38 +1677,33 @@ nsReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresContext,
|
|||
}
|
||||
nsSize maxKidElementSize(0,0);
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aReflowState, availSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
PRInt32 yCoord = y;
|
||||
if (NS_UNCONSTRAINEDSIZE!=yCoord)
|
||||
yCoord+= topInset;
|
||||
htmlReflow->WillReflow(*aPresContext);
|
||||
result = ReflowChild(kidFrame, aPresContext, kidSize, kidReflowState);
|
||||
PRInt32 yCoord = y;
|
||||
if (NS_UNCONSTRAINEDSIZE!=yCoord)
|
||||
yCoord+= topInset;
|
||||
ReflowChild(kidFrame, *aPresContext, kidSize, kidReflowState, result);
|
||||
|
||||
// Place the child since some of its content fit in us.
|
||||
if (PR_TRUE==gsDebugNT) {
|
||||
printf ("%p: reflow of row group returned desired=%d,%d, max-element=%d,%d\n",
|
||||
this, kidSize.width, kidSize.height, kidMaxSize.width, kidMaxSize.height);
|
||||
}
|
||||
kidFrame->SetRect(nsRect(leftInset, yCoord,
|
||||
kidSize.width, kidSize.height));
|
||||
if (NS_UNCONSTRAINEDSIZE==kidSize.height)
|
||||
y = NS_UNCONSTRAINEDSIZE;
|
||||
else
|
||||
y += kidSize.height;
|
||||
if (kidMaxSize.width > maxSize.width) {
|
||||
maxSize.width = kidMaxSize.width;
|
||||
}
|
||||
if (kidMaxSize.height > maxSize.height) {
|
||||
maxSize.height = kidMaxSize.height;
|
||||
}
|
||||
// Place the child since some of its content fit in us.
|
||||
if (PR_TRUE==gsDebugNT) {
|
||||
printf ("%p: reflow of row group returned desired=%d,%d, max-element=%d,%d\n",
|
||||
this, kidSize.width, kidSize.height, kidMaxSize.width, kidMaxSize.height);
|
||||
}
|
||||
kidFrame->SetRect(nsRect(leftInset, yCoord, kidSize.width, kidSize.height));
|
||||
if (NS_UNCONSTRAINEDSIZE==kidSize.height)
|
||||
y = NS_UNCONSTRAINEDSIZE;
|
||||
else
|
||||
y += kidSize.height;
|
||||
if (kidMaxSize.width > maxSize.width) {
|
||||
maxSize.width = kidMaxSize.width;
|
||||
}
|
||||
if (kidMaxSize.height > maxSize.height) {
|
||||
maxSize.height = kidMaxSize.height;
|
||||
}
|
||||
|
||||
if (NS_FRAME_IS_NOT_COMPLETE(result)) {
|
||||
// If the child didn't finish layout then it means that it used
|
||||
// up all of our available space (or needs us to split).
|
||||
break;
|
||||
}
|
||||
if (NS_FRAME_IS_NOT_COMPLETE(result)) {
|
||||
// If the child didn't finish layout then it means that it used
|
||||
// up all of our available space (or needs us to split).
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1998,42 +1989,38 @@ PRBool nsTableFrame::ReflowMappedChildren( nsIPresContext* aPresContext,
|
|||
// Reflow the child into the available space
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aState.reflowState, kidAvailSize,
|
||||
reason);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(*aPresContext);
|
||||
nscoord x = aState.leftInset + kidMargin.left;
|
||||
nscoord y = aState.topInset + aState.y + topMargin;
|
||||
status = ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState);
|
||||
// Did the child fit?
|
||||
if ((kidFrame != mFirstChild) && (desiredSize.height > kidAvailSize.height))
|
||||
{
|
||||
// The child is too wide to fit in the available space, and it's
|
||||
// not our first child
|
||||
PushChildren(kidFrame, prevKidFrame);
|
||||
result = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
nscoord x = aState.leftInset + kidMargin.left;
|
||||
nscoord y = aState.topInset + aState.y + topMargin;
|
||||
ReflowChild(kidFrame, *aPresContext, desiredSize, kidReflowState, status);
|
||||
// Did the child fit?
|
||||
if ((kidFrame != mFirstChild) && (desiredSize.height > kidAvailSize.height))
|
||||
{
|
||||
// The child is too wide to fit in the available space, and it's
|
||||
// not our first child
|
||||
PushChildren(kidFrame, prevKidFrame);
|
||||
result = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
// Place the child after taking into account it's margin
|
||||
aState.y += topMargin;
|
||||
nsRect kidRect (x, y, desiredSize.width, desiredSize.height);
|
||||
if (NS_STYLE_DISPLAY_TABLE_ROW_GROUP == childDisplay->mDisplay ||
|
||||
NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == childDisplay->mDisplay ||
|
||||
NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == childDisplay->mDisplay )
|
||||
{
|
||||
// we don't want to adjust the maxElementSize if this is an initial reflow
|
||||
// it was set by the TableLayoutStrategy and shouldn't be changed.
|
||||
nsSize *requestedMaxElementSize = nsnull;
|
||||
if (eReflowReason_Initial != aState.reflowState.reason)
|
||||
requestedMaxElementSize = aMaxElementSize;
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect,
|
||||
requestedMaxElementSize, kidMaxElementSize);
|
||||
if (bottomMargin < 0) {
|
||||
aState.prevMaxNegBottomMargin = -bottomMargin;
|
||||
} else {
|
||||
aState.prevMaxPosBottomMargin = bottomMargin;
|
||||
}
|
||||
// Place the child after taking into account it's margin
|
||||
aState.y += topMargin;
|
||||
nsRect kidRect (x, y, desiredSize.width, desiredSize.height);
|
||||
if (NS_STYLE_DISPLAY_TABLE_ROW_GROUP == childDisplay->mDisplay ||
|
||||
NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == childDisplay->mDisplay ||
|
||||
NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == childDisplay->mDisplay )
|
||||
{
|
||||
// we don't want to adjust the maxElementSize if this is an initial reflow
|
||||
// it was set by the TableLayoutStrategy and shouldn't be changed.
|
||||
nsSize *requestedMaxElementSize = nsnull;
|
||||
if (eReflowReason_Initial != aState.reflowState.reason)
|
||||
requestedMaxElementSize = aMaxElementSize;
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect,
|
||||
requestedMaxElementSize, kidMaxElementSize);
|
||||
if (bottomMargin < 0) {
|
||||
aState.prevMaxNegBottomMargin = -bottomMargin;
|
||||
} else {
|
||||
aState.prevMaxPosBottomMargin = bottomMargin;
|
||||
}
|
||||
}
|
||||
childCount++;
|
||||
|
@ -2143,38 +2130,34 @@ PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||
}
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aState.reflowState, aState.availSize,
|
||||
eReflowReason_Resize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(*aPresContext);
|
||||
status = ReflowChild(kidFrame, aPresContext, kidSize, kidReflowState);
|
||||
ReflowChild(kidFrame, *aPresContext, kidSize, kidReflowState, status);
|
||||
|
||||
// Did the child fit?
|
||||
if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) {
|
||||
// The child is too wide to fit in the available space, and it's
|
||||
// not our first child
|
||||
result = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
// Did the child fit?
|
||||
if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) {
|
||||
// The child is too wide to fit in the available space, and it's
|
||||
// not our first child
|
||||
result = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
// Advance y by the topMargin between children. Zero out the
|
||||
// topMargin in case this frame is continued because
|
||||
// continuations do not have a top margin. Update the prev
|
||||
// bottom margin state in the body reflow state so that we can
|
||||
// apply the bottom margin when we hit the next child (or
|
||||
// finish).
|
||||
//aState.y += topMargin;
|
||||
nsRect kidRect (0, 0, kidSize.width, kidSize.height);
|
||||
//kidRect.x += kidMol->margin.left;
|
||||
kidRect.y += aState.y;
|
||||
const nsStyleDisplay *childDisplay;
|
||||
kidFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
|
||||
if (NS_STYLE_DISPLAY_TABLE_ROW_GROUP == childDisplay->mDisplay ||
|
||||
NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == childDisplay->mDisplay ||
|
||||
NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == childDisplay->mDisplay )
|
||||
{
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize);
|
||||
}
|
||||
// Advance y by the topMargin between children. Zero out the
|
||||
// topMargin in case this frame is continued because
|
||||
// continuations do not have a top margin. Update the prev
|
||||
// bottom margin state in the body reflow state so that we can
|
||||
// apply the bottom margin when we hit the next child (or
|
||||
// finish).
|
||||
//aState.y += topMargin;
|
||||
nsRect kidRect (0, 0, kidSize.width, kidSize.height);
|
||||
//kidRect.x += kidMol->margin.left;
|
||||
kidRect.y += aState.y;
|
||||
const nsStyleDisplay *childDisplay;
|
||||
kidFrame->GetStyleData(eStyleStruct_Display, ((nsStyleStruct *&)childDisplay));
|
||||
if (NS_STYLE_DISPLAY_TABLE_ROW_GROUP == childDisplay->mDisplay ||
|
||||
NS_STYLE_DISPLAY_TABLE_HEADER_GROUP == childDisplay->mDisplay ||
|
||||
NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP == childDisplay->mDisplay )
|
||||
{
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize);
|
||||
}
|
||||
|
||||
// Remove the frame from its current parent
|
||||
|
|
|
@ -464,19 +464,14 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext& aPresContext,
|
|||
nsHTMLReflowState innerReflowState(mInnerTableFrame, aReflowState,
|
||||
nsSize(tableWidth, aReflowState.maxSize.height));
|
||||
nsHTMLReflowMetrics innerSize(aDesiredSize.maxElementSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == mInnerTableFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(mInnerTableFrame, &aPresContext, innerSize,
|
||||
innerReflowState);
|
||||
ReflowChild(mInnerTableFrame, aPresContext, innerSize, innerReflowState, aStatus);
|
||||
|
||||
// Table's max element size is the MAX of the caption's max element size
|
||||
// and the inner table's max element size...
|
||||
if (nsnull != aDesiredSize.maxElementSize) {
|
||||
if (mMinCaptionWidth > aDesiredSize.maxElementSize->width) {
|
||||
aDesiredSize.maxElementSize->width = mMinCaptionWidth;
|
||||
}
|
||||
// Table's max element size is the MAX of the caption's max element size
|
||||
// and the inner table's max element size...
|
||||
if (nsnull != aDesiredSize.maxElementSize) {
|
||||
if (mMinCaptionWidth > aDesiredSize.maxElementSize->width) {
|
||||
aDesiredSize.maxElementSize->width = mMinCaptionWidth;
|
||||
}
|
||||
}
|
||||
state.innerTableMaxSize.width = innerSize.width;
|
||||
|
|
|
@ -477,37 +477,32 @@ nsresult nsTableRowFrame::ResizeReflow(nsIPresContext& aPresContext,
|
|||
nsSize kidAvailSize(availWidth, NS_UNCONSTRAINEDSIZE);
|
||||
|
||||
// Reflow the child
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aState.reflowState, kidAvailSize,
|
||||
eReflowReason_Resize);
|
||||
if (gsDebug) printf ("%p RR: avail=%d\n", this, availWidth);
|
||||
nsReflowStatus status = ReflowChild(kidFrame, &aPresContext, desiredSize,
|
||||
kidReflowState);
|
||||
if (gsDebug) printf ("%p RR: desired=%d\n", this, desiredSize.width);
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aState.reflowState, kidAvailSize,
|
||||
eReflowReason_Resize);
|
||||
if (gsDebug) printf ("%p RR: avail=%d\n", this, availWidth);
|
||||
nsReflowStatus status;
|
||||
ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState, status);
|
||||
if (gsDebug) printf ("%p RR: desired=%d\n", this, desiredSize.width);
|
||||
#ifdef NS_DEBUG
|
||||
if (desiredSize.width > availWidth)
|
||||
{
|
||||
printf("WARNING: cell returned desired width %d given avail width %d\n",
|
||||
desiredSize.width, availWidth);
|
||||
}
|
||||
if (desiredSize.width > availWidth)
|
||||
{
|
||||
printf("WARNING: cell returned desired width %d given avail width %d\n",
|
||||
desiredSize.width, availWidth);
|
||||
}
|
||||
#endif
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "unexpected reflow status");
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "unexpected reflow status");
|
||||
|
||||
if (gsDebug)
|
||||
{
|
||||
if (nsnull!=pKidMaxElementSize)
|
||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
|
||||
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||
desiredSize.width, desiredSize.height,
|
||||
pKidMaxElementSize->width, pKidMaxElementSize->height);
|
||||
else
|
||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n",
|
||||
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||
desiredSize.width, desiredSize.height);
|
||||
}
|
||||
if (gsDebug)
|
||||
{
|
||||
if (nsnull!=pKidMaxElementSize)
|
||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
|
||||
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||
desiredSize.width, desiredSize.height,
|
||||
pKidMaxElementSize->width, pKidMaxElementSize->height);
|
||||
else
|
||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n",
|
||||
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||
desiredSize.width, desiredSize.height);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -652,40 +647,37 @@ nsTableRowFrame::InitialReflow(nsIPresContext& aPresContext,
|
|||
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aState.reflowState, kidAvailSize,
|
||||
eReflowReason_Initial);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
if (gsDebug) printf ("%p InitR: avail=%d\n", this, kidAvailSize.width);
|
||||
nsresult status = ReflowChild(kidFrame, &aPresContext, kidSize, kidReflowState);
|
||||
if (gsDebug)
|
||||
printf ("TR %p for cell %p Initial Reflow: desired=%d, MES=%d\n",
|
||||
this, kidFrame, kidSize.width, kidMaxElementSize.width);
|
||||
//XXX: this is a hack, shouldn't it be the case that a min size is
|
||||
// never larger than a desired size?
|
||||
if (kidMaxElementSize.width>kidSize.width)
|
||||
kidSize.width = kidMaxElementSize.width;
|
||||
if (kidMaxElementSize.height>kidSize.height)
|
||||
kidSize.height = kidMaxElementSize.height;
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1DesiredSize(kidSize);
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1MaxElementSize(kidMaxElementSize);
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "unexpected child reflow status");
|
||||
if (gsDebug) printf ("%p InitR: avail=%d\n", this, kidAvailSize.width);
|
||||
nsresult status;
|
||||
ReflowChild(kidFrame, aPresContext, kidSize, kidReflowState, status);
|
||||
if (gsDebug)
|
||||
printf ("TR %p for cell %p Initial Reflow: desired=%d, MES=%d\n",
|
||||
this, kidFrame, kidSize.width, kidMaxElementSize.width);
|
||||
//XXX: this is a hack, shouldn't it be the case that a min size is
|
||||
// never larger than a desired size?
|
||||
if (kidMaxElementSize.width>kidSize.width)
|
||||
kidSize.width = kidMaxElementSize.width;
|
||||
if (kidMaxElementSize.height>kidSize.height)
|
||||
kidSize.height = kidMaxElementSize.height;
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1DesiredSize(kidSize);
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1MaxElementSize(kidMaxElementSize);
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "unexpected child reflow status");
|
||||
|
||||
if (gsDebug)
|
||||
{
|
||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
|
||||
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||
kidSize.width, kidSize.height,
|
||||
kidMaxElementSize.width, kidMaxElementSize.height);
|
||||
}
|
||||
|
||||
// Place the child
|
||||
x += margin.left;
|
||||
nsRect kidRect(x, topMargin, kidSize.width, kidSize.height);
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect, aDesiredSize.maxElementSize,
|
||||
&kidMaxElementSize);
|
||||
x += kidSize.width + margin.right;
|
||||
if (gsDebug)
|
||||
{
|
||||
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
|
||||
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
|
||||
kidSize.width, kidSize.height,
|
||||
kidMaxElementSize.width, kidMaxElementSize.height);
|
||||
}
|
||||
|
||||
// Place the child
|
||||
x += margin.left;
|
||||
nsRect kidRect(x, topMargin, kidSize.width, kidSize.height);
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect, aDesiredSize.maxElementSize,
|
||||
&kidMaxElementSize);
|
||||
x += kidSize.width + margin.right;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -850,83 +842,78 @@ nsresult nsTableRowFrame::IncrementalReflow(nsIPresContext& aPresContext,
|
|||
nsSize kidMaxElementSize;
|
||||
nsHTMLReflowMetrics desiredSize(&kidMaxElementSize);
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aState.reflowState, kidAvailSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
// XXX Unfortunately we need to reflow the child several times.
|
||||
// The first time is for the incremental reflow command. We can't pass in
|
||||
// a max width of NS_UNCONSTRAINEDSIZE, because the max width must match
|
||||
// the width of the previous reflow...
|
||||
ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState, status);
|
||||
|
||||
// XXX Unfortunately we need to reflow the child several times.
|
||||
// The first time is for the incremental reflow command. We can't pass in
|
||||
// a max width of NS_UNCONSTRAINEDSIZE, because the max width must match
|
||||
// the width of the previous reflow...
|
||||
status = ReflowChild(kidFrame, &aPresContext, desiredSize, kidReflowState);
|
||||
// Now do the regular pass 1 reflow and gather the max width and max element
|
||||
// size.
|
||||
// XXX It would be nice if we could skip this step and the next step if the
|
||||
// column width isn't dependent on the max cell width...
|
||||
kidReflowState.reason = eReflowReason_Resize;
|
||||
kidReflowState.reflowCommand = nsnull;
|
||||
kidReflowState.maxSize.width = NS_UNCONSTRAINEDSIZE;
|
||||
ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState, status);
|
||||
if (gsDebug)
|
||||
printf ("TR %p for cell %p Incremental Reflow: desired=%d, MES=%d\n",
|
||||
this, kidFrame, desiredSize.width, kidMaxElementSize.width);
|
||||
// Update the cell layout data.
|
||||
//XXX: this is a hack, shouldn't it be the case that a min size is
|
||||
// never larger than a desired size?
|
||||
if (kidMaxElementSize.width>desiredSize.width)
|
||||
desiredSize.width = kidMaxElementSize.width;
|
||||
if (kidMaxElementSize.height>desiredSize.height)
|
||||
desiredSize.height = kidMaxElementSize.height;
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1DesiredSize(desiredSize);
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1MaxElementSize(kidMaxElementSize);
|
||||
|
||||
// Now reflow the cell again this time constraining the width
|
||||
// XXX Ignore for now the possibility that the column width has changed...
|
||||
kidReflowState.maxSize.width = availWidth;
|
||||
ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState, status);
|
||||
|
||||
// Place the child after taking into account it's margin and attributes
|
||||
// XXX We need to ask the table (or the table layout strategy) if the column
|
||||
// widths have changed. If so, we just bail and return a status indicating
|
||||
// what happened and let the table reflow all the table cells...
|
||||
nscoord specifiedHeight = 0;
|
||||
nscoord cellHeight = desiredSize.height;
|
||||
nsIStyleContextPtr kidSC;
|
||||
kidFrame->GetStyleContext(&aPresContext, kidSC.AssignRef());
|
||||
const nsStylePosition* kidPosition = (const nsStylePosition*)
|
||||
kidSC->GetStyleData(eStyleStruct_Position);
|
||||
switch (kidPosition->mHeight.GetUnit()) {
|
||||
case eStyleUnit_Coord:
|
||||
specifiedHeight = kidPosition->mHeight.GetCoordValue();
|
||||
break;
|
||||
|
||||
// Now do the regular pass 1 reflow and gather the max width and max element
|
||||
// size.
|
||||
// XXX It would be nice if we could skip this step and the next step if the
|
||||
// column width isn't dependent on the max cell width...
|
||||
kidReflowState.reason = eReflowReason_Resize;
|
||||
kidReflowState.reflowCommand = nsnull;
|
||||
kidReflowState.maxSize.width = NS_UNCONSTRAINEDSIZE;
|
||||
status = ReflowChild(kidFrame, &aPresContext, desiredSize, kidReflowState);
|
||||
if (gsDebug)
|
||||
printf ("TR %p for cell %p Incremental Reflow: desired=%d, MES=%d\n",
|
||||
this, kidFrame, desiredSize.width, kidMaxElementSize.width);
|
||||
// Update the cell layout data.
|
||||
//XXX: this is a hack, shouldn't it be the case that a min size is
|
||||
// never larger than a desired size?
|
||||
if (kidMaxElementSize.width>desiredSize.width)
|
||||
desiredSize.width = kidMaxElementSize.width;
|
||||
if (kidMaxElementSize.height>desiredSize.height)
|
||||
desiredSize.height = kidMaxElementSize.height;
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1DesiredSize(desiredSize);
|
||||
((nsTableCellFrame *)kidFrame)->SetPass1MaxElementSize(kidMaxElementSize);
|
||||
|
||||
// Now reflow the cell again this time constraining the width
|
||||
// XXX Ignore for now the possibility that the column width has changed...
|
||||
kidReflowState.maxSize.width = availWidth;
|
||||
status = ReflowChild(kidFrame, &aPresContext, desiredSize, kidReflowState);
|
||||
|
||||
// Place the child after taking into account it's margin and attributes
|
||||
// XXX We need to ask the table (or the table layout strategy) if the column
|
||||
// widths have changed. If so, we just bail and return a status indicating
|
||||
// what happened and let the table reflow all the table cells...
|
||||
nscoord specifiedHeight = 0;
|
||||
nscoord cellHeight = desiredSize.height;
|
||||
nsIStyleContextPtr kidSC;
|
||||
kidFrame->GetStyleContext(&aPresContext, kidSC.AssignRef());
|
||||
const nsStylePosition* kidPosition = (const nsStylePosition*)
|
||||
kidSC->GetStyleData(eStyleStruct_Position);
|
||||
switch (kidPosition->mHeight.GetUnit()) {
|
||||
case eStyleUnit_Coord:
|
||||
specifiedHeight = kidPosition->mHeight.GetCoordValue();
|
||||
break;
|
||||
|
||||
case eStyleUnit_Inherit:
|
||||
// XXX for now, do nothing
|
||||
default:
|
||||
case eStyleUnit_Auto:
|
||||
break;
|
||||
}
|
||||
if (specifiedHeight>cellHeight)
|
||||
cellHeight = specifiedHeight;
|
||||
|
||||
nscoord cellWidth = desiredSize.width;
|
||||
// begin special Nav4 compatibility code
|
||||
if (0==cellWidth)
|
||||
{
|
||||
cellWidth = aState.tableFrame->GetColumnWidth(cellColIndex);
|
||||
}
|
||||
// end special Nav4 compatibility code
|
||||
|
||||
// Now place the child
|
||||
nsRect kidRect (aState.x, kidMargin.top, cellWidth, cellHeight);
|
||||
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect, aDesiredSize.maxElementSize,
|
||||
&kidMaxElementSize);
|
||||
|
||||
SetMaxChildHeight(aState.maxCellHeight, maxCellTopMargin, maxCellBottomMargin);
|
||||
case eStyleUnit_Inherit:
|
||||
// XXX for now, do nothing
|
||||
default:
|
||||
case eStyleUnit_Auto:
|
||||
break;
|
||||
}
|
||||
if (specifiedHeight>cellHeight)
|
||||
cellHeight = specifiedHeight;
|
||||
|
||||
nscoord cellWidth = desiredSize.width;
|
||||
// begin special Nav4 compatibility code
|
||||
if (0==cellWidth)
|
||||
{
|
||||
cellWidth = aState.tableFrame->GetColumnWidth(cellColIndex);
|
||||
}
|
||||
// end special Nav4 compatibility code
|
||||
|
||||
// Now place the child
|
||||
nsRect kidRect (aState.x, kidMargin.top, cellWidth, cellHeight);
|
||||
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect, aDesiredSize.maxElementSize,
|
||||
&kidMaxElementSize);
|
||||
|
||||
SetMaxChildHeight(aState.maxCellHeight, maxCellTopMargin, maxCellBottomMargin);
|
||||
|
||||
// Return our desired size. Note that our desired width is just whatever width
|
||||
// we were given by the row group frame
|
||||
|
|
|
@ -301,40 +301,36 @@ PRBool nsTableRowGroupFrame::ReflowMappedChildren( nsIPresContext* aPresCon
|
|||
|
||||
// Reflow the child into the available space
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aState.reflowState, kidAvailSize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(*aPresContext);
|
||||
if (gsDebug) printf("%p RG reflowing child %d (frame=%p) with avail width = %d\n",
|
||||
this, debugCounter, kidFrame, kidAvailSize.width);
|
||||
status = ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState);
|
||||
if (gsDebug) printf("%p RG child %d (frame=%p) returned desired width = %d\n",
|
||||
this, debugCounter, kidFrame, desiredSize.width);
|
||||
if (gsDebug) printf("%p RG reflowing child %d (frame=%p) with avail width = %d\n",
|
||||
this, debugCounter, kidFrame, kidAvailSize.width);
|
||||
ReflowChild(kidFrame, *aPresContext, desiredSize, kidReflowState, status);
|
||||
if (gsDebug) printf("%p RG child %d (frame=%p) returned desired width = %d\n",
|
||||
this, debugCounter, kidFrame, desiredSize.width);
|
||||
|
||||
// Did the child fit?
|
||||
if ((kidFrame != mFirstChild) &&
|
||||
((kidAvailSize.height <= 0) ||
|
||||
(desiredSize.height > kidAvailSize.height)))
|
||||
{
|
||||
// The child's height is too big to fit at all in our remaining space,
|
||||
// and it's not our first child.
|
||||
//
|
||||
// Note that if the width is too big that's okay and we allow the
|
||||
// child to extend horizontally outside of the reflow area
|
||||
PushChildren(kidFrame, prevKidFrame);
|
||||
result = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
// Did the child fit?
|
||||
if ((kidFrame != mFirstChild) &&
|
||||
((kidAvailSize.height <= 0) ||
|
||||
(desiredSize.height > kidAvailSize.height)))
|
||||
{
|
||||
// The child's height is too big to fit at all in our remaining space,
|
||||
// and it's not our first child.
|
||||
//
|
||||
// Note that if the width is too big that's okay and we allow the
|
||||
// child to extend horizontally outside of the reflow area
|
||||
PushChildren(kidFrame, prevKidFrame);
|
||||
result = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
// Place the child after taking into account it's margin
|
||||
nsRect kidRect (kidMargin.left, aState.y, desiredSize.width, desiredSize.height);
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize,
|
||||
kidMaxElementSize);
|
||||
if (bottomMargin < 0) {
|
||||
aState.prevMaxNegBottomMargin = -bottomMargin;
|
||||
} else {
|
||||
aState.prevMaxPosBottomMargin = bottomMargin;
|
||||
}
|
||||
// Place the child after taking into account it's margin
|
||||
nsRect kidRect (kidMargin.left, aState.y, desiredSize.width, desiredSize.height);
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize,
|
||||
kidMaxElementSize);
|
||||
if (bottomMargin < 0) {
|
||||
aState.prevMaxNegBottomMargin = -bottomMargin;
|
||||
} else {
|
||||
aState.prevMaxPosBottomMargin = bottomMargin;
|
||||
}
|
||||
|
||||
// Remember where we just were in case we end up pushing children
|
||||
|
@ -453,28 +449,24 @@ PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext,
|
|||
}
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aState.reflowState, aState.availSize,
|
||||
eReflowReason_Resize);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(*aPresContext);
|
||||
status = ReflowChild(kidFrame, aPresContext, kidSize, kidReflowState);
|
||||
ReflowChild(kidFrame, *aPresContext, kidSize, kidReflowState, status);
|
||||
|
||||
// Did the child fit?
|
||||
if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) {
|
||||
// The child is too wide to fit in the available space, and it's
|
||||
// not our first child
|
||||
result = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
// Place the child
|
||||
//aState.y += topMargin;
|
||||
nsRect kidRect (0, 0, kidSize.width, kidSize.height);
|
||||
//kidRect.x += kidMol->margin.left;
|
||||
kidRect.y += aState.y;
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize);
|
||||
// Did the child fit?
|
||||
if ((kidSize.height > aState.availSize.height) && (nsnull != mFirstChild)) {
|
||||
// The child is too wide to fit in the available space, and it's
|
||||
// not our first child
|
||||
result = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
// Place the child
|
||||
//aState.y += topMargin;
|
||||
nsRect kidRect (0, 0, kidSize.width, kidSize.height);
|
||||
//kidRect.x += kidMol->margin.left;
|
||||
kidRect.y += aState.y;
|
||||
PlaceChild(aPresContext, aState, kidFrame, kidRect, aMaxElementSize, *pKidMaxElementSize);
|
||||
|
||||
// Remove the frame from its current parent
|
||||
kidFrame->GetNextSibling(nextInFlow->mFirstChild);
|
||||
|
||||
|
@ -780,21 +772,17 @@ nsTableRowGroupFrame::Reflow(nsIPresContext& aPresContext,
|
|||
// XXX Correctly compute the available space...
|
||||
nsHTMLReflowState kidReflowState(kidFrame, aReflowState, aReflowState.maxSize);
|
||||
nsHTMLReflowMetrics desiredSize(nsnull);
|
||||
nsIHTMLReflow* htmlReflow;
|
||||
|
||||
if (NS_OK == kidFrame->QueryInterface(kIHTMLReflowIID, (void**)&htmlReflow)) {
|
||||
htmlReflow->WillReflow(aPresContext);
|
||||
aStatus = ReflowChild(kidFrame, &aPresContext, desiredSize, kidReflowState);
|
||||
ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState, aStatus);
|
||||
|
||||
// Resize the row frame
|
||||
nsRect kidRect;
|
||||
kidFrame->GetRect(kidRect);
|
||||
kidFrame->SizeTo(desiredSize.width, desiredSize.height);
|
||||
// Resize the row frame
|
||||
nsRect kidRect;
|
||||
kidFrame->GetRect(kidRect);
|
||||
kidFrame->SizeTo(desiredSize.width, desiredSize.height);
|
||||
|
||||
// Adjust the frames that follow...
|
||||
AdjustSiblingsAfterReflow(&aPresContext, state, kidFrame, desiredSize.height -
|
||||
oldKidRect.height);
|
||||
}
|
||||
// Adjust the frames that follow...
|
||||
AdjustSiblingsAfterReflow(&aPresContext, state, kidFrame, desiredSize.height -
|
||||
oldKidRect.height);
|
||||
|
||||
// Return of desired size
|
||||
aDesiredSize.width = aReflowState.maxSize.width;
|
||||
|
|
Загрузка…
Ссылка в новой задаче