Bug 1414336 - Don't fire pointercancel when content prevents default on touchstart. r=kats.
authorStone Shih <sshih@mozilla.com>
Thu, 11 Jan 2018 10:12:20 +0800
changeset 399240 f59d5e77eee08dc55839363423036ffd2e4f7c12
parent 399239 5f74d7b82fe3aa5911e38ccfc1e19fc071555530
child 399241 f80a0db7028491293d85bcfe17f27fa103d33938
push id98919
push usersshih@mozilla.com
push dateMon, 15 Jan 2018 05:41:09 +0000
treeherdermozilla-inbound@f80a0db70284 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1414336
milestone59.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 1414336 - Don't fire pointercancel when content prevents default on touchstart. r=kats. MozReview-Commit-ID: LWPI415MV2F
gfx/layers/apz/util/APZEventState.cpp
--- a/gfx/layers/apz/util/APZEventState.cpp
+++ b/gfx/layers/apz/util/APZEventState.cpp
@@ -382,17 +382,17 @@ APZEventState::ProcessTouchEvent(const W
     break;
   }
 
   default:
     MOZ_ASSERT_UNREACHABLE("Unknown touch event type");
     break;
   }
 
-  if (sentContentResponse &&
+  if (sentContentResponse && !isTouchPrevented &&
         aApzResponse == nsEventStatus_eConsumeDoDefault &&
         gfxPrefs::PointerEventsEnabled()) {
     WidgetTouchEvent cancelEvent(aEvent);
     cancelEvent.mMessage = eTouchPointerCancel;
     cancelEvent.mFlags.mCancelable = false; // mMessage != eTouchCancel;
     for (uint32_t i = 0; i < cancelEvent.mTouches.Length(); ++i) {
       if (mozilla::dom::Touch* touch = cancelEvent.mTouches[i]) {
         touch->convertToPointer = true;