Bug 1217818 - Ignore injected touchstart events for the purposes of prevent-default notifications back to APZ. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 28 Oct 2015 12:53:52 -0400
changeset 305179 17a95e197925af9867b4474e848fde717df4ace0
parent 305178 3e2f7db053c62fc44c65a35ae8b711637c5450a2
child 305180 2df18499b6ad9328a0c45b58b15da1422ec09b79
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1217818
milestone44.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 1217818 - Ignore injected touchstart events for the purposes of prevent-default notifications back to APZ. r=botond
gfx/layers/apz/util/APZEventState.cpp
--- a/gfx/layers/apz/util/APZEventState.cpp
+++ b/gfx/layers/apz/util/APZEventState.cpp
@@ -264,16 +264,24 @@ APZEventState::ProcessTouchEvent(const W
   bool sentContentResponse = false;
   APZES_LOG("Handling event type %d\n", aEvent.mMessage);
   switch (aEvent.mMessage) {
   case eTouchStart: {
     mTouchEndCancelled = false;
     sentContentResponse = SendPendingTouchPreventedResponse(false);
     // sentContentResponse can be true here if we get two TOUCH_STARTs in a row
     // and just responded to the first one.
+    if (!aEvent.mFlags.mHandledByAPZ) {
+      // This condition being true means this touchstart is synthetic and is
+      // coming from TabParent.injectTouchEvent.
+      // Since APZ doesn't know about it we don't want to send a response for
+      // this block; we want to just skip over it from the point of view of
+      // prevent-default notifications.
+      break;
+    }
     if (isTouchPrevented) {
       mContentReceivedInputBlockCallback(aGuid, aInputBlockId, isTouchPrevented);
       sentContentResponse = true;
     } else {
       APZES_LOG("Event not prevented; pending response for %" PRIu64 " %s\n",
         aInputBlockId, Stringify(aGuid).c_str());
       mPendingTouchPreventedResponse = true;
       mPendingTouchPreventedGuid = aGuid;