From 14605808e6932c3600a0b0166149019066c40654 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Fri, 15 Nov 2013 21:47:01 -0500 Subject: [PATCH] Bug 932792 - Don't apply APZC untransforms to mouse input on scrollbars. r=mbrubeck --- browser/metro/base/content/input.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/browser/metro/base/content/input.js b/browser/metro/base/content/input.js index 7a74dc87502..0a7eff652f1 100644 --- a/browser/metro/base/content/input.js +++ b/browser/metro/base/content/input.js @@ -162,8 +162,17 @@ var TouchModule = { this._handleKeyDown(aEvent); break; case "MozMouseHittest": - // Used by widget to hit test chrome vs content - if (aEvent.target.ownerDocument == document) { + // Used by widget to hit test chrome vs content. Make sure the XUl scrollbars + // are counted as "chrome". Since the XUL scrollbars have sub-elements we walk + // the parent chain to ensure we catch all of those as well. + let onScrollbar = false; + for (let node = aEvent.originalTarget; node instanceof XULElement; node = node.parentNode) { + if (node.tagName == 'scrollbar') { + onScrollbar = true; + break; + } + } + if (onScrollbar || aEvent.target.ownerDocument == document) { aEvent.preventDefault(); } aEvent.stopPropagation();