Bug 257430. nsImageFrame and nsTableRowFrame need to always include their frame bounds in their overflow area. r+sr=dbaron

git-svn-id: svn://10.0.0.236/trunk@161574 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
roc+%cs.cmu.edu
2004-09-01 13:33:17 +00:00
parent 80d3504ca7
commit c66af173cf
6 changed files with 22 additions and 0 deletions

View File

@@ -4201,6 +4201,9 @@ nsIFrame::FinishAndStoreOverflow(nsRect* aOverflowArea, nsSize aNewSize)
// can happen here, e.g. CSS2 outline.
// If we find more things other than outline that need to be added,
// we should think about starting a new method like GetAdditionalOverflow()
NS_ASSERTION(aNewSize.width == 0 || aNewSize.height == 0 ||
aOverflowArea->Contains(nsRect(nsPoint(0, 0), aNewSize)),
"Computed overflow area must contain frame bounds");
PRBool hasOutline;
nsRect outlineRect(ComputeOutlineRect(this, &hasOutline, *aOverflowArea));

View File

@@ -1030,6 +1030,7 @@ nsImageFrame::Reflow(nsPresContext* aPresContext,
if (aMetrics.mFlags & NS_REFLOW_CALC_MAX_WIDTH) {
aMetrics.mMaximumWidth = aMetrics.width;
}
aMetrics.mOverflowArea.SetRect(0, 0, aMetrics.width, aMetrics.height);
FinishAndStoreOverflow(&aMetrics);
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,

View File

@@ -4201,6 +4201,9 @@ nsIFrame::FinishAndStoreOverflow(nsRect* aOverflowArea, nsSize aNewSize)
// can happen here, e.g. CSS2 outline.
// If we find more things other than outline that need to be added,
// we should think about starting a new method like GetAdditionalOverflow()
NS_ASSERTION(aNewSize.width == 0 || aNewSize.height == 0 ||
aOverflowArea->Contains(nsRect(nsPoint(0, 0), aNewSize)),
"Computed overflow area must contain frame bounds");
PRBool hasOutline;
nsRect outlineRect(ComputeOutlineRect(this, &hasOutline, *aOverflowArea));

View File

@@ -1030,6 +1030,7 @@ nsImageFrame::Reflow(nsPresContext* aPresContext,
if (aMetrics.mFlags & NS_REFLOW_CALC_MAX_WIDTH) {
aMetrics.mMaximumWidth = aMetrics.width;
}
aMetrics.mOverflowArea.SetRect(0, 0, aMetrics.width, aMetrics.height);
FinishAndStoreOverflow(&aMetrics);
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,

View File

@@ -1317,6 +1317,13 @@ nsTableRowFrame::IR_TargetIsChild(nsPresContext* aPresContext,
else { // we dont realign vertical but we need to update the overflow area
nsIFrame* cellKidFrame = cellFrame->GetFirstChild(nsnull);
if (cellKidFrame) {
// XXX This is bogus. The code above changes the cell width
// and height but leaves the overflow area alone. How can that
// be right?
// Make sure the overflow area includes the width and height, in any case.
cellMet.mOverflowArea.UnionRect(cellMet.mOverflowArea,
nsRect(0, 0, cellMet.width, cellMet.height));
cellFrame->ConsiderChildOverflow(aPresContext, cellMet.mOverflowArea, cellKidFrame);
cellFrame->FinishAndStoreOverflow(&cellMet);
if (cellFrame->HasView()) {

View File

@@ -1317,6 +1317,13 @@ nsTableRowFrame::IR_TargetIsChild(nsPresContext* aPresContext,
else { // we dont realign vertical but we need to update the overflow area
nsIFrame* cellKidFrame = cellFrame->GetFirstChild(nsnull);
if (cellKidFrame) {
// XXX This is bogus. The code above changes the cell width
// and height but leaves the overflow area alone. How can that
// be right?
// Make sure the overflow area includes the width and height, in any case.
cellMet.mOverflowArea.UnionRect(cellMet.mOverflowArea,
nsRect(0, 0, cellMet.width, cellMet.height));
cellFrame->ConsiderChildOverflow(aPresContext, cellMet.mOverflowArea, cellKidFrame);
cellFrame->FinishAndStoreOverflow(&cellMet);
if (cellFrame->HasView()) {