mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1255968 - Part 2: Implement puppet widget's HasPendingInputEvent() for interruptible reflow to work in content process. r=bz
--HG-- extra : rebase_source : cea071e17ad620a9a958ff897a1f18db73789977
This commit is contained in:
parent
9c7a4ca7f0
commit
9ea65b71ed
@ -1422,5 +1422,43 @@ PuppetWidget::ZoomToRect(const uint32_t& aPresShellId,
|
||||
mTabChild->ZoomToRect(aPresShellId, aViewId, aRect, aFlags);
|
||||
}
|
||||
|
||||
bool
|
||||
PuppetWidget::HasPendingInputEvent()
|
||||
{
|
||||
if (!mTabChild) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static const IPC::Message::msgid_t kInputEvents[] = {
|
||||
mozilla::dom::PBrowser::Msg_RealMouseMoveEvent__ID,
|
||||
mozilla::dom::PBrowser::Msg_SynthMouseMoveEvent__ID,
|
||||
mozilla::dom::PBrowser::Msg_RealMouseButtonEvent__ID,
|
||||
mozilla::dom::PBrowser::Msg_RealKeyEvent__ID,
|
||||
mozilla::dom::PBrowser::Msg_MouseWheelEvent__ID,
|
||||
mozilla::dom::PBrowser::Msg_RealTouchEvent__ID,
|
||||
mozilla::dom::PBrowser::Msg_RealTouchMoveEvent__ID,
|
||||
mozilla::dom::PBrowser::Msg_RealDragEvent__ID,
|
||||
mozilla::dom::PBrowser::Msg_UpdateDimensions__ID,
|
||||
mozilla::dom::PBrowser::Msg_MouseEvent__ID,
|
||||
mozilla::dom::PBrowser::Msg_KeyEvent__ID
|
||||
};
|
||||
bool ret = false;
|
||||
|
||||
for (IPC::Message::msgid_t e: kInputEvents) {
|
||||
mTabChild->GetIPCChannel()->PeekMessages(
|
||||
e,
|
||||
[&ret](const IPC::Message& aMsg) -> bool {
|
||||
ret = true;
|
||||
return false; // Stop peeking.
|
||||
}
|
||||
);
|
||||
if (ret) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
} // namespace widget
|
||||
} // namespace mozilla
|
||||
|
@ -259,6 +259,9 @@ public:
|
||||
const FrameMetrics::ViewID& aViewId,
|
||||
const CSSRect& aRect,
|
||||
const uint32_t& aFlags) override;
|
||||
|
||||
virtual bool HasPendingInputEvent() override;
|
||||
|
||||
protected:
|
||||
virtual nsresult NotifyIMEInternal(
|
||||
const IMENotification& aIMENotification) override;
|
||||
|
Loading…
Reference in New Issue
Block a user