Bug 959792 - Accomidate content that doesn't support apz scroll or zoom in widget hit testing. Fixes an issue with selection in the navbar while viewing about pages. r=mbrubeck a=metro-only
authorMatt Brubeck <mbrubeck@mozilla.com>
Wed, 22 Jan 2014 11:35:09 -0800
changeset 175937 4308bd949a964a247c2f95f4a4a426ce9aa921ba
parent 175936 b3056af995be7b49da58122745d4a5f8e466e7b6
child 175938 a673eac28120315af742d9701eb7d66bce65b94b
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck, metro-only
bugs959792
milestone28.0a2
Bug 959792 - Accomidate content that doesn't support apz scroll or zoom in widget hit testing. Fixes an issue with selection in the navbar while viewing about pages. r=mbrubeck a=metro-only
widget/windows/winrt/MetroInput.cpp
--- a/widget/windows/winrt/MetroInput.cpp
+++ b/widget/windows/winrt/MetroInput.cpp
@@ -1155,18 +1155,23 @@ MetroInput::DeliverNextQueuedTouchEvent(
    */
 
   // Test for chrome vs. content target. To do this we only use the first touch
   // point since that will be the input batch target. Cache this for touch events
   // since HitTestChrome has to send a dom event.
   if (mCancelable && event->message == NS_TOUCH_START) {
     nsRefPtr<Touch> touch = event->touches[0];
     LayoutDeviceIntPoint pt = LayoutDeviceIntPoint::FromUntyped(touch->mRefPoint);
-    bool apzIntersect = mWidget->ApzHitTest(mozilla::ScreenIntPoint(pt.x, pt.y));
-    mChromeHitTestCacheForTouch = (apzIntersect && HitTestChrome(pt));
+    // This is currently a general contained rect hit test, it may produce a false
+    // positive for overlay chrome elements.
+    mChromeHitTestCacheForTouch = !mWidget->ApzHitTest(mozilla::ScreenIntPoint(pt.x, pt.y));
+    if (!mChromeHitTestCacheForTouch) {
+      // Confirm using a MozMouseHittest event the browser picks up in input.js
+      mChromeHitTestCacheForTouch = HitTestChrome(pt);
+    }
   }
 
   // If this event is destined for chrome, deliver it directly there bypassing
   // the apz.
   if (mChromeHitTestCacheForTouch) {
     DUMP_TOUCH_IDS("DOM(1)", event);
     mWidget->DispatchEvent(event, status);
     if (mCancelable) {