зеркало из https://github.com/mozilla/gecko-dev.git
Bug 907098 - Prevent scrolling of chrome content using apz. r=mbrubeck
This commit is contained in:
Родитель
efaf7f65a7
Коммит
cd24c85048
|
@ -16,6 +16,12 @@ let Cr = Components.results;
|
|||
|
||||
var APZCObserver = {
|
||||
_debugEvents: false,
|
||||
_enabled: false,
|
||||
|
||||
get enabled() {
|
||||
return this._enabled;
|
||||
},
|
||||
|
||||
init: function() {
|
||||
this._enabled = Services.prefs.getBoolPref(kAsyncPanZoomEnabled);
|
||||
if (!this._enabled) {
|
||||
|
|
|
@ -108,6 +108,7 @@ let ScriptContexts = {};
|
|||
["NavButtonSlider", "chrome://browser/content/NavButtonSlider.js"],
|
||||
["ContextUI", "chrome://browser/content/ContextUI.js"],
|
||||
["FlyoutPanelsUI", "chrome://browser/content/flyoutpanels/FlyoutPanelsUI.js"],
|
||||
["APZCObserver", "chrome://browser/content/apzc.js"],
|
||||
].forEach(function (aScript) {
|
||||
let [name, script] = aScript;
|
||||
XPCOMUtils.defineLazyGetter(window, name, function() {
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
<script type="application/javascript" src="chrome://browser/content/Util.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/input.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/appbar.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/apzc.js"/>
|
||||
<broadcasterset id="broadcasterset">
|
||||
<broadcaster id="bcast_contentShowing" disabled="false"/>
|
||||
<broadcaster id="bcast_urlbarState" mode="editing"/>
|
||||
|
|
|
@ -311,8 +311,15 @@ var TouchModule = {
|
|||
if (this._isCancellable) {
|
||||
// only the first touchmove is cancellable.
|
||||
this._isCancellable = false;
|
||||
if (aEvent.defaultPrevented)
|
||||
if (aEvent.defaultPrevented) {
|
||||
this._isCancelled = true;
|
||||
}
|
||||
// Help out chrome ui elements that want input.js vs. apz scrolling: call
|
||||
// preventDefault when apz is enabled on anything that isn't in the
|
||||
// browser.
|
||||
if (APZCObserver.enabled && aEvent.target.ownerDocument == document) {
|
||||
aEvent.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
if (this._isCancelled)
|
||||
|
@ -352,8 +359,6 @@ var TouchModule = {
|
|||
|
||||
// Let everyone know when mousemove begins a pan
|
||||
if (!oldIsPan && dragData.isPan()) {
|
||||
//this._longClickTimeout.clear();
|
||||
|
||||
let event = document.createEvent("Events");
|
||||
event.initEvent("PanBegin", true, false);
|
||||
this._targetScrollbox.dispatchEvent(event);
|
||||
|
|
Загрузка…
Ссылка в новой задаче