Bug 965805 - Calling nsITabParent::InjectTouchEvent can results into an out of sync TabParent::mEventCaptureDepth. r=kats

This commit is contained in:
Vivien Nicolas 2014-02-15 01:45:44 +01:00
Родитель 7243523ef2
Коммит 36d071027d
1 изменённых файлов: 10 добавлений и 0 удалений

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

@ -1926,6 +1926,11 @@ TabParent::GetLoadContext()
return loadContext.forget();
}
/* Be careful if you call this method while proceding a real touch event. For
* example sending a touchstart during a real touchend may results into
* a busted mEventCaptureDepth and following touch events may not do what you
* expect.
*/
NS_IMETHODIMP
TabParent::InjectTouchEvent(const nsAString& aType,
uint32_t* aIdentifiers,
@ -1969,6 +1974,11 @@ TabParent::InjectTouchEvent(const nsAString& aType,
event.touches.AppendElement(t);
}
if ((msg == NS_TOUCH_END || msg == NS_TOUCH_CANCEL) && sEventCapturer) {
WidgetGUIEvent* guiEvent = event.AsGUIEvent();
TryCapture(*guiEvent);
}
SendRealTouchEvent(event);
return NS_OK;
}