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