Closed Bug 500632 Opened 16 years ago Closed 16 years ago

Unnecessary repainting due to invalidation inside collapsed scrollbars

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: roc, Assigned: roc)

Details

Attachments

(1 file)

Attached patch fixSplinter Review
Scrollframes collapse scrollbars by setting their size to 0. However, the thumb and other scrollbar parts retain their preferred size. When something causes scrollbar parts to be invalidated, those invalidations propagate out and cause actual repainting. The simplest way I found to stop that from happening was to explicitly suppress invalidations from collapsed scrollbars in nsHTMLScrollFrame::InvalidateInternal.
Attachment #385355 - Flags: review?(dbaron)
Comment on attachment 385355 [details] [diff] [review] fix r=dbaron However, please document the INVALIDATE_NOTIFY_ONLY flag in nsIFrame.h. (It originated in bug 450930.) (I'm actually not sure why nsGfxScrollFrame::InvalidateInternal currently checks for it.) Also, if you want (feel free to do this or not), it seems like it might make sense to structure nsGfxScrollFrame::InvalidateInternal as: if (aForChild == mInner.mScrolledFrame) { // ... existing code, inside if (!(aFlags & INVALIDATE_NOTIFY_ONLY)) } else if (aForChild == mInner.mHScrollbarBox) { // your conditional new early return, with your comment } else if (aForChild == mInner.mVScrollbarBox) { // same, but with pointer to previous comment } nsHTMLContainerFrame::InvalidateInternal(...);
(In reply to comment #1) > (From update of attachment 385355 [details] [diff] [review]) > r=dbaron > > However, please document the INVALIDATE_NOTIFY_ONLY flag in nsIFrame.h. (It > originated in bug 450930.) (I'm actually not sure why > nsGfxScrollFrame::InvalidateInternal currently checks for it.) Hmm ... actually I think it's not necessary. I'll file a separate bug to get rid of it. > Also, if you want (feel free to do this or not), it seems like it might make > sense to structure nsGfxScrollFrame::InvalidateInternal as: > > if (aForChild == mInner.mScrolledFrame) { > // ... existing code, inside if (!(aFlags & INVALIDATE_NOTIFY_ONLY)) > } else if (aForChild == mInner.mHScrollbarBox) { > // your conditional new early return, with your comment > } else if (aForChild == mInner.mVScrollbarBox) { > // same, but with pointer to previous comment > } > > nsHTMLContainerFrame::InvalidateInternal(...); Good idea, I'll do that.
Whiteboard: [needs landing]
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Whiteboard: [needs landing]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: