зеркало из https://github.com/mozilla/gecko-dev.git
Bug 950300 - Cancel APZC panning is the first touchmove is preventDefault'ed. r=kats
This commit is contained in:
Родитель
549b9bddc1
Коммит
88d9b0d654
|
@ -279,7 +279,7 @@ const ContentPanning = {
|
||||||
this._activationTimer.cancel();
|
this._activationTimer.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.panning) {
|
if (this.panning && docShell.asyncPanZoomEnabled === false) {
|
||||||
// Only do this when we're actually executing a pan gesture.
|
// Only do this when we're actually executing a pan gesture.
|
||||||
// Otherwise synthetic mouse events will be canceled.
|
// Otherwise synthetic mouse events will be canceled.
|
||||||
evt.stopPropagation();
|
evt.stopPropagation();
|
||||||
|
|
|
@ -288,6 +288,7 @@ TabChild::TabChild(ContentChild* aManager, const TabContext& aContext, uint32_t
|
||||||
, mOrientation(eScreenOrientation_PortraitPrimary)
|
, mOrientation(eScreenOrientation_PortraitPrimary)
|
||||||
, mUpdateHitRegion(false)
|
, mUpdateHitRegion(false)
|
||||||
, mContextMenuHandled(false)
|
, mContextMenuHandled(false)
|
||||||
|
, mWaitingTouchListeners(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1868,16 +1869,43 @@ TabChild::RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
|
||||||
WidgetTouchEvent localEvent(aEvent);
|
WidgetTouchEvent localEvent(aEvent);
|
||||||
nsEventStatus status = DispatchWidgetEvent(localEvent);
|
nsEventStatus status = DispatchWidgetEvent(localEvent);
|
||||||
|
|
||||||
if (IsAsyncPanZoomEnabled()) {
|
if (!IsAsyncPanZoomEnabled()) {
|
||||||
nsCOMPtr<nsPIDOMWindow> outerWindow = do_GetInterface(mWebNav);
|
|
||||||
nsCOMPtr<nsPIDOMWindow> innerWindow = outerWindow->GetCurrentInnerWindow();
|
|
||||||
|
|
||||||
if (innerWindow && innerWindow->HasTouchEventListeners()) {
|
|
||||||
SendContentReceivedTouch(aGuid, nsIPresShell::gPreventMouseEvents ||
|
|
||||||
localEvent.mFlags.mMultipleActionsPrevented);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
UpdateTapState(localEvent, status);
|
UpdateTapState(localEvent, status);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
nsCOMPtr<nsPIDOMWindow> outerWindow = do_GetInterface(mWebNav);
|
||||||
|
nsCOMPtr<nsPIDOMWindow> innerWindow = outerWindow->GetCurrentInnerWindow();
|
||||||
|
|
||||||
|
if (!innerWindow || !innerWindow->HasTouchEventListeners()) {
|
||||||
|
SendContentReceivedTouch(aGuid, false);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isTouchPrevented = nsIPresShell::gPreventMouseEvents ||
|
||||||
|
localEvent.mFlags.mMultipleActionsPrevented;
|
||||||
|
switch (aEvent.message) {
|
||||||
|
case NS_TOUCH_START: {
|
||||||
|
if (isTouchPrevented) {
|
||||||
|
SendContentReceivedTouch(aGuid, isTouchPrevented);
|
||||||
|
} else {
|
||||||
|
mWaitingTouchListeners = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case NS_TOUCH_MOVE:
|
||||||
|
case NS_TOUCH_END:
|
||||||
|
case NS_TOUCH_CANCEL: {
|
||||||
|
if (mWaitingTouchListeners) {
|
||||||
|
SendContentReceivedTouch(aGuid, isTouchPrevented);
|
||||||
|
mWaitingTouchListeners = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
NS_WARNING("Unknown touch event type");
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -499,6 +499,7 @@ private:
|
||||||
ScreenOrientation mOrientation;
|
ScreenOrientation mOrientation;
|
||||||
bool mUpdateHitRegion;
|
bool mUpdateHitRegion;
|
||||||
bool mContextMenuHandled;
|
bool mContextMenuHandled;
|
||||||
|
bool mWaitingTouchListeners;
|
||||||
|
|
||||||
DISALLOW_EVIL_CONSTRUCTORS(TabChild);
|
DISALLOW_EVIL_CONSTRUCTORS(TabChild);
|
||||||
};
|
};
|
||||||
|
|
Загрузка…
Ссылка в новой задаче