Bug 1249280 - Fix coordinates of APZ-detected gestures when crossing process boundaries. r=kats draft
authorAlexandre Lissy <lissyx@lissyx.dyndns.org>
Fri, 19 Feb 2016 15:19:47 -0500
changeset 332172 67e531d03996292d0d5799261f887451f6806e3a
parent 332162 69ec3dc408a2a720cb2b8210fea33e3504aeec22
child 332173 4f71c3a1174e3e274902fbacb21b4e7a9f37fb2e
push id11183
push userkgupta@mozilla.com
push dateFri, 19 Feb 2016 20:20:03 +0000
reviewerskats
bugs1249280
milestone47.0a1
Bug 1249280 - Fix coordinates of APZ-detected gestures when crossing process boundaries. r=kats MozReview-Commit-ID: 52i7lvAzLDH
dom/ipc/TabParent.h
gfx/layers/ipc/RemoteContentController.cpp
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -491,16 +491,17 @@ public:
   already_AddRefed<nsIWidget> GetWidget() const;
 
   const TabId GetTabId() const
   {
     return mTabId;
   }
 
   LayoutDeviceIntPoint GetChildProcessOffset();
+  CSSPoint AdjustTapToChildWidget(const CSSPoint& aPoint);
 
   /**
    * Native widget remoting protocol for use with windowed plugins with e10s.
    */
   virtual PPluginWidgetParent* AllocPPluginWidgetParent() override;
 
   virtual bool
   DeallocPPluginWidgetParent(PPluginWidgetParent* aActor) override;
@@ -607,18 +608,16 @@ private:
   already_AddRefed<nsFrameLoader>
   GetFrameLoader(bool aUseCachedFrameLoaderAfterDestroy = false) const;
 
   RefPtr<nsIContentParent> mManager;
   void TryCacheDPIAndScale();
 
   nsresult UpdatePosition();
 
-  CSSPoint AdjustTapToChildWidget(const CSSPoint& aPoint);
-
   bool AsyncPanZoomEnabled() const;
 
   // Cached value indicating the docshell active state of the remote browser.
   bool mDocShellIsActive;
 
   // Update state prior to routing an APZ-aware event to the child process.
   // |aOutTargetGuid| will contain the identifier
   // of the APZC instance that handled the event. aOutTargetGuid may be null.
--- a/gfx/layers/ipc/RemoteContentController.cpp
+++ b/gfx/layers/ipc/RemoteContentController.cpp
@@ -97,17 +97,18 @@ RemoteContentController::HandleDoubleTap
     // thread).
     mUILoop->PostTask(
       FROM_HERE,
       NewRunnableMethod(this, &RemoteContentController::HandleDoubleTap,
                         aPoint, aModifiers, aGuid));
     return;
   }
   if (CanSend()) {
-    Unused << SendHandleDoubleTap(aPoint, aModifiers, aGuid);
+    Unused << SendHandleDoubleTap(mBrowserParent->AdjustTapToChildWidget(aPoint),
+            aModifiers, aGuid);
   }
 }
 
 void
 RemoteContentController::HandleSingleTap(const CSSPoint& aPoint,
                                          Modifiers aModifiers,
                                          const ScrollableLayerGuid& aGuid)
 {
@@ -129,18 +130,18 @@ RemoteContentController::HandleSingleTap
     // since the right RenderFrameParent is living in this process.
     frame->TakeFocusForClickFromTap();
     callTakeFocusForClickFromTap = false;
   } else {
     callTakeFocusForClickFromTap = true;
   }
 
   if (CanSend()) {
-    Unused << SendHandleSingleTap(aPoint, aModifiers, aGuid,
-                                  callTakeFocusForClickFromTap);
+    Unused << SendHandleSingleTap(mBrowserParent->AdjustTapToChildWidget(aPoint),
+            aModifiers, aGuid, callTakeFocusForClickFromTap);
   }
 }
 
 void
 RemoteContentController::HandleLongTap(const CSSPoint& aPoint,
                                        Modifiers aModifiers,
                                        const ScrollableLayerGuid& aGuid,
                                        uint64_t aInputBlockId)
@@ -150,17 +151,18 @@ RemoteContentController::HandleLongTap(c
     // thread).
     mUILoop->PostTask(
       FROM_HERE,
       NewRunnableMethod(this, &RemoteContentController::HandleLongTap,
                         aPoint, aModifiers, aGuid, aInputBlockId));
     return;
   }
   if (CanSend()) {
-    Unused << SendHandleLongTap(aPoint, aModifiers, aGuid, aInputBlockId);
+    Unused << SendHandleLongTap(mBrowserParent->AdjustTapToChildWidget(aPoint),
+            aModifiers, aGuid, aInputBlockId);
   }
 }
 
 void
 RemoteContentController::PostDelayedTask(Task* aTask, int aDelayMs)
 {
 #ifdef MOZ_ANDROID_APZ
   AndroidBridge::Bridge()->PostTaskToUiThread(aTask, aDelayMs);