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