diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index 5a8304a8f0a..26f02a9e004 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -3587,7 +3587,8 @@ nsTextFrame::SetSelected(nsIPresContext* aPresContext, 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); // ForceDrawFrame(this); } if (aSpread == eSpreadDown) diff --git a/layout/html/base/src/nsTextFrame.cpp b/layout/html/base/src/nsTextFrame.cpp index 5a8304a8f0a..26f02a9e004 100644 --- a/layout/html/base/src/nsTextFrame.cpp +++ b/layout/html/base/src/nsTextFrame.cpp @@ -3587,7 +3587,8 @@ nsTextFrame::SetSelected(nsIPresContext* aPresContext, 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); // ForceDrawFrame(this); } if (aSpread == eSpreadDown)