Don't fire a bunch of mouse moveds during scrolling.
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Apr 2015 18:41:10 +0000 (18:41 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Apr 2015 18:41:10 +0000 (18:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=99940

Reviewed by Simon Fraser.

* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchFakeMouseMoveEventSoon):
Even for the short interval timer, make sure to cancel and restart it instead of allowing the original to
complete. This has the effect of preventing fake mouse moves from firing until the scroll stops.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183198 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/page/EventHandler.cpp

index 66802a0..9e9a0f9 100644 (file)
@@ -1,3 +1,15 @@
+2015-04-23  David Hyatt  <hyatt@apple.com>
+
+        Don't fire a bunch of mouse moveds during scrolling.
+        https://bugs.webkit.org/show_bug.cgi?id=99940
+
+        Reviewed by Simon Fraser.
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::dispatchFakeMouseMoveEventSoon):
+        Even for the short interval timer, make sure to cancel and restart it instead of allowing the original to
+        complete. This has the effect of preventing fake mouse moves from firing until the scroll stops.
+
 2015-04-23  Eric Carlson  <eric.carlson@apple.com>
 
         Unreviewed, fix the release build.
index 10b69d6..886c765 100644 (file)
@@ -2947,14 +2947,9 @@ void EventHandler::dispatchFakeMouseMoveEventSoon()
     // reschedule the timer and use a longer time. This will cause the content
     // to receive these moves only after the user is done scrolling, reducing
     // pauses during the scroll.
-    if (m_maxMouseMovedDuration > fakeMouseMoveDurationThreshold) {
-        if (m_fakeMouseMoveEventTimer.isActive())
-            m_fakeMouseMoveEventTimer.stop();
-        m_fakeMouseMoveEventTimer.startOneShot(fakeMouseMoveLongInterval);
-    } else {
-        if (!m_fakeMouseMoveEventTimer.isActive())
-            m_fakeMouseMoveEventTimer.startOneShot(fakeMouseMoveShortInterval);
-    }
+    if (m_fakeMouseMoveEventTimer.isActive())
+        m_fakeMouseMoveEventTimer.stop();
+    m_fakeMouseMoveEventTimer.startOneShot(m_maxMouseMovedDuration > fakeMouseMoveDurationThreshold ? fakeMouseMoveLongInterval : fakeMouseMoveShortInterval);
 #endif
 }