зеркало из https://github.com/mozilla/gecko-dev.git
Backout bug 888329 for causing permanent metro-chrome mochitest failures in bug 889694
This commit is contained in:
Родитель
92f5085fc7
Коммит
1b5b103f80
|
@ -73,7 +73,9 @@ var Browser = {
|
|||
BrowserTouchHandler.init();
|
||||
PopupBlockerObserver.init();
|
||||
|
||||
// Init the touch scrollbox
|
||||
// Warning, total hack ahead. All of the real-browser related scrolling code
|
||||
// lies in a pretend scrollbox here. Let's not land this as-is. Maybe it's time
|
||||
// to redo all the dragging code.
|
||||
this.contentScrollbox = Elements.browsers;
|
||||
this.contentScrollboxScroller = {
|
||||
scrollBy: function(aDx, aDy) {
|
||||
|
@ -145,6 +147,10 @@ var Browser = {
|
|||
messageManager.addMessageListener("Browser:TapOnSelection", this);
|
||||
messageManager.addMessageListener("Browser:PluginClickToPlayClicked", this);
|
||||
|
||||
// Let everyone know what kind of mouse input we are
|
||||
// starting with:
|
||||
InputSourceHelper.fireUpdate();
|
||||
|
||||
Task.spawn(function() {
|
||||
// Activation URIs come from protocol activations, secondary tiles, and file activations
|
||||
let activationURI = yield this.getShortcutOrURI(MetroUtils.activationURI);
|
||||
|
@ -193,9 +199,6 @@ var Browser = {
|
|||
loadStartupURI();
|
||||
}
|
||||
|
||||
// Notify about our input type
|
||||
InputSourceHelper.fireUpdate();
|
||||
|
||||
// Broadcast a UIReady message so add-ons know we are finished with startup
|
||||
let event = document.createEvent("Events");
|
||||
event.initEvent("UIReady", true, false);
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<broadcasterset id="broadcasterset">
|
||||
<broadcaster id="bcast_contentShowing" disabled="false"/>
|
||||
<broadcaster id="bcast_urlbarState" mode="view"/>
|
||||
<broadcaster id="bcast_preciseInput" input="precise"/>
|
||||
<broadcaster id="bcast_preciseInput" input="imprecise"/>
|
||||
<broadcaster id="bcast_windowState" viewstate=""/>
|
||||
</broadcasterset>
|
||||
|
||||
|
|
|
@ -1157,52 +1157,49 @@ var GestureModule = {
|
|||
*/
|
||||
var InputSourceHelper = {
|
||||
isPrecise: false,
|
||||
treatMouseAsTouch: false,
|
||||
|
||||
init: function ish_init() {
|
||||
// debug feature, make all input imprecise
|
||||
window.addEventListener("mousemove", this, true);
|
||||
window.addEventListener("mousedown", this, true);
|
||||
window.addEventListener("touchstart", this, true);
|
||||
},
|
||||
|
||||
_precise: function () {
|
||||
if (!this.isPrecise) {
|
||||
this.isPrecise = true;
|
||||
this._fire("MozPrecisePointer");
|
||||
try {
|
||||
this.treatMouseAsTouch = Services.prefs.getBoolPref(kDebugMouseInputPref);
|
||||
} catch (e) {}
|
||||
if (!this.treatMouseAsTouch) {
|
||||
window.addEventListener("mousemove", this, true);
|
||||
window.addEventListener("mousedown", this, true);
|
||||
}
|
||||
},
|
||||
|
||||
_imprecise: function () {
|
||||
if (this.isPrecise) {
|
||||
this.isPrecise = false;
|
||||
this._fire("MozImprecisePointer");
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
handleEvent: function ish_handleEvent(aEvent) {
|
||||
if (aEvent.type == "touchstart") {
|
||||
this._imprecise();
|
||||
return;
|
||||
}
|
||||
switch (aEvent.mozInputSource) {
|
||||
case Ci.nsIDOMMouseEvent.MOZ_SOURCE_MOUSE:
|
||||
case Ci.nsIDOMMouseEvent.MOZ_SOURCE_PEN:
|
||||
case Ci.nsIDOMMouseEvent.MOZ_SOURCE_ERASER:
|
||||
case Ci.nsIDOMMouseEvent.MOZ_SOURCE_CURSOR:
|
||||
this._precise();
|
||||
if (!this.isPrecise && !this.treatMouseAsTouch) {
|
||||
this.isPrecise = true;
|
||||
this._fire("MozPrecisePointer");
|
||||
}
|
||||
break;
|
||||
|
||||
case Ci.nsIDOMMouseEvent.MOZ_SOURCE_TOUCH:
|
||||
this._imprecise();
|
||||
if (this.isPrecise) {
|
||||
this.isPrecise = false;
|
||||
this._fire("MozImprecisePointer");
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
fireUpdate: function fireUpdate() {
|
||||
if (this.isPrecise) {
|
||||
this._fire("MozPrecisePointer");
|
||||
} else {
|
||||
if (this.treatMouseAsTouch) {
|
||||
this._fire("MozImprecisePointer");
|
||||
} else {
|
||||
if (this.isPrecise) {
|
||||
this._fire("MozPrecisePointer");
|
||||
} else {
|
||||
this._fire("MozImprecisePointer");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче