Title: [153809] trunk/Source/WebCore
Revision
153809
Author
[email protected]
Date
2013-08-07 18:31:36 -0700 (Wed, 07 Aug 2013)

Log Message

Be more aggressive about sending fake mouse events less frequently
https://bugs.webkit.org/show_bug.cgi?id=119563
<rdar://problem/14669029>

Reviewed by Tim Horton.

r109151 added code that throttles back the fake mouse events that we
send during scrolling, but in such a way that a page could take up to
100ms to handle a single mousemove, and we'd still send fake mousemove
events every 100ms. This could cause serious scrolling stutter.

Fix by changing when we drop back to sending events every 250ms, rather than every
100ms: if the slowest mousemove takes 10ms or more (less than one frame), drop back
to a 250ms fake move interval.

* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchFakeMouseMoveEventSoon):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (153808 => 153809)


--- trunk/Source/WebCore/ChangeLog	2013-08-08 00:51:36 UTC (rev 153808)
+++ trunk/Source/WebCore/ChangeLog	2013-08-08 01:31:36 UTC (rev 153809)
@@ -1,3 +1,23 @@
+2013-08-07  Simon Fraser  <[email protected]>
+
+        Be more aggressive about sending fake mouse events less frequently
+        https://bugs.webkit.org/show_bug.cgi?id=119563
+        <rdar://problem/14669029>
+
+        Reviewed by Tim Horton.
+
+        r109151 added code that throttles back the fake mouse events that we
+        send during scrolling, but in such a way that a page could take up to
+        100ms to handle a single mousemove, and we'd still send fake mousemove
+        events every 100ms. This could cause serious scrolling stutter.
+        
+        Fix by changing when we drop back to sending events every 250ms, rather than every
+        100ms: if the slowest mousemove takes 10ms or more (less than one frame), drop back
+        to a 250ms fake move interval.
+
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::dispatchFakeMouseMoveEventSoon):
+
 2013-08-07  Adenilson Cavalcanti  <[email protected]>
 
         [rendering] Implement PaintInfo interfaces

Modified: trunk/Source/WebCore/page/EventHandler.cpp (153808 => 153809)


--- trunk/Source/WebCore/page/EventHandler.cpp	2013-08-08 00:51:36 UTC (rev 153808)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2013-08-08 01:31:36 UTC (rev 153809)
@@ -139,10 +139,11 @@
 #endif
 
 // The amount of time to wait before sending a fake mouse event, triggered
-// during a scroll. The short interval is used if the content responds to the mouse events quickly enough,
-// otherwise the long interval is used.
+// during a scroll. The short interval is used if the content responds to the mouse events
+// in fakeMouseMoveDurationThreshold or less, otherwise the long interval is used.
+const double fakeMouseMoveDurationThreshold = 0.01;
 const double fakeMouseMoveShortInterval = 0.1;
-const double fakeMouseMoveLongInterval = 0.250;
+const double fakeMouseMoveLongInterval = 0.25;
 
 // The amount of time to wait for a cursor update on style and layout changes
 // Set to 50Hz, no need to be faster than common screen refresh rate
@@ -3037,7 +3038,7 @@
     // 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 > fakeMouseMoveShortInterval) {
+    if (m_maxMouseMovedDuration > fakeMouseMoveDurationThreshold) {
         if (m_fakeMouseMoveEventTimer.isActive())
             m_fakeMouseMoveEventTimer.stop();
         m_fakeMouseMoveEventTimer.startOneShot(fakeMouseMoveLongInterval);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to