Changeset 103867 in webkit


Ignore:
Timestamp:
Dec 31, 2011, 5:04:08 PM (13 years ago)
Author:
mitz@apple.com
Message:

Source/WebCore: WebCore changes for: REGRESSION (WebKit2): Cursor, hover states not updated when page scrolls under stationary mouse pointer
https://bugs.webkit.org/show_bug.cgi?id=75405

Reviewed by Anders Carlsson.

Test: fast/events/frame-scroll-fake-mouse-move.html

  • page/FrameView.cpp:

(WebCore::FrameView::scrollPositionChanged): Added a call to
EventHandler::dispatchFakeMouseMoveEventSoon().

Source/WebKit/mac: WebKit/mac changes for: REGRESSION (WebKit2): Cursor, hover states not updated when page scrolls under stationary mouse pointer
https://bugs.webkit.org/show_bug.cgi?id=75405

Reviewed by Anders Carlsson.

Removed the WebKit/mac mechanism for dispatching fake mouse moved events
when an HTML frame scrolls, since FrameView now does this.

  • WebView/WebHTMLView.mm:

(-[WebHTMLViewPrivate dealloc]): Removed an assertion about a removed ivar.
(-[WebHTMLView _updateMouseoverWithFakeEvent]): Removed call to
-_cancelUpdateMouseoverTimer.
(-[WebHTMLView _frameOrBoundsChanged]): Removed code to schedule a timer
for dispatching a mouse moved event on scroll.
(-[WebHTMLView close]): Removed call to _cancelUpdateMouseoverTimer.
(-[WebHTMLView viewWillMoveToWindow:]): Ditto.
(-[WebHTMLView mouseDown:]): Ditto.

LayoutTests: REGRESSION (WebKit2): Cursor, hover states not updated when page scrolls under stationary mouse pointer
https://bugs.webkit.org/show_bug.cgi?id=75405

Reviewed by Anders Carlsson.

  • fast/events/frame-scroll-fake-mouse-move-expected.txt: Added.
  • fast/events/frame-scroll-fake-mouse-move.html: Copied from

LayoutTests/fast/events/overflow-scroll-fake-mouse-move.html and adapted to page scrolling.

Location:
trunk
Files:
1 added
5 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r103856 r103867  
     12011-12-31  Dan Bernstein  <mitz@apple.com>
     2
     3        REGRESSION (WebKit2): Cursor, hover states not updated when page scrolls under stationary mouse pointer
     4        https://bugs.webkit.org/show_bug.cgi?id=75405
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * fast/events/frame-scroll-fake-mouse-move-expected.txt: Added.
     9        * fast/events/frame-scroll-fake-mouse-move.html: Copied from
     10        LayoutTests/fast/events/overflow-scroll-fake-mouse-move.html and adapted to page scrolling.
     11
    1122011-12-30  Andreas Kling  <awesomekling@apple.com>
    213
  • trunk/LayoutTests/fast/events/frame-scroll-fake-mouse-move.html

    r103865 r103867  
    1 <div id="target" style="overflow: auto; height: 200px; width: 200px;">
    2     <div onmouseover="mouseOver(event)" style="margin: 300px 0; width: 100px; height: 100px; background-color: blue;"></div>
    3 </div>
     1<body style="height: 200%">
     2<div onmouseover="mouseOver(event)" style="margin: 300px 0; width: 100px; height: 100px; background-color: blue;"></div>
    43<div id="result">Test did not run</div>
    54<script>
     
    2726        {
    2827            eventSender.mouseMoveTo(50, 100);
    29             document.getElementById("target").scrollTop = 250;
     28            document.body.scrollTop = 250;
    3029            setTimeout(finish, 200);
    3130        }, 200);
  • trunk/Source/WebCore/ChangeLog

    r103865 r103867  
     12011-12-31  Dan Bernstein  <mitz@apple.com>
     2
     3        WebCore changes for: REGRESSION (WebKit2): Cursor, hover states not updated when page scrolls under stationary mouse pointer
     4        https://bugs.webkit.org/show_bug.cgi?id=75405
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Test: fast/events/frame-scroll-fake-mouse-move.html
     9
     10        * page/FrameView.cpp:
     11        (WebCore::FrameView::scrollPositionChanged): Added a call to
     12        EventHandler::dispatchFakeMouseMoveEventSoon().
     13
    1142012-01-01  Andreas Kling  <awesomekling@apple.com>
    215
  • trunk/Source/WebCore/page/FrameView.cpp

    r103565 r103867  
    17361736{
    17371737    frame()->eventHandler()->sendScrollEvent();
     1738    frame()->eventHandler()->dispatchFakeMouseMoveEventSoon();
    17381739
    17391740#if USE(ACCELERATED_COMPOSITING)
  • trunk/Source/WebKit/mac/ChangeLog

    r103652 r103867  
     12011-12-31  Dan Bernstein  <mitz@apple.com>
     2
     3        WebKit/mac changes for: REGRESSION (WebKit2): Cursor, hover states not updated when page scrolls under stationary mouse pointer
     4        https://bugs.webkit.org/show_bug.cgi?id=75405
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Removed the WebKit/mac mechanism for dispatching fake mouse moved events
     9        when an HTML frame scrolls, since FrameView now does this.
     10
     11        * WebView/WebHTMLView.mm:
     12        (-[WebHTMLViewPrivate dealloc]): Removed an assertion about a removed ivar.
     13        (-[WebHTMLView _updateMouseoverWithFakeEvent]): Removed call to
     14        -_cancelUpdateMouseoverTimer.
     15        (-[WebHTMLView _frameOrBoundsChanged]): Removed code to schedule a timer
     16        for dispatching a mouse moved event on scroll.
     17        (-[WebHTMLView close]): Removed call to _cancelUpdateMouseoverTimer.
     18        (-[WebHTMLView viewWillMoveToWindow:]): Ditto.
     19        (-[WebHTMLView mouseDown:]): Ditto.
     20
    1212011-12-23  Ryosuke Niwa  <rniwa@webkit.org>
    222
  • trunk/Source/WebKit/mac/WebView/WebHTMLView.mm

    r103643 r103867  
    519519    WebDataSource *dataSource;
    520520    WebCore::CachedImage* promisedDragTIFFDataSource;
    521    
    522     CFRunLoopTimerRef updateMouseoverTimer;
    523521
    524522    SEL selectorForDoCommandBySelector;
     
    579577    ASSERT(!autoscrollTimer);
    580578    ASSERT(!autoscrollTriggerEvent);
    581     ASSERT(!updateMouseoverTimer);
    582579   
    583580    [mouseDownEvent release];
     
    10481045}
    10491046
    1050 - (void)_cancelUpdateMouseoverTimer
    1051 {
    1052     if (_private->updateMouseoverTimer) {
    1053         CFRunLoopTimerInvalidate(_private->updateMouseoverTimer);
    1054         CFRelease(_private->updateMouseoverTimer);
    1055         _private->updateMouseoverTimer = NULL;
    1056     }
    1057 }
    1058 
    10591047- (WebHTMLView *)_topHTMLView
    10601048{
     
    11911179- (void)_updateMouseoverWithFakeEvent
    11921180{
    1193     [self _cancelUpdateMouseoverTimer];
    1194    
    11951181    NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved
    11961182        location:[[self window] convertScreenToBase:[NSEvent mouseLocation]]
     
    12021188   
    12031189    [self _updateMouseoverWithEvent:fakeEvent];
    1204 }
    1205 
    1206 static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
    1207 {
    1208     WebHTMLView *view = (WebHTMLView *)info;
    1209    
    1210     [view _updateMouseoverWithFakeEvent];
    12111190}
    12121191
     
    12321211    _private->lastScrollPosition = origin;
    12331212
    1234     if ([self window] && !_private->closed && !_private->updateMouseoverTimer) {
    1235         CFRunLoopTimerContext context = { 0, self, NULL, NULL, NULL };
    1236        
    1237         // Use a 100ms delay so that the synthetic mouse over update doesn't cause cursor thrashing when pages are loading
    1238         // and scrolling rapidly back to back.
    1239         _private->updateMouseoverTimer = CFRunLoopTimerCreate(NULL, CFAbsoluteTimeGetCurrent() + 0.1, 0, 0, 0,
    1240                                                               _updateMouseoverTimerCallback, &context);
    1241         CFRunLoopAddTimer(CFRunLoopGetCurrent(), _private->updateMouseoverTimer, kCFRunLoopDefaultMode);
    1242     }
    1243    
    12441213#if USE(ACCELERATED_COMPOSITING) && defined(BUILDING_ON_LEOPARD)
    12451214    [self _updateLayerHostingViewPosition];
     
    19031872    _private->closed = YES;
    19041873
    1905     [self _cancelUpdateMouseoverTimer];
    19061874    [self _clearLastHitViewIfSelf];
    19071875    [self _removeMouseMovedObserverUnconditionally];
     
    29112879    [self _removeWindowObservers];
    29122880    [self _removeSuperviewObservers];
    2913     [self _cancelUpdateMouseoverTimer];
    29142881
    29152882    // FIXME: This accomplishes the same thing as the call to setCanStartMedia(false) in
     
    35343501    if (!([event modifierFlags] & NSControlKeyMask)) {
    35353502        _private->ignoringMouseDraggedEvents = NO;
    3536 
    3537         // Don't do any mouseover while the mouse is down.
    3538         [self _cancelUpdateMouseoverTimer];
    35393503
    35403504        // Let WebCore get a chance to deal with the event. This will call back to us
Note: See TracChangeset for help on using the changeset viewer.