Bug 828367 - APZC should not perform scrolling if BES detects panning distance is too small. r=cjones.

This commit is contained in:
Shih-Chiang Chien 2013-01-11 11:02:02 +01:00
parent 3a141ce4b7
commit 2c527faa56
2 changed files with 11 additions and 4 deletions

View File

@ -233,10 +233,19 @@ const ContentPanning = {
}
let isPan = KineticPanning.isPan();
if (!isPan) {
// If panning distance is not large enough, both BES and APZC
// should not perform scrolling
evt.preventDefault();
return;
}
let isScroll = this.scrollCallback(delta.scale(-1));
if (this.detectingScrolling) {
this.detectingScrolling = false;
// Stop async-pan-zooming if the user is panning the subframe.
if (isPan) {
if (isScroll) {
// We're going to drive synchronously scrolling an inner frame.
Services.obs.notifyObservers(docShell, 'cancel-default-pan-zoom', null);
} else {
@ -246,8 +255,6 @@ const ContentPanning = {
}
}
this.scrollCallback(delta.scale(-1));
// If a pan action happens, cancel the active state of the
// current target.
if (!this.panning && isPan) {

View File

@ -1421,7 +1421,7 @@ void AsyncPanZoomController::ContentReceivedTouch(bool aPreventDefault) {
while (!mTouchQueue.IsEmpty()) {
// we need to reset mDelayPanning before handling scrolling gesture.
if (mTouchQueue[0].mType == MultiTouchInput::MULTITOUCH_MOVE) {
if (!aPreventDefault && mTouchQueue[0].mType == MultiTouchInput::MULTITOUCH_MOVE) {
mDelayPanning = false;
}
if (!aPreventDefault) {