Bug 832957 - Temporarily trap zoom double tap events and send them to content. r=mbrubeck

This commit is contained in:
Jim Mathies 2013-02-27 10:27:48 -06:00
parent 566b4426cb
commit b112f17c00

View File

@ -34,8 +34,6 @@ const kMaxVelocity = 6;
// in metro. Fixing something in this mode does not insure the bug is
// in metro.
const kDebugMouseInputPref = "metro.debug.treatmouseastouch";
// Colorizes the touch input overlay so you know when it is active.
const kDebugMouseLayerPref = "metro.debug.colorizeInputOverlay";
// Display rects around selection ranges. Useful in debugging
// selection problems.
const kDebugSelectionDisplayPref = "metro.debug.selection.displayRanges";
@ -94,6 +92,7 @@ var TouchModule = {
// capture phase events
window.addEventListener("CancelTouchSequence", this, true);
window.addEventListener("dblclick", this, true);
// bubble phase
window.addEventListener("contextmenu", this, false);
@ -142,6 +141,18 @@ var TouchModule = {
case "touchend":
this._onTouchEnd(aEvent);
break;
case "dblclick":
// XXX This will get picked up somewhere below us for "double tap to zoom"
// once we get omtc and the apzc. Currently though dblclick is delivered to
// content and triggers selection of text, so fire up the SelectionHelperUI
// once selection is present.
setTimeout(function () {
let contextInfo = { name: "",
json: { xPos: aEvent.clientX, yPos: aEvent.clientY },
target: Browser.selectedTab.browser };
SelectionHelperUI.attachEditSession(contextInfo);
}, 50);
break;
}
}
}