Bug 1177018 - Send mouse move events generated via nsIPresShell::SynthesizeMouseMove() to the child process through a different IPDL message than real mouse move events. r=smaug

This avoids a real event being dropped in favour of a synthesized event via IPDL compression, which is important because synthesized events don't generate 'mousemove' DOM events.

--HG--
extra : rebase_source : 711341f7ae50583498854993028bbd9e1b1299cc
extra : source : c0e8553911e54232f060bbb284f936d81f73f411
This commit is contained in:
Botond Ballo 2015-07-27 18:35:51 -04:00
Родитель 8abc5d1813
Коммит 18f3c094b6
4 изменённых файлов: 20 добавлений и 1 удалений

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

@ -634,6 +634,14 @@ child:
* they are 'compressed' by dumping the oldest one.
*/
RealMouseMoveEvent(WidgetMouseEvent event) compress;
/**
* Mouse move events with |reason == eSynthesized| are sent via a separate
* message because they do not generate DOM 'mousemove' events, and the
* 'compress' attribute on RealMouseMoveEvent() could result in a
* |reason == eReal| event being dropped in favour of an |eSynthesized|
* event, and thus a DOM 'mousemove' event to be lost.
*/
SynthMouseMoveEvent(WidgetMouseEvent event);
RealMouseButtonEvent(WidgetMouseEvent event);
RealKeyEvent(WidgetKeyboardEvent event, MaybeNativeKeyBinding keyBinding);
MouseWheelEvent(WidgetWheelEvent event, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);

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

@ -1856,6 +1856,12 @@ TabChild::RecvRealMouseMoveEvent(const WidgetMouseEvent& event)
return RecvRealMouseButtonEvent(event);
}
bool
TabChild::RecvSynthMouseMoveEvent(const WidgetMouseEvent& event)
{
return RecvRealMouseButtonEvent(event);
}
bool
TabChild::RecvRealMouseButtonEvent(const WidgetMouseEvent& event)
{

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

@ -334,6 +334,7 @@ public:
const int32_t& aModifiers,
const bool& aIgnoreRootScrollFrame) override;
virtual bool RecvRealMouseMoveEvent(const mozilla::WidgetMouseEvent& event) override;
virtual bool RecvSynthMouseMoveEvent(const mozilla::WidgetMouseEvent& event) override;
virtual bool RecvRealMouseButtonEvent(const mozilla::WidgetMouseEvent& event) override;
virtual bool RecvRealDragEvent(const WidgetDragEvent& aEvent,
const uint32_t& aDragAction,

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

@ -1381,7 +1381,11 @@ bool TabParent::SendRealMouseEvent(WidgetMouseEvent& event)
}
if (NS_MOUSE_MOVE == event.mMessage) {
return SendRealMouseMoveEvent(event);
if (event.reason == WidgetMouseEvent::eSynthesized) {
return SendSynthMouseMoveEvent(event);
} else {
return SendRealMouseMoveEvent(event);
}
}
return SendRealMouseButtonEvent(event);
}