Bug 172031. Make CanvasFrame put back the block preferred size before incrementally reflowing its block, since the block needs that preferred size to incrementally reflow its absolute frames properly. r=karnaze,sr=kin

This commit is contained in:
roc+@cs.cmu.edu
2002-12-14 16:55:41 +00:00
parent f1f9060393
commit 2ebc4b7072
2 changed files with 28 additions and 2 deletions

View File

@@ -170,7 +170,7 @@ protected:
// Data members
PRPackedBool mDoPaintFocus;
nsCOMPtr<nsIViewManager> mViewManager;
nscoord mSavedChildWidth, mSavedChildHeight;
private:
NS_IMETHOD_(nsrefcnt) AddRef() { return NS_OK; }
@@ -572,11 +572,24 @@ CanvasFrame::Reflow(nsIPresContext* aPresContext,
NS_UNCONSTRAINEDSIZE),
reason);
if (eReflowReason_Incremental == aReflowState.reason) {
// Restore original kid desired dimensions in case it decides to
// reuse them during incremental reflow.
nsRect r;
kidFrame->GetRect(r);
r.width = mSavedChildWidth;
r.height = mSavedChildHeight;
kidFrame->SetRect(aPresContext, r);
}
// Reflow the frame
ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowState,
kidReflowState.mComputedMargin.left, kidReflowState.mComputedMargin.top,
0, aStatus);
mSavedChildWidth = kidDesiredSize.width;
mSavedChildHeight = kidDesiredSize.height;
// The document element's background should cover the entire canvas, so
// take into account the combined area and any space taken up by
// absolutely positioned elements