зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 8a06f8cd41a9 (bug 1037066) for regressions: bug 1055214, bug 1049250, bug 1055203.
This commit is contained in:
Родитель
63152eee22
Коммит
f6cc8801a7
|
@ -196,29 +196,8 @@ UserInputData::DOMModifiers() const
|
|||
}
|
||||
|
||||
static void
|
||||
sendMouseEvent(UserInputData& data, nsEventStatus status)
|
||||
sendMouseEvent(uint32_t msg, UserInputData& data, bool forwardToChildren)
|
||||
{
|
||||
int32_t action = data.action & AMOTION_EVENT_ACTION_MASK;
|
||||
uint32_t msg;
|
||||
switch (action) {
|
||||
case AMOTION_EVENT_ACTION_DOWN:
|
||||
msg = NS_MOUSE_BUTTON_DOWN;
|
||||
break;
|
||||
case AMOTION_EVENT_ACTION_POINTER_DOWN:
|
||||
case AMOTION_EVENT_ACTION_POINTER_UP:
|
||||
case AMOTION_EVENT_ACTION_MOVE:
|
||||
case AMOTION_EVENT_ACTION_HOVER_MOVE:
|
||||
msg = NS_MOUSE_MOVE;
|
||||
break;
|
||||
case AMOTION_EVENT_ACTION_OUTSIDE:
|
||||
case AMOTION_EVENT_ACTION_CANCEL:
|
||||
case AMOTION_EVENT_ACTION_UP:
|
||||
msg = NS_MOUSE_BUTTON_UP;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
WidgetMouseEvent event(true, msg, nullptr,
|
||||
WidgetMouseEvent::eReal, WidgetMouseEvent::eNormal);
|
||||
|
||||
|
@ -231,7 +210,7 @@ sendMouseEvent(UserInputData& data, nsEventStatus status)
|
|||
event.clickCount = 1;
|
||||
event.modifiers = data.DOMModifiers();
|
||||
|
||||
event.mFlags.mNoCrossProcessBoundaryForwarding = status == nsEventStatus_eConsumeNoDefault;
|
||||
event.mFlags.mNoCrossProcessBoundaryForwarding = !forwardToChildren;
|
||||
|
||||
nsWindow::DispatchInputEvent(event);
|
||||
}
|
||||
|
@ -788,30 +767,35 @@ GeckoInputDispatcher::dispatchOnce()
|
|||
if (mEnabledUniformityInfo) {
|
||||
printUniformityInfo(data);
|
||||
}
|
||||
if (!captured) {
|
||||
sendMouseEvent(data, status);
|
||||
if (captured) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (action == AMOTION_EVENT_ACTION_DOWN ||
|
||||
action == AMOTION_EVENT_ACTION_POINTER_DOWN) {
|
||||
// Bug 1037066: Simulate a touchmove/mousemove event pair at the
|
||||
// same spot as the touchstart/mousedown pair, but immediately after
|
||||
// it. This allows content to preventDefault the first touchmove in
|
||||
// a timely manner, even if the user keeps their finger stationary
|
||||
// after the touchstart. The ultimate end goal here is to allow APZ
|
||||
// to receive a prevent-default=yes|no message ASAP.
|
||||
UserInputData simulatedMoveEvent(data);
|
||||
simulatedMoveEvent.action &= ~AMOTION_EVENT_ACTION_MASK;
|
||||
simulatedMoveEvent.action |= AMOTION_EVENT_ACTION_MOVE;
|
||||
|
||||
bool captured;
|
||||
status = sendTouchEvent(simulatedMoveEvent, &captured);
|
||||
if (!captured) {
|
||||
sendMouseEvent(simulatedMoveEvent, status);
|
||||
uint32_t msg;
|
||||
switch (action) {
|
||||
case AMOTION_EVENT_ACTION_DOWN:
|
||||
msg = NS_MOUSE_BUTTON_DOWN;
|
||||
break;
|
||||
case AMOTION_EVENT_ACTION_POINTER_DOWN:
|
||||
case AMOTION_EVENT_ACTION_POINTER_UP:
|
||||
case AMOTION_EVENT_ACTION_MOVE:
|
||||
case AMOTION_EVENT_ACTION_HOVER_MOVE:
|
||||
msg = NS_MOUSE_MOVE;
|
||||
break;
|
||||
case AMOTION_EVENT_ACTION_OUTSIDE:
|
||||
case AMOTION_EVENT_ACTION_CANCEL:
|
||||
case AMOTION_EVENT_ACTION_UP:
|
||||
msg = NS_MOUSE_BUTTON_UP;
|
||||
break;
|
||||
default:
|
||||
msg = NS_EVENT_NULL;
|
||||
break;
|
||||
}
|
||||
if (msg != NS_EVENT_NULL) {
|
||||
sendMouseEvent(msg, data,
|
||||
status != nsEventStatus_eConsumeNoDefault);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case UserInputData::KEY_DATA: {
|
||||
|
|
Загрузка…
Ссылка в новой задаче