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

View File

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