Title: [103867] trunk
Revision
103867
Author
[email protected]
Date
2011-12-31 17:04:08 -0800 (Sat, 31 Dec 2011)

Log 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.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (103866 => 103867)


--- trunk/LayoutTests/ChangeLog	2012-01-01 00:58:20 UTC (rev 103866)
+++ trunk/LayoutTests/ChangeLog	2012-01-01 01:04:08 UTC (rev 103867)
@@ -1,3 +1,14 @@
+2011-12-31  Dan Bernstein  <[email protected]>
+
+        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.
+
 2011-12-30  Andreas Kling  <[email protected]>
 
         Cache and reuse the HTMLTableElement.rows collection.

Added: trunk/LayoutTests/fast/events/frame-scroll-fake-mouse-move-expected.txt (0 => 103867)


--- trunk/LayoutTests/fast/events/frame-scroll-fake-mouse-move-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/frame-scroll-fake-mouse-move-expected.txt	2012-01-01 01:04:08 UTC (rev 103867)
@@ -0,0 +1 @@
+PASS

Copied: trunk/LayoutTests/fast/events/frame-scroll-fake-mouse-move.html (from rev 103865, trunk/LayoutTests/fast/events/overflow-scroll-fake-mouse-move.html) (0 => 103867)


--- trunk/LayoutTests/fast/events/frame-scroll-fake-mouse-move.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/frame-scroll-fake-mouse-move.html	2012-01-01 01:04:08 UTC (rev 103867)
@@ -0,0 +1,32 @@
+<body style="height: 200%">
+<div _onmouseover_="mouseOver(event)" style="margin: 300px 0; width: 100px; height: 100px; background-color: blue;"></div>
+<div id="result">Test did not run</div>
+<script>
+    var passed = false;
+
+    function mouseOver(event)
+    {
+        passed = true;
+    }
+
+    function finish()
+    {
+        document.getElementById("result").innerText = passed ? "PASS" : "FAIL";
+        layoutTestController.notifyDone();
+    }
+
+    if (window.layoutTestController) {
+        layoutTestController.dumpAsText();
+        layoutTestController.waitUntilDone();
+
+        // WebKit schedules a fake mouse move event as part of installing the WebView in
+        // a window. For the test to be valid, it must begin only after that event
+        // gets dispatched.
+        setTimeout(function()
+        {
+            eventSender.mouseMoveTo(50, 100);
+            document.body.scrollTop = 250;
+            setTimeout(finish, 200);
+        }, 200);
+    }
+</script>

Modified: trunk/Source/WebCore/ChangeLog (103866 => 103867)


--- trunk/Source/WebCore/ChangeLog	2012-01-01 00:58:20 UTC (rev 103866)
+++ trunk/Source/WebCore/ChangeLog	2012-01-01 01:04:08 UTC (rev 103867)
@@ -1,3 +1,16 @@
+2011-12-31  Dan Bernstein  <[email protected]>
+
+        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().
+
 2012-01-01  Andreas Kling  <[email protected]>
 
         Cache named item collections on Document, not just their caches.

Modified: trunk/Source/WebCore/page/FrameView.cpp (103866 => 103867)


--- trunk/Source/WebCore/page/FrameView.cpp	2012-01-01 00:58:20 UTC (rev 103866)
+++ trunk/Source/WebCore/page/FrameView.cpp	2012-01-01 01:04:08 UTC (rev 103867)
@@ -1735,6 +1735,7 @@
 void FrameView::scrollPositionChanged()
 {
     frame()->eventHandler()->sendScrollEvent();
+    frame()->eventHandler()->dispatchFakeMouseMoveEventSoon();
 
 #if USE(ACCELERATED_COMPOSITING)
     if (RenderView* root = rootRenderer(this)) {

Modified: trunk/Source/WebKit/mac/ChangeLog (103866 => 103867)


--- trunk/Source/WebKit/mac/ChangeLog	2012-01-01 00:58:20 UTC (rev 103866)
+++ trunk/Source/WebKit/mac/ChangeLog	2012-01-01 01:04:08 UTC (rev 103867)
@@ -1,3 +1,23 @@
+2011-12-31  Dan Bernstein  <[email protected]>
+
+        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.
+
 2011-12-23  Ryosuke Niwa  <[email protected]>
 
         Chromium Mac build fix.

Modified: trunk/Source/WebKit/mac/WebView/WebHTMLView.mm (103866 => 103867)


--- trunk/Source/WebKit/mac/WebView/WebHTMLView.mm	2012-01-01 00:58:20 UTC (rev 103866)
+++ trunk/Source/WebKit/mac/WebView/WebHTMLView.mm	2012-01-01 01:04:08 UTC (rev 103867)
@@ -518,8 +518,6 @@
     
     WebDataSource *dataSource;
     WebCore::CachedImage* promisedDragTIFFDataSource;
-    
-    CFRunLoopTimerRef updateMouseoverTimer;
 
     SEL selectorForDoCommandBySelector;
 
@@ -578,7 +576,6 @@
 
     ASSERT(!autoscrollTimer);
     ASSERT(!autoscrollTriggerEvent);
-    ASSERT(!updateMouseoverTimer);
     
     [mouseDownEvent release];
     [keyDownEvent release];
@@ -1047,15 +1044,6 @@
     _private->mouseDownEvent = event;
 }
 
-- (void)_cancelUpdateMouseoverTimer
-{
-    if (_private->updateMouseoverTimer) {
-        CFRunLoopTimerInvalidate(_private->updateMouseoverTimer);
-        CFRelease(_private->updateMouseoverTimer);
-        _private->updateMouseoverTimer = NULL;
-    }
-}
-
 - (WebHTMLView *)_topHTMLView
 {
     // FIXME: this can fail if the dataSource is nil, which happens when the WebView is tearing down from the window closing.
@@ -1190,8 +1178,6 @@
 
 - (void)_updateMouseoverWithFakeEvent
 {
-    [self _cancelUpdateMouseoverTimer];
-    
     NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSMouseMoved
         location:[[self window] convertScreenToBase:[NSEvent mouseLocation]]
         modifierFlags:[[NSApp currentEvent] modifierFlags]
@@ -1203,13 +1189,6 @@
     [self _updateMouseoverWithEvent:fakeEvent];
 }
 
-static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info)
-{
-    WebHTMLView *view = (WebHTMLView *)info;
-    
-    [view _updateMouseoverWithFakeEvent];
-}
-
 - (void)_frameOrBoundsChanged
 {
     WebView *webView = [self _webView];
@@ -1231,16 +1210,6 @@
     }
     _private->lastScrollPosition = origin;
 
-    if ([self window] && !_private->closed && !_private->updateMouseoverTimer) {
-        CFRunLoopTimerContext context = { 0, self, NULL, NULL, NULL };
-        
-        // Use a 100ms delay so that the synthetic mouse over update doesn't cause cursor thrashing when pages are loading
-        // and scrolling rapidly back to back.
-        _private->updateMouseoverTimer = CFRunLoopTimerCreate(NULL, CFAbsoluteTimeGetCurrent() + 0.1, 0, 0, 0,
-                                                              _updateMouseoverTimerCallback, &context);
-        CFRunLoopAddTimer(CFRunLoopGetCurrent(), _private->updateMouseoverTimer, kCFRunLoopDefaultMode);
-    }
-    
 #if USE(ACCELERATED_COMPOSITING) && defined(BUILDING_ON_LEOPARD)
     [self _updateLayerHostingViewPosition];
 #endif
@@ -1902,7 +1871,6 @@
 
     _private->closed = YES;
 
-    [self _cancelUpdateMouseoverTimer];
     [self _clearLastHitViewIfSelf];
     [self _removeMouseMovedObserverUnconditionally];
     [self _removeWindowObservers];
@@ -2910,7 +2878,6 @@
     [self _removeMouseMovedObserverUnconditionally];
     [self _removeWindowObservers];
     [self _removeSuperviewObservers];
-    [self _cancelUpdateMouseoverTimer];
 
     // FIXME: This accomplishes the same thing as the call to setCanStartMedia(false) in
     // WebView. It would be nice to have a single mechanism instead of two.
@@ -3534,9 +3501,6 @@
     if (!([event modifierFlags] & NSControlKeyMask)) {
         _private->ignoringMouseDraggedEvents = NO;
 
-        // Don't do any mouseover while the mouse is down.
-        [self _cancelUpdateMouseoverTimer];
-
         // Let WebCore get a chance to deal with the event. This will call back to us
         // to start the autoscroll timer if appropriate.
         if (Frame* coreframe = core([self _frame]))
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to