Bug 1426388 - Crash in mozilla::TouchManager::SuppressInvalidPointsAndGetTargetedFrame. r=smaug.
authorStone Shih <sshih@mozilla.com>
Wed, 20 Dec 2017 23:32:52 +0800
changeset 448856 4c1302ff2703c8ac8c50b1b763b9e2a67a2dc7ae
parent 448855 39d5991f02ba0e9950c380f91817fb9bac430d87
child 448857 8755649474b2769f76c81383ed5a79d56d7782d3
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1426388
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 1426388 - Crash in mozilla::TouchManager::SuppressInvalidPointsAndGetTargetedFrame. r=smaug.
layout/base/TouchManager.cpp
--- a/layout/base/TouchManager.cpp
+++ b/layout/base/TouchManager.cpp
@@ -212,22 +212,22 @@ TouchManager::SuppressInvalidPointsAndGe
       // if we couldn't find a target frame in the same document as
       // anyTarget, remove the touch from the capture touch list, as
       // well as the event->mTouches array. touchmove events that aren't
       // in the captured touch list will be discarded
       if (!newTargetFrame) {
         touch->mIsTouchEventSuppressed = true;
       } else {
         targetFrame = newTargetFrame;
+        targetFrame->GetContentForEvent(aEvent, getter_AddRefs(targetContent));
+        while (targetContent && !targetContent->IsElement()) {
+          targetContent = targetContent->GetParent();
+        }
+        touch->SetTarget(targetContent);
       }
-      targetFrame->GetContentForEvent(aEvent, getter_AddRefs(targetContent));
-      while (targetContent && !targetContent->IsElement()) {
-        targetContent = targetContent->GetParent();
-      }
-      touch->SetTarget(targetContent);
     }
     if (targetFrame) {
       frame = targetFrame;
     }
   }
   return frame;
 }