Bug 927033 - Dispatch touchcancel to APZC when content consumes touch input [r=mbrubeck]

This commit is contained in:
Jim Mathies 2013-11-07 13:12:53 -08:00
Родитель 5c9542d62e
Коммит 913257774e
1 изменённых файлов: 9 добавлений и 5 удалений

Просмотреть файл

@ -1155,6 +1155,7 @@ MetroInput::DeliverNextQueuedTouchEvent()
// the touch block for content.
if (mContentConsumingTouch) {
mWidget->ApzContentConsumingTouch();
DispatchTouchCancel(event);
} else {
mWidget->ApzContentIgnoringTouch();
}
@ -1199,8 +1200,7 @@ MetroInput::DispatchTouchCancel(WidgetTouchEvent* aEvent)
MOZ_ASSERT(aEvent);
// Send a touchcancel for each pointer id we have a corresponding start
// for. Note we can't rely on mTouches here since touchends remove points
// from it. The only time we end up in here is if the apz is consuming
// events, so this array shouldn't be very large.
// from it.
WidgetTouchEvent touchEvent(true, NS_TOUCH_CANCEL, mWidget.Get());
nsTArray< nsRefPtr<dom::Touch> >& touches = aEvent->touches;
for (uint32_t i = 0; i < touches.Length(); ++i) {
@ -1218,9 +1218,13 @@ MetroInput::DispatchTouchCancel(WidgetTouchEvent* aEvent)
if (!touchEvent.touches.Length()) {
return;
}
DUMP_TOUCH_IDS("DOM(4)", &touchEvent);
mWidget->DispatchEvent(&touchEvent, sThrowawayStatus);
if (mContentConsumingTouch) {
DUMP_TOUCH_IDS("APZC(3)", &touchEvent);
mWidget->ApzReceiveInputEvent(&touchEvent);
} else {
DUMP_TOUCH_IDS("DOM(5)", &touchEvent);
mWidget->DispatchEvent(&touchEvent, sThrowawayStatus);
}
}
void