Backed out 2 changesets (bug 1131695) for mochitest-1 failures on a CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Fri, 13 Feb 2015 12:43:20 -0800
changeset 256290 dc2d6f67c2319f32d12d35eb763713e0232d621e
parent 256289 b347698b4d7b031bb11b10990b27fca6627340c5
child 256291 437bf0790669ee4b0b1e5dd193c1b5f7a1923375
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1131695
milestone38.0a1
backs out13af514d6aea7bded99cf71fe219ba2621a9b263
6823625f20424fdeb060cc24607c1efb6fb3b8c3
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 2 changesets (bug 1131695) for mochitest-1 failures on a CLOSED TREE Backed out changeset 13af514d6aea (bug 1131695) Backed out changeset 6823625f2042 (bug 1131695)
dom/browser-element/BrowserElementParent.js
dom/interfaces/base/nsITabParent.idl
dom/ipc/TabParent.cpp
dom/ipc/TabParent.h
--- a/dom/browser-element/BrowserElementParent.js
+++ b/dom/browser-element/BrowserElementParent.js
@@ -533,34 +533,17 @@ BrowserElementParent.prototype = {
     if (!this._isAlive()) {
       throw Components.Exception("Dead content process",
                                  Cr.NS_ERROR_DOM_INVALID_STATE_ERR);
     }
 
     return this._frameLoader.visible;
   },
 
-  getChildProcessOffset: function() {
-    let offset = { x: 0, y: 0 };
-    let tabParent = this._frameLoader.tabParent;
-    if (tabParent) {
-      let offsetX = {};
-      let offsetY = {};
-      tabParent.getChildProcessOffset(offsetX, offsetY);
-      offset.x = offsetX.value;
-      offset.y = offsetY.value;
-    }
-    return offset;
-  },
-
   sendMouseEvent: defineNoReturnMethod(function(type, x, y, button, clickCount, modifiers) {
-    let offset = this.getChildProcessOffset();
-    x += offset.x;
-    y += offset.y;
-
     this._sendAsyncMsg("send-mouse-event", {
       "type": type,
       "x": x,
       "y": y,
       "button": button,
       "clickCount": clickCount,
       "modifiers": modifiers
     });
@@ -578,23 +561,16 @@ BrowserElementParent.prototype = {
                                  touchesY,
                                  radiisX,
                                  radiisY,
                                  rotationAngles,
                                  forces,
                                  count,
                                  modifiers);
     } else {
-      let offset = this.getChildProcessOffset();
-      for (var i = 0; i < touchesX.length; i++) {
-        touchesX[i] += offset.x;
-      }
-      for (var i = 0; i < touchesY.length; i++) {
-        touchesY[i] += offset.y;
-      }
       this._sendAsyncMsg("send-touch-event", {
         "type": type,
         "identifiers": identifiers,
         "touchesX": touchesX,
         "touchesY": touchesY,
         "radiisX": radiisX,
         "radiisY": radiisY,
         "rotationAngles": rotationAngles,
--- a/dom/interfaces/base/nsITabParent.idl
+++ b/dom/interfaces/base/nsITabParent.idl
@@ -1,29 +1,27 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #include "domstubs.idl"
 
-[scriptable, uuid(b19038ba-0d75-40d2-be35-742e26d33bf9)]
+[scriptable, uuid(30361a5b-a3b8-4dbc-b464-e08761abb123)]
 interface nsITabParent : nsISupports
 {
   void injectTouchEvent(in AString aType,
                         [array, size_is(count)] in uint32_t aIdentifiers,
                         [array, size_is(count)] in int32_t aXs,
                         [array, size_is(count)] in int32_t aYs,
                         [array, size_is(count)] in uint32_t aRxs,
                         [array, size_is(count)] in uint32_t aRys,
                         [array, size_is(count)] in float aRotationAngles,
                         [array, size_is(count)] in float aForces,
                         in uint32_t count,
                         in long aModifiers);
 
-  void getChildProcessOffset(out int32_t aCssX, out int32_t aCssY);
-
   readonly attribute boolean useAsyncPanZoom;
 
   void setIsDocShellActive(in bool aIsActive);
 
   readonly attribute uint64_t tabId;
 };
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -1217,31 +1217,33 @@ bool TabParent::SendRealMouseEvent(Widge
     return false;
   }
   if (!MapEventCoordinatesForChildProcess(&event)) {
     return false;
   }
   return PBrowserParent::SendRealMouseEvent(event);
 }
 
-LayoutDeviceToCSSScale
-TabParent::GetLayoutDeviceToCSSScale()
+CSSPoint TabParent::AdjustTapToChildWidget(const CSSPoint& aPoint)
 {
   nsCOMPtr<nsIContent> content = do_QueryInterface(mFrameElement);
-  nsIDocument* doc = (content ? content->OwnerDoc() : nullptr);
-  nsIPresShell* shell = (doc ? doc->GetShell() : nullptr);
-  nsPresContext* ctx = (shell ? shell->GetPresContext() : nullptr);
-  return LayoutDeviceToCSSScale(ctx
-    ? (float)ctx->AppUnitsPerDevPixel() / nsPresContext::AppUnitsPerCSSPixel()
-    : 0.0f);
-}
-
-CSSPoint TabParent::AdjustTapToChildWidget(const CSSPoint& aPoint)
-{
-  return aPoint + (LayoutDevicePoint(mChildProcessOffsetAtTouchStart) * GetLayoutDeviceToCSSScale());
+
+  if (!content || !content->OwnerDoc()) {
+    return aPoint;
+  }
+
+  nsIDocument* doc = content->OwnerDoc();
+  if (!doc || !doc->GetShell()) {
+    return aPoint;
+  }
+  nsPresContext* presContext = doc->GetShell()->GetPresContext();
+
+  return aPoint + CSSPoint(
+    presContext->DevPixelsToFloatCSSPixels(mChildProcessOffsetAtTouchStart.x),
+    presContext->DevPixelsToFloatCSSPixels(mChildProcessOffsetAtTouchStart.y));
 }
 
 bool TabParent::SendHandleSingleTap(const CSSPoint& aPoint, const ScrollableLayerGuid& aGuid)
 {
   if (mIsDestroyed) {
     return false;
   }
 
@@ -1817,28 +1819,16 @@ TabParent::RecvEnableDisableCommands(con
     remoteBrowser->EnableDisableCommands(aAction,
                                          aEnabledCommands.Length(), enabledCommands,
                                          aDisabledCommands.Length(), disabledCommands);
   }
 
   return true;
 }
 
-NS_IMETHODIMP
-TabParent::GetChildProcessOffset(int32_t* aOutCssX, int32_t* aOutCssY)
-{
-  NS_ENSURE_ARG(aOutCssX);
-  NS_ENSURE_ARG(aOutCssY);
-  CSSPoint offset = LayoutDevicePoint(LayoutDeviceIntPoint::FromUntyped(GetChildProcessOffset()))
-      * GetLayoutDeviceToCSSScale();
-  *aOutCssX = offset.x;
-  *aOutCssY = offset.y;
-  return NS_OK;
-}
-
 nsIntPoint
 TabParent::GetChildProcessOffset()
 {
   // The "toplevel widget" in child processes is always at position
   // 0,0.  Map the event coordinates to match that.
 
   nsIntPoint offset(0, 0);
   nsRefPtr<nsFrameLoader> frameLoader = GetFrameLoader();
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -262,17 +262,16 @@ public:
                               APZStateChange aChange,
                               int aArg);
     void Activate();
     void Deactivate();
 
     bool MapEventCoordinatesForChildProcess(mozilla::WidgetEvent* aEvent);
     void MapEventCoordinatesForChildProcess(const LayoutDeviceIntPoint& aOffset,
                                             mozilla::WidgetEvent* aEvent);
-    LayoutDeviceToCSSScale GetLayoutDeviceToCSSScale();
 
     virtual bool RecvRequestNativeKeyBindings(const mozilla::WidgetKeyboardEvent& aEvent,
                                               MaybeNativeKeyBinding* aBindings) MOZ_OVERRIDE;
 
     void SendMouseEvent(const nsAString& aType, float aX, float aY,
                         int32_t aButton, int32_t aClickCount,
                         int32_t aModifiers, bool aIgnoreRootScrollFrame);
     void SendKeyEvent(const nsAString& aType, int32_t aKeyCode,