Bug 1306644 - Have TabParent call TakeFocusForClickFromTap rather than doing it over a sync IPC roundtrip. r?dvander
MozReview-Commit-ID: 2MvglXBCmOI
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -1773,19 +1773,16 @@ TabChild::RecvHandleTap(const GeckoConte
if (!presShell->GetPresContext()) {
return true;
}
CSSToLayoutDeviceScale scale(presShell->GetPresContext()->CSSToDevPixelScale());
CSSPoint point = APZCCallbackHelper::ApplyCallbackTransform(aPoint / scale, aGuid);
switch (aType) {
case GeckoContentController::TapType::eSingleTap:
- if (mRemoteFrame) {
- mRemoteFrame->SendTakeFocusForClickFromTap();
- }
if (mGlobal && mTabChildGlobal) {
mAPZEventState->ProcessSingleTap(point, scale, aModifiers, aGuid);
}
break;
case GeckoContentController::TapType::eDoubleTap:
HandleDoubleTap(point, aModifiers, aGuid);
break;
case GeckoContentController::TapType::eLongTap:
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -1691,16 +1691,19 @@ TabParent::SendHandleTap(TapType aType,
const LayoutDevicePoint& aPoint,
Modifiers aModifiers,
const ScrollableLayerGuid& aGuid,
uint64_t aInputBlockId)
{
if (mIsDestroyed) {
return false;
}
+ if (aType == TapType::eSingleTap && GetRenderFrame()) {
+ GetRenderFrame()->TakeFocusForClickFromTap();
+ }
LayoutDeviceIntPoint offset = GetChildProcessOffset();
return PBrowserParent::SendHandleTap(aType, aPoint + offset, aModifiers, aGuid,
aInputBlockId);
}
bool
TabParent::RecvSyncMessage(const nsString& aMessage,
const ClonedMessageData& aData,
--- a/layout/ipc/PRenderFrame.ipdl
+++ b/layout/ipc/PRenderFrame.ipdl
@@ -27,15 +27,13 @@ sync protocol PRenderFrame
{
manager PBrowser;
parent:
async NotifyCompositorTransaction();
async UpdateHitRegion(nsRegion aRegion);
- sync TakeFocusForClickFromTap();
-
async __delete__();
};
} // namespace layout
} // namespace mozilla
--- a/layout/ipc/RenderFrameParent.cpp
+++ b/layout/ipc/RenderFrameParent.cpp
@@ -321,23 +321,16 @@ RenderFrameParent::TakeFocusForClickFrom
if (!element) {
return;
}
fm->SetFocus(element, nsIFocusManager::FLAG_BYMOUSE |
nsIFocusManager::FLAG_BYTOUCH |
nsIFocusManager::FLAG_NOSCROLL);
}
-bool
-RenderFrameParent::RecvTakeFocusForClickFromTap()
-{
- TakeFocusForClickFromTap();
- return true;
-}
-
void
RenderFrameParent::EnsureLayersConnected()
{
RefPtr<LayerManager> lm = GetFrom(mFrameLoader);
if (!lm) {
return;
}
--- a/layout/ipc/RenderFrameParent.h
+++ b/layout/ipc/RenderFrameParent.h
@@ -88,18 +88,16 @@ public:
protected:
void ActorDestroy(ActorDestroyReason why) override;
virtual bool RecvNotifyCompositorTransaction() override;
virtual bool RecvUpdateHitRegion(const nsRegion& aRegion) override;
- virtual bool RecvTakeFocusForClickFromTap() override;
-
private:
void TriggerRepaint();
void DispatchEventForPanZoomController(const InputEvent& aEvent);
uint64_t GetLayerTreeId() const;
// When our child frame is pushing transactions directly to the
// compositor, this is the ID of its layer tree in the compositor's