Backed out changeset 3e2a441357ca (bug 1351148)

This commit is contained in:
Stone Shih 2017-08-11 15:18:57 +08:00
Родитель e34132948b
Коммит 9d71d0a026
2 изменённых файлов: 1 добавлений и 29 удалений

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

@ -173,7 +173,6 @@ TabParent::TabParent(nsIContentParent* aManager,
, mHasPresented(false)
, mHasBeforeUnload(false)
, mIsReadyToHandleInputEvents(false)
, mIsMouseEnterIntoWidgetEventSuppressed(false)
{
MOZ_ASSERT(aManager);
}
@ -1093,7 +1092,7 @@ TabParent::SendKeyEvent(const nsAString& aType,
void
TabParent::SendRealMouseEvent(WidgetMouseEvent& aEvent)
{
if (mIsDestroyed) {
if (mIsDestroyed || !mIsReadyToHandleInputEvents) {
return;
}
aEvent.mRefPoint += GetChildProcessOffset();
@ -1114,33 +1113,11 @@ TabParent::SendRealMouseEvent(WidgetMouseEvent& aEvent)
mTabSetsCursor = false;
}
}
if (!mIsReadyToHandleInputEvents) {
if (eMouseEnterIntoWidget == aEvent.mMessage) {
MOZ_ASSERT(!mIsMouseEnterIntoWidgetEventSuppressed);
mIsMouseEnterIntoWidgetEventSuppressed = true;
} else if (eMouseExitFromWidget == aEvent.mMessage) {
MOZ_ASSERT(mIsMouseEnterIntoWidgetEventSuppressed);
mIsMouseEnterIntoWidgetEventSuppressed = false;
}
return;
}
ScrollableLayerGuid guid;
uint64_t blockId;
ApzAwareEventRoutingToChild(&guid, &blockId, nullptr);
if (mIsMouseEnterIntoWidgetEventSuppressed) {
// In the case that the TabParent suppressed the eMouseEnterWidget event due
// to its corresponding TabChild wasn't ready to handle it, we have to
// resend it when the TabChild is ready.
mIsMouseEnterIntoWidgetEventSuppressed = false;
WidgetMouseEvent localEvent(aEvent);
localEvent.mMessage = eMouseEnterIntoWidget;
DebugOnly<bool> ret = SendRealMouseButtonEvent(localEvent, guid, blockId);
NS_WARNING_ASSERTION(ret, "SendRealMouseButtonEvent(eMouseEnterIntoWidget) failed");
MOZ_ASSERT(!ret || localEvent.HasBeenPostedToRemoteProcess());
}
if (eMouseMove == aEvent.mMessage) {
if (aEvent.mReason == WidgetMouseEvent::eSynthesized) {
DebugOnly<bool> ret = SendSynthMouseMoveEvent(aEvent, guid, blockId);

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

@ -786,11 +786,6 @@ private:
// True when the remote browser is created and ready to handle input events.
bool mIsReadyToHandleInputEvents;
// True if we suppress the eMouseEnterIntoWidget event due to the TabChild was
// not ready to handle it. We will resend it when the next time we fire a
// mouse event and the TabChild is ready.
bool mIsMouseEnterIntoWidgetEventSuppressed;
public:
static TabParent* GetTabParentFromLayersId(uint64_t aLayersId);
};