Bug 1075670 - [e10s] event.screenX and event.screenY is wrong
☠☠ backed out by 49b400b2463f ☠ ☠
authorDavid Parks <davidp99@gmail.com>
Wed, 04 Feb 2015 04:22:30 -0800
changeset 246168 d3ac4fd82311390e8fad63f10040f3c85513fb99
parent 246167 8b72b1201661415e30944aec70d08fbe712df2eb
child 246169 4d34eb58c46d61e077f00f1365a3641b09bf8985
push id7677
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 18:11:24 +0000
treeherdermozilla-aurora@f531d838c055 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1075670
milestone38.0a1
Bug 1075670 - [e10s] event.screenX and event.screenY is wrong mapScreenCoordinatesFromContent is now wrong, unnecessary, and gone.
browser/base/content/tabbrowser.xml
toolkit/components/satchel/AutoCompleteE10S.jsm
toolkit/content/widgets/browser.xml
toolkit/content/widgets/remote-browser.xml
toolkit/modules/SelectParentHelper.jsm
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -3197,18 +3197,17 @@
                                           browser: browser,
                                           editFlags: aMessage.data.editFlags,
                                           spellInfo: spellInfo,
                                           principal: aMessage.data.principal,
                                           customMenuItems: aMessage.data.customMenuItems,
                                           addonInfo: aMessage.data.addonInfo };
               let popup = browser.ownerDocument.getElementById("contentAreaContextMenu");
               let event = gContextMenuContentData.event;
-              let pos = browser.mapScreenCoordinatesFromContent(event.screenX, event.screenY);
-              popup.openPopupAtScreen(pos.x, pos.y, true);
+              popup.openPopupAtScreen(event.screenX, event.screenY, true);
               break;
             }
             case "DOMWebNotificationClicked": {
               let tab = this.getTabForBrowser(browser);
               if (!tab)
                 return;
               this.selectedTab = tab;
               window.focus();
--- a/toolkit/components/satchel/AutoCompleteE10S.jsm
+++ b/toolkit/components/satchel/AutoCompleteE10S.jsm
@@ -76,19 +76,18 @@ this.AutoCompleteE10S = {
   },
 
   _initPopup: function(browserWindow, rect) {
     this.browser = browserWindow.gBrowser.selectedBrowser;
     this.popup = this.browser.autoCompletePopup;
     this.popup.hidden = false;
     this.popup.setAttribute("width", rect.width);
 
-    let {x, y} = this.browser.mapScreenCoordinatesFromContent(rect.left, rect.top + rect.height);
-    this.x = x;
-    this.y = y;
+    this.x = rect.left;
+    this.y = rect.top + rect.height;
   },
 
   _showPopup: function(results) {
     AutoCompleteE10SView.clearResults();
 
     let resultsArray = [];
     let count = results.matchCount;
     for (let i = 0; i < count; i++) {
--- a/toolkit/content/widgets/browser.xml
+++ b/toolkit/content/widgets/browser.xml
@@ -863,18 +863,17 @@
               }
               this.updateBlockedPopups();
               break;
             }
             case "Autoscroll:Start": {
               if (!this.autoscrollEnabled) {
                 return false;
               }
-              let pos = this.mapScreenCoordinatesFromContent(data.screenX, data.screenY);
-              this.startScroll(data.scrolldir, pos.x, pos.y);
+              this.startScroll(data.scrolldir, data.screenX, data.screenY);
               return true;
             }
             case "Autoscroll:Cancel":
               this._autoScrollPopup.hidePopup();
               break;
           }
         ]]></body>
       </method>
@@ -1045,35 +1044,16 @@
                 break;
               }
             }
           }
         ]]>
         </body>
       </method>
 
-      <!--
-        For out-of-process code, event.screen[XY] is relative to the
-        left/top of the content view. For in-process code,
-        event.screen[XY] is relative to the left/top of the screen. We
-        use this method to map screen coordinates received from a
-        (possibly out-of-process) <browser> element to coordinates
-        that are relative to the screen. This code handles the
-        in-process case, where we return the coordinates unchanged.
-      -->
-      <method name="mapScreenCoordinatesFromContent">
-        <parameter name="aScreenX"/>
-        <parameter name="aScreenY"/>
-        <body>
-        <![CDATA[
-          return { x: aScreenX, y: aScreenY };
-        ]]>
-        </body>
-      </method>
-
       <method name="swapDocShells">
         <parameter name="aOtherBrowser"/>
         <body>
         <![CDATA[
           // We need to swap fields that are tied to our docshell or related to
           // the loaded page
           // Fields which are built as a result of notifactions (pageshow/hide,
           // DOMLinkAdded/Removed, onStateChange) should not be swapped here,
--- a/toolkit/content/widgets/remote-browser.xml
+++ b/toolkit/content/widgets/remote-browser.xml
@@ -380,37 +380,16 @@
           if (aTopic == "ask-children-to-exit-fullscreen") {
             if (aSubject == window.document) {
               this.messageManager.sendAsyncMessage("DOMFullscreen:ChildrenMustExit");
             }
           }
         ]]></body>
       </method>
 
-      <!--
-        For out-of-process code, event.screen[XY] is relative to the
-        left/top of the content view. For in-process code,
-        event.screen[XY] is relative to the left/top of the screen. We
-        use this method to map screen coordinates received from a
-        (possibly out-of-process) <browser> element to coordinates
-        that are relative to the screen. This code handles the
-        out-of-process case, where we need to translate by the screen
-        position of the <browser> element.
-      -->
-      <method name="mapScreenCoordinatesFromContent">
-        <parameter name="aScreenX"/>
-        <parameter name="aScreenY"/>
-        <body>
-        <![CDATA[
-          return { x: aScreenX + this.boxObject.screenX,
-                   y: aScreenY + this.boxObject.screenY };
-        ]]>
-        </body>
-      </method>
-
       <method name="enableDisableCommands">
         <parameter name="aAction"/>
         <parameter name="aEnabledLength"/>
         <parameter name="aEnabledCommands"/>
         <parameter name="aDisabledLength"/>
         <parameter name="aDisabledCommands"/>
         <body>
           if (this._controller) {
--- a/toolkit/modules/SelectParentHelper.jsm
+++ b/toolkit/modules/SelectParentHelper.jsm
@@ -23,18 +23,17 @@ this.SelectParentHelper = {
     menulist.selectedIndex = selectedIndex;
   },
 
   open: function(browser, menulist, rect) {
     menulist.hidden = false;
     currentBrowser = browser;
     this._registerListeners(menulist.menupopup);
 
-    let {x, y} = browser.mapScreenCoordinatesFromContent(rect.left, rect.top + rect.height);
-    menulist.menupopup.openPopupAtScreen(x, y);
+    menulist.menupopup.openPopupAtScreen(rect.left, rect.top + rect.height);
     menulist.selectedItem.scrollIntoView();
   },
 
   hide: function(menulist) {
     menulist.menupopup.hidePopup();
   },
 
   handleEvent: function(event) {