Fix for bug# 2780: changed root-frame and scroll-frame code to take into

account mCombinedArea
This commit is contained in:
troy%netscape.com 1999-01-31 05:12:02 +00:00
parent 7c0d5680c3
commit 25be57b96c
3 changed files with 68 additions and 2 deletions

View File

@ -272,6 +272,30 @@ RootFrame::Reflow(nsIPresContext& aPresContext,
aDesiredSize.ascent = aDesiredSize.height;
aDesiredSize.descent = 0;
// Set NS_FRAME_OUTSIDE_CHILDREN flag, or reset it, as appropriate
nsFrameState kidState;
kidFrame->GetFrameState(kidState);
if (NS_FRAME_OUTSIDE_CHILDREN & kidState) {
nscoord kidXMost = kidReflowState.computedMargin.left +
kidDesiredSize.mCombinedArea.XMost();
nscoord kidYMost = kidReflowState.computedMargin.top +
kidDesiredSize.mCombinedArea.YMost();
if ((kidXMost > aDesiredSize.width) || (kidYMost > aDesiredSize.height)) {
aDesiredSize.mCombinedArea.x = 0;
aDesiredSize.mCombinedArea.y = 0;
aDesiredSize.mCombinedArea.width = PR_MAX(aDesiredSize.width, kidXMost);
aDesiredSize.mCombinedArea.height = PR_MAX(aDesiredSize.height, kidYMost);
mState |= NS_FRAME_OUTSIDE_CHILDREN;
} else {
mState &= ~NS_FRAME_OUTSIDE_CHILDREN;
}
} else {
mState &= ~NS_FRAME_OUTSIDE_CHILDREN;
}
// XXX Temporary hack. Remember this for later when our parent resizes us
mNaturalHeight = aDesiredSize.height;
}

View File

@ -272,6 +272,30 @@ RootFrame::Reflow(nsIPresContext& aPresContext,
aDesiredSize.ascent = aDesiredSize.height;
aDesiredSize.descent = 0;
// Set NS_FRAME_OUTSIDE_CHILDREN flag, or reset it, as appropriate
nsFrameState kidState;
kidFrame->GetFrameState(kidState);
if (NS_FRAME_OUTSIDE_CHILDREN & kidState) {
nscoord kidXMost = kidReflowState.computedMargin.left +
kidDesiredSize.mCombinedArea.XMost();
nscoord kidYMost = kidReflowState.computedMargin.top +
kidDesiredSize.mCombinedArea.YMost();
if ((kidXMost > aDesiredSize.width) || (kidYMost > aDesiredSize.height)) {
aDesiredSize.mCombinedArea.x = 0;
aDesiredSize.mCombinedArea.y = 0;
aDesiredSize.mCombinedArea.width = PR_MAX(aDesiredSize.width, kidXMost);
aDesiredSize.mCombinedArea.height = PR_MAX(aDesiredSize.height, kidYMost);
mState |= NS_FRAME_OUTSIDE_CHILDREN;
} else {
mState &= ~NS_FRAME_OUTSIDE_CHILDREN;
}
} else {
mState &= ~NS_FRAME_OUTSIDE_CHILDREN;
}
// XXX Temporary hack. Remember this for later when our parent resizes us
mNaturalHeight = aDesiredSize.height;
}

View File

@ -333,7 +333,16 @@ nsScrollFrame::Reflow(nsIPresContext& aPresContext,
aStatus);
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
// If it's an area frame then get the total size, which includes the
// If the frame has child frames that stick outside its bounds, then take
// them into account, too
nsFrameState kidState;
kidFrame->GetFrameState(kidState);
if (NS_FRAME_OUTSIDE_CHILDREN & kidState) {
kidDesiredSize.width = kidDesiredSize.mCombinedArea.width;
kidDesiredSize.height = kidDesiredSize.mCombinedArea.height;
}
// If it's an area frame, then get the total size which includes the
// space taken up by absolutely positioned child elements
nsIAreaFrame* areaFrame;
if (NS_SUCCEEDED(kidFrame->QueryInterface(kAreaFrameIID, (void**)&areaFrame))) {
@ -383,7 +392,16 @@ nsScrollFrame::Reflow(nsIPresContext& aPresContext,
aStatus);
NS_ASSERTION(NS_FRAME_IS_COMPLETE(aStatus), "bad status");
// If it's an area frame then get the total size, which includes the
// If the frame has child frames that stick outside its bounds, then take
// them into account, too
nsFrameState kidState;
kidFrame->GetFrameState(kidState);
if (NS_FRAME_OUTSIDE_CHILDREN & kidState) {
kidDesiredSize.width = kidDesiredSize.mCombinedArea.width;
kidDesiredSize.height = kidDesiredSize.mCombinedArea.height;
}
// If it's an area frame, then get the total size which includes the
// space taken up by absolutely positioned child elements
nsIAreaFrame* areaFrame;
if (NS_SUCCEEDED(kidFrame->QueryInterface(kAreaFrameIID, (void**)&areaFrame))) {