bug 1362404 - Handle out-of-order overlapping event coalescing. r=masayuki
authorChris H-C <chutten@mozilla.com>
Tue, 09 May 2017 11:07:40 -0400
changeset 357497 07819b6e08bfa493cb54ec1a2b7072694ec224cc
parent 357496 1500391c15309e87a843aeb7fd46a98e5273b8ad
child 357498 7cb81c02e4392a1affd1b1c9a4047e642ce58d24
push id31795
push userkwierso@gmail.com
push dateWed, 10 May 2017 22:26:00 +0000
treeherdermozilla-central@3df2494ade45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1362404
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1362404 - Handle out-of-order overlapping event coalescing. r=masayuki There are situations where events may be handled out-of-order. Allow coalescing to happen backwards in time as well as forwards to cover them. MozReview-Commit-ID: 3k7vNFxE1cz
layout/base/PresShell.cpp
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -8280,16 +8280,20 @@ PresShell::HandleEventInternal(WidgetEve
       if (sLastInputProcessed) {
         // This input event was created after we handled the last one.
         // Accumulate the previous events' coalesced duration.
         double lastMillis = (sLastInputProcessed - sLastInputCreated).ToMilliseconds();
         Telemetry::Accumulate(Telemetry::INPUT_EVENT_RESPONSE_COALESCED_MS,
                               lastMillis);
       }
       sLastInputCreated = aEvent->mTimeStamp;
+    } else if (aEvent->mTimeStamp < sLastInputCreated) {
+      // This event was created before the last input. May be processing out
+      // of order, so coalesce backwards, too.
+      sLastInputCreated = aEvent->mTimeStamp;
     }
     sLastInputProcessed = now;
   }
 
   return rv;
 }
 
 /* static */ void