Changeset 55159 in webkit


Ignore:
Timestamp:
Feb 23, 2010 9:54:37 AM (14 years ago)
Author:
mitz@apple.com
Message:

WebKit/mac: <rdar://problem/7611158> Incomplete repaint of YouTube timeline thumb while scrolling
https://bugs.webkit.org/show_bug.cgi?id=34381

Reviewed by Simon Fraser.

Test: fast/repaint/repaint-during-scroll.html

NSClipView offsets any rects marked as needing display during scrolling
by the scroll offset. Compensate for this when -setNeedsDisplay: is called
during scrolling.

  • WebView/WebHTMLView.mm:

(-[WebHTMLView _frameOrBoundsChanged]): Set inScrollPositionChanged to YES
around to call to FrameView::scrollPositionChanged().
(-[WebHTMLView setNeedsDisplayInRect:]): When called beneath
scrollPositionChanged(), adjust the rect by the inverse of the scroll offset.

LayoutTests: Rubber-stamped by Simon Fraser.

<rdar://problem/7611158> Incomplete repaint of YouTube timeline thumb while scrolling
https://bugs.webkit.org/show_bug.cgi?id=34381

  • fast/repaint/repaint-during-scroll.html: Added.
  • platform/mac/fast/repaint/repaint-during-scroll-expected.checksum: Added.
  • platform/mac/fast/repaint/repaint-during-scroll-expected.png: Added.
  • platform/mac/fast/repaint/repaint-during-scroll-expected.txt: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r55157 r55159  
     12010-02-23  Dan Bernstein  <mitz@apple.com>
     2
     3        Rubber-stamped by Simon Fraser.
     4
     5        <rdar://problem/7611158> Incomplete repaint of YouTube timeline thumb while scrolling
     6        https://bugs.webkit.org/show_bug.cgi?id=34381
     7
     8        * fast/repaint/repaint-during-scroll.html: Added.
     9        * platform/mac/fast/repaint/repaint-during-scroll-expected.checksum: Added.
     10        * platform/mac/fast/repaint/repaint-during-scroll-expected.png: Added.
     11        * platform/mac/fast/repaint/repaint-during-scroll-expected.txt: Added.
     12
    1132010-02-23  Brady Eidson  <beidson@apple.com>
    214
  • trunk/WebKit/mac/ChangeLog

    r55136 r55159  
     12010-02-23  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Simon Fraser.
     4
     5        <rdar://problem/7611158> Incomplete repaint of YouTube timeline thumb while scrolling
     6        https://bugs.webkit.org/show_bug.cgi?id=34381
     7
     8        Test: fast/repaint/repaint-during-scroll.html
     9
     10        NSClipView offsets any rects marked as needing display during scrolling
     11        by the scroll offset. Compensate for this when -setNeedsDisplay: is called
     12        during scrolling.
     13
     14        * WebView/WebHTMLView.mm:
     15        (-[WebHTMLView _frameOrBoundsChanged]): Set inScrollPositionChanged to YES
     16        around to call to FrameView::scrollPositionChanged().
     17        (-[WebHTMLView setNeedsDisplayInRect:]): When called beneath
     18        scrollPositionChanged(), adjust the rect by the inverse of the scroll offset.
     19
    1202010-02-23  Steve Block  <steveblock@google.com>
    221
  • trunk/WebKit/mac/WebView/WebHTMLView.mm

    r55064 r55159  
    430430
    431431    NSPoint lastScrollPosition;
     432#ifndef BUILDING_ON_TIGER
     433    BOOL inScrollPositionChanged;
     434#endif
    432435
    433436    WebPluginController *pluginController;
     
    11721175    if (!NSEqualPoints(_private->lastScrollPosition, origin)) {
    11731176        if (Frame* coreFrame = core([self _frame])) {
    1174             if (FrameView* coreView = coreFrame->view())
     1177            if (FrameView* coreView = coreFrame->view()) {
     1178#ifndef BUILDING_ON_TIGER
     1179                _private->inScrollPositionChanged = YES;
     1180#endif
    11751181                coreView->scrollPositionChanged();
     1182#ifndef BUILDING_ON_TIGER
     1183                _private->inScrollPositionChanged = NO;
     1184#endif
     1185            }
    11761186        }
    11771187   
     
    31383148}
    31393149
     3150#if !LOG_DISABLED
    31403151- (void)setNeedsDisplay:(BOOL)flag
    31413152{
     
    31433154    [super setNeedsDisplay:flag];
    31443155}
     3156#endif
     3157
     3158#ifndef BUILDING_ON_TIGER
     3159- (void)setNeedsDisplayInRect:(NSRect)invalidRect
     3160{
     3161    if (_private->inScrollPositionChanged) {
     3162        // When scrolling, the dirty regions are adjusted for the scroll only
     3163        // after NSViewBoundsDidChangeNotification is sent. Translate the invalid
     3164        // rect to pre-scrolled coordinates in order to get the right dirty region
     3165        // after adjustment. See <rdar://problem/7678927>.
     3166        NSPoint origin = [[self superview] bounds].origin;
     3167        invalidRect.origin.x -= _private->lastScrollPosition.x - origin.x;
     3168        invalidRect.origin.y -= _private->lastScrollPosition.y - origin.y;
     3169    }
     3170    [super setNeedsDisplayInRect:invalidRect];
     3171}
     3172#endif
    31453173
    31463174- (void)setNeedsLayout: (BOOL)flag
Note: See TracChangeset for help on using the changeset viewer.