From 79aa82cbf1727ec95929d5350c4743ee20e6fe14 Mon Sep 17 00:00:00 2001 From: "kin%netscape.com" Date: Mon, 3 Jun 2002 21:35:54 +0000 Subject: [PATCH] Fix for bug 138573 (hitting return in list item causes list problems; workaround is to refresh) Modified SlideLine() to use the combined area instead of the linebox bounds when invalidating. This makes sure that we invalidate the area occupied by the list bullets/ordinals. r=dbaron@fas.harvard.edu sr=waterson@netscape.com git-svn-id: svn://10.0.0.236/trunk@122594 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsBlockFrame.cpp | 13 +++++++++---- mozilla/layout/html/base/src/nsBlockFrame.cpp | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index fe6b288bce8..8893c414086 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -2780,13 +2780,18 @@ nsBlockFrame::SlideLine(nsBlockReflowState& aState, { NS_PRECONDITION(aDY != 0, "why slide a line nowhere?"); - PRBool doInvalidate = !aLine->mBounds.IsEmpty(); + nsRect lineCombinedArea; + aLine->GetCombinedArea(&lineCombinedArea); + + PRBool doInvalidate = !lineCombinedArea.IsEmpty(); if (doInvalidate) - Invalidate(aState.mPresContext, aLine->mBounds); + Invalidate(aState.mPresContext, lineCombinedArea); // Adjust line state aLine->SlideBy(aDY); - if (doInvalidate) - Invalidate(aState.mPresContext, aLine->mBounds); + if (doInvalidate) { + aLine->GetCombinedArea(&lineCombinedArea); + Invalidate(aState.mPresContext, lineCombinedArea); + } // Adjust the frames in the line nsIFrame* kid = aLine->mFirstChild; diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index fe6b288bce8..8893c414086 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -2780,13 +2780,18 @@ nsBlockFrame::SlideLine(nsBlockReflowState& aState, { NS_PRECONDITION(aDY != 0, "why slide a line nowhere?"); - PRBool doInvalidate = !aLine->mBounds.IsEmpty(); + nsRect lineCombinedArea; + aLine->GetCombinedArea(&lineCombinedArea); + + PRBool doInvalidate = !lineCombinedArea.IsEmpty(); if (doInvalidate) - Invalidate(aState.mPresContext, aLine->mBounds); + Invalidate(aState.mPresContext, lineCombinedArea); // Adjust line state aLine->SlideBy(aDY); - if (doInvalidate) - Invalidate(aState.mPresContext, aLine->mBounds); + if (doInvalidate) { + aLine->GetCombinedArea(&lineCombinedArea); + Invalidate(aState.mPresContext, lineCombinedArea); + } // Adjust the frames in the line nsIFrame* kid = aLine->mFirstChild;