Bug 964261 - Declare a widget to events created by TabParent::InjectTouchEvent. r=kats

This commit is contained in:
Vivien Nicolas 2014-01-28 12:42:44 +01:00
Родитель e001a1fb17
Коммит ee9dd904f4
1 изменённых файлов: 11 добавлений и 1 удалений

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

@ -1916,7 +1916,12 @@ TabParent::InjectTouchEvent(const nsAString& aType,
return NS_ERROR_FAILURE;
}
WidgetTouchEvent event(true, msg, nullptr);
nsCOMPtr<nsIWidget> widget = GetWidget();
if (!widget) {
return NS_ERROR_FAILURE;
}
WidgetTouchEvent event(true, msg, widget);
event.modifiers = aModifiers;
event.time = PR_IntervalNow();
@ -1927,6 +1932,11 @@ TabParent::InjectTouchEvent(const nsAString& aType,
nsIntPoint(aRxs[i], aRys[i]),
aRotationAngles[i],
aForces[i]);
// Consider all injected touch events as changedTouches. For more details
// about the meaning of changedTouches for each event, see
// https://developer.mozilla.org/docs/Web/API/TouchEvent.changedTouches
t->mChanged = true;
event.touches.AppendElement(t);
}