diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index 2bc310b11e9..654a70ed9a7 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -4741,7 +4741,9 @@ PresShell::UnsuppressAndInvalidate() if (rootFrame) { nsRect rect; rootFrame->GetRect(rect); - ((nsFrame*)rootFrame)->Invalidate(mPresContext, rect, PR_FALSE); + if (!rect.IsEmpty()) { + ((nsFrame*)rootFrame)->Invalidate(mPresContext, rect, PR_FALSE); + } } if (ourWindow) diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index 80f7f6b0cf6..22ef862f50b 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -913,8 +913,10 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext, printf("%p invalidate 1 (%d, %d, %d, %d)\n", this, 0, 0, mRect.width, mRect.height); #endif - - Invalidate(aPresContext, nsRect(0, 0, mRect.width, mRect.height)); + nsRect damageRect(0, 0, mRect.width, mRect.height); + if (!damageRect.IsEmpty()) { + Invalidate(aPresContext,damageRect); + } } else { nsMargin border = aReflowState.mComputedBorderPadding - aReflowState.mComputedPadding; @@ -943,7 +945,9 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext, printf("%p invalidate 2 (%d, %d, %d, %d)\n", this, damageRect.x, damageRect.y, damageRect.width, damageRect.height); #endif - Invalidate(aPresContext, damageRect); + if (!damageRect.IsEmpty()) { + Invalidate(aPresContext, damageRect); + } } // See if our height changed @@ -970,7 +974,9 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext, printf("%p invalidate 3 (%d, %d, %d, %d)\n", this, damageRect.x, damageRect.y, damageRect.width, damageRect.height); #endif - Invalidate(aPresContext, damageRect); + if (!damageRect.IsEmpty()) { + Invalidate(aPresContext, damageRect); + } } } } @@ -2376,7 +2382,9 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState, printf("%p invalidate 6 (%d, %d, %d, %d)\n", this, dirtyRect.x, dirtyRect.y, dirtyRect.width, dirtyRect.height); #endif - Invalidate(aState.mPresContext, dirtyRect); + if (!dirtyRect.IsEmpty()) { + Invalidate(aState.mPresContext, dirtyRect); + } } else { if (oldCombinedArea.width != lineCombinedArea.width) { @@ -2396,7 +2404,9 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState, printf("%p invalidate 7 (%d, %d, %d, %d)\n", this, dirtyRect.x, dirtyRect.y, dirtyRect.width, dirtyRect.height); #endif - Invalidate(aState.mPresContext, dirtyRect); + if (!dirtyRect.IsEmpty()) { + Invalidate(aState.mPresContext, dirtyRect); + } } if (oldCombinedArea.height != lineCombinedArea.height) { nsRect dirtyRect; @@ -2415,7 +2425,9 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState, printf("%p invalidate 8 (%d, %d, %d, %d)\n", this, dirtyRect.x, dirtyRect.y, dirtyRect.width, dirtyRect.height); #endif - Invalidate(aState.mPresContext, dirtyRect); + if (!dirtyRect.IsEmpty()) { + Invalidate(aState.mPresContext, dirtyRect); + } } } } @@ -2516,7 +2528,9 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState, if (aLine->IsForceInvalidate()) printf(" dirty line is %p\n"); #endif - Invalidate(aState.mPresContext, dirtyRect); + if (!dirtyRect.IsEmpty()) { + Invalidate(aState.mPresContext, dirtyRect); + } } } @@ -2614,7 +2628,7 @@ nsBlockFrame::PullFrameFrom(nsBlockReflowState& aState, else { // Free up the fromLine now that it's empty // Its bounds might need to be redrawn, though. - if (aDamageDeletedLines) { + if (aDamageDeletedLines && !fromLine->mBounds.IsEmpty()) { Invalidate(aState.mPresContext, fromLine->mBounds); } if (aFromLine.next() != end_lines()) @@ -3152,7 +3166,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState, applyTopMargin, aState.mPrevBottomMargin, aState.IsAdjacentWithTop(), computedOffsets, frameReflowStatus); - if (brc.BlockShouldInvalidateItself()) { + if (brc.BlockShouldInvalidateItself() && !mRect.IsEmpty()) { Invalidate(aState.mPresContext, mRect); } @@ -4928,7 +4942,9 @@ nsBlockFrame::DoRemoveFrame(nsIPresContext* aPresContext, printf("%p invalidate 10 (%d, %d, %d, %d)\n", this, lineCombinedArea.x, lineCombinedArea.y, lineCombinedArea.width, lineCombinedArea.height); #endif - Invalidate(aPresContext, lineCombinedArea); + if (!lineCombinedArea.IsEmpty()) { + Invalidate(aPresContext, lineCombinedArea); + } cur->Destroy(presShell); // If we're removing a line, ReflowDirtyLines isn't going to @@ -5084,7 +5100,7 @@ nsBlockFrame::ReflowFloater(nsBlockReflowState& aState, } } - if (brc.BlockShouldInvalidateItself()) { + if (brc.BlockShouldInvalidateItself() && !mRect.IsEmpty()) { Invalidate(aState.mPresContext, mRect); } diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index 20c2d449d91..f25c1586b72 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -2077,6 +2077,11 @@ nsFrame::Invalidate(nsIPresContext* aPresContext, const nsRect& aDamageRect, PRBool aImmediate) const { + if (aDamageRect.IsEmpty()) { + NS_WARNING("empty damage rect: update caller to avoid fcn call overhead"); + return; + } + if (aPresContext) { // Don't allow invalidates to do anything when // painting is suppressed. @@ -2093,6 +2098,13 @@ nsFrame::Invalidate(nsIPresContext* aPresContext, nsIViewManager* viewManager = nsnull; nsRect damageRect(aDamageRect); +#if 0 + // NOTE: inflating the damagerect is to account for outlines but + // ONLY WHEN outlines are actually drawn outside of the frame. This + // assumes that they are *but they are not* and it also assumes that the + // entire frame is being invalidated, which it often is not + // - therefore, this code is invalid and has been removed + // Checks to see if the damaged rect should be infalted // to include the outline const nsStyleOutline* outline; @@ -2102,6 +2114,7 @@ nsFrame::Invalidate(nsIPresContext* aPresContext, if (width > 0) { damageRect.Inflate(width, width); } +#endif PRUint32 flags = aImmediate ? NS_VMREFRESH_IMMEDIATE : NS_VMREFRESH_NO_SYNC; nsIView* view; @@ -2613,7 +2626,9 @@ nsFrame::SetSelected(nsIPresContext* aPresContext, nsIDOMRange *aRange, PRBool a nsRect frameRect; GetRect(frameRect); nsRect rect(0, 0, frameRect.width, frameRect.height); - Invalidate(aPresContext, rect, PR_FALSE); + if (!rect.IsEmpty()) { + Invalidate(aPresContext, rect, PR_FALSE); + } #if 0 if (aRange) { //lets see if the range contains us, if so we must redraw! diff --git a/mozilla/layout/generic/nsImageFrame.cpp b/mozilla/layout/generic/nsImageFrame.cpp index 6aae55d900a..50b1dab6dd7 100644 --- a/mozilla/layout/generic/nsImageFrame.cpp +++ b/mozilla/layout/generic/nsImageFrame.cpp @@ -370,7 +370,7 @@ NS_IMETHODIMP nsImageFrame::OnDataAvailable(imgIRequest *aRequest, nsIPresContex r.x += mBorderPadding.left; r.y += mBorderPadding.top; - if (whichLoad == 0) + if (whichLoad == 0 && !r.IsEmpty()) Invalidate(aPresContext, r, PR_FALSE); return NS_OK; diff --git a/mozilla/layout/generic/nsTextFrame.cpp b/mozilla/layout/generic/nsTextFrame.cpp index c1f1980ddbd..c2d2d1a1ac6 100644 --- a/mozilla/layout/generic/nsTextFrame.cpp +++ b/mozilla/layout/generic/nsTextFrame.cpp @@ -5231,7 +5231,10 @@ nsTextFrame::Reflow(nsIPresContext* aPresContext, maxFrameWidth = PR_MAX(maxFrameWidth, mRect.width) + onePixel; maxFrameHeight = PR_MAX(maxFrameHeight, mRect.height); - Invalidate(aPresContext, nsRect(0,0,maxFrameWidth,maxFrameHeight)); + nsRect damage(0,0,maxFrameWidth,maxFrameHeight); + if (!damage.IsEmpty()) { + Invalidate(aPresContext, damage); + } /*}*/ diff --git a/mozilla/layout/generic/nsViewportFrame.cpp b/mozilla/layout/generic/nsViewportFrame.cpp index bc86caca24f..e325227ebc8 100644 --- a/mozilla/layout/generic/nsViewportFrame.cpp +++ b/mozilla/layout/generic/nsViewportFrame.cpp @@ -612,7 +612,9 @@ ViewportFrame::Reflow(nsIPresContext* aPresContext, (eReflowReason_Resize == aReflowState.reason) || (eReflowReason_StyleChange == aReflowState.reason)) { nsRect damageRect(0, 0, aDesiredSize.width, aDesiredSize.height); - Invalidate(aPresContext, damageRect, PR_FALSE); + if (!damageRect.IsEmpty()) { + Invalidate(aPresContext, damageRect, PR_FALSE); + } } NS_FRAME_TRACE_REFLOW_OUT("ViewportFrame::Reflow", aStatus); diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index 80f7f6b0cf6..22ef862f50b 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -913,8 +913,10 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext, printf("%p invalidate 1 (%d, %d, %d, %d)\n", this, 0, 0, mRect.width, mRect.height); #endif - - Invalidate(aPresContext, nsRect(0, 0, mRect.width, mRect.height)); + nsRect damageRect(0, 0, mRect.width, mRect.height); + if (!damageRect.IsEmpty()) { + Invalidate(aPresContext,damageRect); + } } else { nsMargin border = aReflowState.mComputedBorderPadding - aReflowState.mComputedPadding; @@ -943,7 +945,9 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext, printf("%p invalidate 2 (%d, %d, %d, %d)\n", this, damageRect.x, damageRect.y, damageRect.width, damageRect.height); #endif - Invalidate(aPresContext, damageRect); + if (!damageRect.IsEmpty()) { + Invalidate(aPresContext, damageRect); + } } // See if our height changed @@ -970,7 +974,9 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext, printf("%p invalidate 3 (%d, %d, %d, %d)\n", this, damageRect.x, damageRect.y, damageRect.width, damageRect.height); #endif - Invalidate(aPresContext, damageRect); + if (!damageRect.IsEmpty()) { + Invalidate(aPresContext, damageRect); + } } } } @@ -2376,7 +2382,9 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState, printf("%p invalidate 6 (%d, %d, %d, %d)\n", this, dirtyRect.x, dirtyRect.y, dirtyRect.width, dirtyRect.height); #endif - Invalidate(aState.mPresContext, dirtyRect); + if (!dirtyRect.IsEmpty()) { + Invalidate(aState.mPresContext, dirtyRect); + } } else { if (oldCombinedArea.width != lineCombinedArea.width) { @@ -2396,7 +2404,9 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState, printf("%p invalidate 7 (%d, %d, %d, %d)\n", this, dirtyRect.x, dirtyRect.y, dirtyRect.width, dirtyRect.height); #endif - Invalidate(aState.mPresContext, dirtyRect); + if (!dirtyRect.IsEmpty()) { + Invalidate(aState.mPresContext, dirtyRect); + } } if (oldCombinedArea.height != lineCombinedArea.height) { nsRect dirtyRect; @@ -2415,7 +2425,9 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState, printf("%p invalidate 8 (%d, %d, %d, %d)\n", this, dirtyRect.x, dirtyRect.y, dirtyRect.width, dirtyRect.height); #endif - Invalidate(aState.mPresContext, dirtyRect); + if (!dirtyRect.IsEmpty()) { + Invalidate(aState.mPresContext, dirtyRect); + } } } } @@ -2516,7 +2528,9 @@ nsBlockFrame::ReflowLine(nsBlockReflowState& aState, if (aLine->IsForceInvalidate()) printf(" dirty line is %p\n"); #endif - Invalidate(aState.mPresContext, dirtyRect); + if (!dirtyRect.IsEmpty()) { + Invalidate(aState.mPresContext, dirtyRect); + } } } @@ -2614,7 +2628,7 @@ nsBlockFrame::PullFrameFrom(nsBlockReflowState& aState, else { // Free up the fromLine now that it's empty // Its bounds might need to be redrawn, though. - if (aDamageDeletedLines) { + if (aDamageDeletedLines && !fromLine->mBounds.IsEmpty()) { Invalidate(aState.mPresContext, fromLine->mBounds); } if (aFromLine.next() != end_lines()) @@ -3152,7 +3166,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState, applyTopMargin, aState.mPrevBottomMargin, aState.IsAdjacentWithTop(), computedOffsets, frameReflowStatus); - if (brc.BlockShouldInvalidateItself()) { + if (brc.BlockShouldInvalidateItself() && !mRect.IsEmpty()) { Invalidate(aState.mPresContext, mRect); } @@ -4928,7 +4942,9 @@ nsBlockFrame::DoRemoveFrame(nsIPresContext* aPresContext, printf("%p invalidate 10 (%d, %d, %d, %d)\n", this, lineCombinedArea.x, lineCombinedArea.y, lineCombinedArea.width, lineCombinedArea.height); #endif - Invalidate(aPresContext, lineCombinedArea); + if (!lineCombinedArea.IsEmpty()) { + Invalidate(aPresContext, lineCombinedArea); + } cur->Destroy(presShell); // If we're removing a line, ReflowDirtyLines isn't going to @@ -5084,7 +5100,7 @@ nsBlockFrame::ReflowFloater(nsBlockReflowState& aState, } } - if (brc.BlockShouldInvalidateItself()) { + if (brc.BlockShouldInvalidateItself() && !mRect.IsEmpty()) { Invalidate(aState.mPresContext, mRect); } diff --git a/mozilla/layout/html/base/src/nsFrame.cpp b/mozilla/layout/html/base/src/nsFrame.cpp index 20c2d449d91..f25c1586b72 100644 --- a/mozilla/layout/html/base/src/nsFrame.cpp +++ b/mozilla/layout/html/base/src/nsFrame.cpp @@ -2077,6 +2077,11 @@ nsFrame::Invalidate(nsIPresContext* aPresContext, const nsRect& aDamageRect, PRBool aImmediate) const { + if (aDamageRect.IsEmpty()) { + NS_WARNING("empty damage rect: update caller to avoid fcn call overhead"); + return; + } + if (aPresContext) { // Don't allow invalidates to do anything when // painting is suppressed. @@ -2093,6 +2098,13 @@ nsFrame::Invalidate(nsIPresContext* aPresContext, nsIViewManager* viewManager = nsnull; nsRect damageRect(aDamageRect); +#if 0 + // NOTE: inflating the damagerect is to account for outlines but + // ONLY WHEN outlines are actually drawn outside of the frame. This + // assumes that they are *but they are not* and it also assumes that the + // entire frame is being invalidated, which it often is not + // - therefore, this code is invalid and has been removed + // Checks to see if the damaged rect should be infalted // to include the outline const nsStyleOutline* outline; @@ -2102,6 +2114,7 @@ nsFrame::Invalidate(nsIPresContext* aPresContext, if (width > 0) { damageRect.Inflate(width, width); } +#endif PRUint32 flags = aImmediate ? NS_VMREFRESH_IMMEDIATE : NS_VMREFRESH_NO_SYNC; nsIView* view; @@ -2613,7 +2626,9 @@ nsFrame::SetSelected(nsIPresContext* aPresContext, nsIDOMRange *aRange, PRBool a nsRect frameRect; GetRect(frameRect); nsRect rect(0, 0, frameRect.width, frameRect.height); - Invalidate(aPresContext, rect, PR_FALSE); + if (!rect.IsEmpty()) { + Invalidate(aPresContext, rect, PR_FALSE); + } #if 0 if (aRange) { //lets see if the range contains us, if so we must redraw! diff --git a/mozilla/layout/html/base/src/nsImageFrame.cpp b/mozilla/layout/html/base/src/nsImageFrame.cpp index 6aae55d900a..50b1dab6dd7 100644 --- a/mozilla/layout/html/base/src/nsImageFrame.cpp +++ b/mozilla/layout/html/base/src/nsImageFrame.cpp @@ -370,7 +370,7 @@ NS_IMETHODIMP nsImageFrame::OnDataAvailable(imgIRequest *aRequest, nsIPresContex r.x += mBorderPadding.left; r.y += mBorderPadding.top; - if (whichLoad == 0) + if (whichLoad == 0 && !r.IsEmpty()) Invalidate(aPresContext, r, PR_FALSE); return NS_OK; diff --git a/mozilla/layout/html/base/src/nsPresShell.cpp b/mozilla/layout/html/base/src/nsPresShell.cpp index 2bc310b11e9..654a70ed9a7 100644 --- a/mozilla/layout/html/base/src/nsPresShell.cpp +++ b/mozilla/layout/html/base/src/nsPresShell.cpp @@ -4741,7 +4741,9 @@ PresShell::UnsuppressAndInvalidate() if (rootFrame) { nsRect rect; rootFrame->GetRect(rect); - ((nsFrame*)rootFrame)->Invalidate(mPresContext, rect, PR_FALSE); + if (!rect.IsEmpty()) { + ((nsFrame*)rootFrame)->Invalidate(mPresContext, rect, PR_FALSE); + } } if (ourWindow) diff --git a/mozilla/layout/html/base/src/nsTextFrame.cpp b/mozilla/layout/html/base/src/nsTextFrame.cpp index c1f1980ddbd..c2d2d1a1ac6 100644 --- a/mozilla/layout/html/base/src/nsTextFrame.cpp +++ b/mozilla/layout/html/base/src/nsTextFrame.cpp @@ -5231,7 +5231,10 @@ nsTextFrame::Reflow(nsIPresContext* aPresContext, maxFrameWidth = PR_MAX(maxFrameWidth, mRect.width) + onePixel; maxFrameHeight = PR_MAX(maxFrameHeight, mRect.height); - Invalidate(aPresContext, nsRect(0,0,maxFrameWidth,maxFrameHeight)); + nsRect damage(0,0,maxFrameWidth,maxFrameHeight); + if (!damage.IsEmpty()) { + Invalidate(aPresContext, damage); + } /*}*/ diff --git a/mozilla/layout/html/base/src/nsViewportFrame.cpp b/mozilla/layout/html/base/src/nsViewportFrame.cpp index bc86caca24f..e325227ebc8 100644 --- a/mozilla/layout/html/base/src/nsViewportFrame.cpp +++ b/mozilla/layout/html/base/src/nsViewportFrame.cpp @@ -612,7 +612,9 @@ ViewportFrame::Reflow(nsIPresContext* aPresContext, (eReflowReason_Resize == aReflowState.reason) || (eReflowReason_StyleChange == aReflowState.reason)) { nsRect damageRect(0, 0, aDesiredSize.width, aDesiredSize.height); - Invalidate(aPresContext, damageRect, PR_FALSE); + if (!damageRect.IsEmpty()) { + Invalidate(aPresContext, damageRect, PR_FALSE); + } } NS_FRAME_TRACE_REFLOW_OUT("ViewportFrame::Reflow", aStatus); diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp index 57e0e38dc59..325650ae772 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableFrame.cpp @@ -2087,7 +2087,9 @@ nsTableFrame::ReflowTable(nsIPresContext* aPresContext, // If we're here that means we had to reflow all the rows, e.g., the column widths // changed. We need to make sure that any damaged areas are repainted - Invalidate(aPresContext, mRect); + if (!mRect.IsEmpty()) { + Invalidate(aPresContext, mRect); + } if (eReflowReason_Resize == aReflowState.reason) { if (!DidResizeReflow()) { diff --git a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp index 01f14810418..30e442384c9 100644 --- a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp @@ -1525,8 +1525,10 @@ nsTableRowGroupFrame::IR_TargetIsChild(nsIPresContext* aPresContext, // repaint the entire row // XXX Improve this so the row knows it should bitblt (or repaint) those // cells that change position... - Invalidate(aPresContext, kidRect); - + if (!kidRect.IsEmpty()) { + Invalidate(aPresContext, kidRect); + } + // Invalidate the area we're offseting. Note that we only repaint within // our existing frame bounds. // XXX It would be better to bitblt the row frames and not repaint, diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index 57e0e38dc59..325650ae772 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -2087,7 +2087,9 @@ nsTableFrame::ReflowTable(nsIPresContext* aPresContext, // If we're here that means we had to reflow all the rows, e.g., the column widths // changed. We need to make sure that any damaged areas are repainted - Invalidate(aPresContext, mRect); + if (!mRect.IsEmpty()) { + Invalidate(aPresContext, mRect); + } if (eReflowReason_Resize == aReflowState.reason) { if (!DidResizeReflow()) { diff --git a/mozilla/layout/tables/nsTableRowGroupFrame.cpp b/mozilla/layout/tables/nsTableRowGroupFrame.cpp index 01f14810418..30e442384c9 100644 --- a/mozilla/layout/tables/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/tables/nsTableRowGroupFrame.cpp @@ -1525,8 +1525,10 @@ nsTableRowGroupFrame::IR_TargetIsChild(nsIPresContext* aPresContext, // repaint the entire row // XXX Improve this so the row knows it should bitblt (or repaint) those // cells that change position... - Invalidate(aPresContext, kidRect); - + if (!kidRect.IsEmpty()) { + Invalidate(aPresContext, kidRect); + } + // Invalidate the area we're offseting. Note that we only repaint within // our existing frame bounds. // XXX It would be better to bitblt the row frames and not repaint, diff --git a/mozilla/layout/xul/base/src/nsSliderFrame.cpp b/mozilla/layout/xul/base/src/nsSliderFrame.cpp index b310cbdde43..f964718b04b 100644 --- a/mozilla/layout/xul/base/src/nsSliderFrame.cpp +++ b/mozilla/layout/xul/base/src/nsSliderFrame.cpp @@ -774,9 +774,11 @@ nsSliderFrame::CurrentPositionChanged(nsIPresContext* aPresContext) nsRect changeRect; changeRect.UnionRect(thumbRect, newThumbRect); - // redraw just the change - Invalidate(aPresContext, changeRect, mRedrawImmediate); - + if (!changeRect.IsEmpty()) { + // redraw just the change + Invalidate(aPresContext, changeRect, mRedrawImmediate); + } + if (mScrollbarListener) mScrollbarListener->PositionChanged(aPresContext, mCurPos, curpos); diff --git a/mozilla/layout/xul/base/src/outliner/src/nsOutlinerBodyFrame.cpp b/mozilla/layout/xul/base/src/outliner/src/nsOutlinerBodyFrame.cpp index b524aeca486..30e66d49979 100644 --- a/mozilla/layout/xul/base/src/outliner/src/nsOutlinerBodyFrame.cpp +++ b/mozilla/layout/xul/base/src/outliner/src/nsOutlinerBodyFrame.cpp @@ -581,7 +581,9 @@ NS_IMETHODIMP nsOutlinerBodyFrame::GetPageCount(PRInt32 *_retval) NS_IMETHODIMP nsOutlinerBodyFrame::Invalidate() { - nsLeafBoxFrame::Invalidate(mPresContext, mRect, PR_FALSE); + if (!mRect.IsEmpty()) { + nsLeafBoxFrame::Invalidate(mPresContext, mRect, PR_FALSE); + } return NS_OK; } @@ -591,7 +593,9 @@ NS_IMETHODIMP nsOutlinerBodyFrame::InvalidateRow(PRInt32 aIndex) return NS_OK; nsRect rowRect(mInnerBox.x, mInnerBox.y+mRowHeight*(aIndex-mTopRowIndex), mInnerBox.width, mRowHeight); - nsLeafBoxFrame::Invalidate(mPresContext, rowRect, PR_FALSE); + if (!rowRect.IsEmpty()) { + nsLeafBoxFrame::Invalidate(mPresContext, rowRect, PR_FALSE); + } return NS_OK; } diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp index b524aeca486..30e66d49979 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp @@ -581,7 +581,9 @@ NS_IMETHODIMP nsOutlinerBodyFrame::GetPageCount(PRInt32 *_retval) NS_IMETHODIMP nsOutlinerBodyFrame::Invalidate() { - nsLeafBoxFrame::Invalidate(mPresContext, mRect, PR_FALSE); + if (!mRect.IsEmpty()) { + nsLeafBoxFrame::Invalidate(mPresContext, mRect, PR_FALSE); + } return NS_OK; } @@ -591,7 +593,9 @@ NS_IMETHODIMP nsOutlinerBodyFrame::InvalidateRow(PRInt32 aIndex) return NS_OK; nsRect rowRect(mInnerBox.x, mInnerBox.y+mRowHeight*(aIndex-mTopRowIndex), mInnerBox.width, mRowHeight); - nsLeafBoxFrame::Invalidate(mPresContext, rowRect, PR_FALSE); + if (!rowRect.IsEmpty()) { + nsLeafBoxFrame::Invalidate(mPresContext, rowRect, PR_FALSE); + } return NS_OK; }