Bug 1041451 - If we have pending response in RecvHandleLongTap, submit this response first. r=kats

This commit is contained in:
Morris Tseng 2014-07-21 20:48:00 +02:00
parent 2f425a219a
commit a584362cb4
2 changed files with 17 additions and 5 deletions

View File

@ -1388,6 +1388,17 @@ TabChild::HasValidInnerSize()
return mHasValidInnerSize;
}
void
TabChild::SendPendingTouchPreventedResponse(bool aPreventDefault,
const ScrollableLayerGuid& aGuid)
{
if (mPendingTouchPreventedResponse) {
MOZ_ASSERT(aGuid == mPendingTouchPreventedGuid);
SendContentReceivedTouch(mPendingTouchPreventedGuid, aPreventDefault);
mPendingTouchPreventedResponse = false;
}
}
#ifdef DEBUG
PContentPermissionRequestChild*
TabChild:: SendPContentPermissionRequestConstructor(PContentPermissionRequestChild* aActor,
@ -1834,6 +1845,8 @@ TabChild::RecvHandleLongTap(const CSSPoint& aPoint, const ScrollableLayerGuid& a
return true;
}
SendPendingTouchPreventedResponse(false, aGuid);
bool eventHandled =
DispatchMouseEvent(NS_LITERAL_STRING("contextmenu"),
APZCCallbackHelper::ApplyCallbackTransform(aPoint, aGuid),
@ -2145,11 +2158,7 @@ TabChild::RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
}
// fall through
case NS_TOUCH_MOVE: {
if (mPendingTouchPreventedResponse) {
MOZ_ASSERT(aGuid == mPendingTouchPreventedGuid);
SendContentReceivedTouch(mPendingTouchPreventedGuid, isTouchPrevented);
mPendingTouchPreventedResponse = false;
}
SendPendingTouchPreventedResponse(isTouchPrevented, aGuid);
break;
}

View File

@ -555,6 +555,9 @@ private:
bool HasValidInnerSize();
void SendPendingTouchPreventedResponse(bool aPreventDefault,
const ScrollableLayerGuid& aGuid);
class CachedFileDescriptorInfo;
class CachedFileDescriptorCallbackRunnable;