Bug 1542193 - Unify handling of e10s and non-e10s Forms:ShowDropDown messages. r=mconley a=pascalc DEVEDITION_67_0b10_BUILD1 DEVEDITION_67_0b10_RELEASE FIREFOX_67_0b10_BUILD1 FIREFOX_67_0b10_RELEASE
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 08 Apr 2019 18:22:20 +0000
changeset 526129 03e1b51654e2255fb61a37bb02ed94a7d0637178
parent 526128 f6f8de091b65274d5d6cf6bd59ff48a04dd77c02
child 526130 83812aa57c1dae687aeb0acf6e620d8022fcc7b4
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley, pascalc
bugs1542193
milestone67.0
Bug 1542193 - Unify handling of e10s and non-e10s Forms:ShowDropDown messages. r=mconley a=pascalc I assume this was an artifact of when this was done with XBL. Depends on D26517 Differential Revision: https://phabricator.services.mozilla.com/D26518
toolkit/content/widgets/browser-custom-element.js
--- a/toolkit/content/widgets/browser-custom-element.js
+++ b/toolkit/content/widgets/browser-custom-element.js
@@ -1260,18 +1260,23 @@ class MozBrowser extends MozElementMixin
         {
           if (!this._selectParentHelper) {
             this._selectParentHelper =
               ChromeUtils.import("resource://gre/modules/SelectParentHelper.jsm", {}).SelectParentHelper;
           }
 
           let menulist = document.getElementById(this.getAttribute("selectmenulist"));
           menulist.menupopup.style.direction = data.style.direction;
+
+          let useFullZoom = !this.isRemoteBrowser ||
+                            Services.prefs.getBoolPref("browser.zoom.full") ||
+                            this.isSyntheticDocument;
+          let zoom = useFullZoom ? this._fullZoom : this._textZoom;
           this._selectParentHelper.populate(menulist, data.options.options,
-            data.options.uniqueStyles, data.selectedIndex, this._fullZoom,
+            data.options.uniqueStyles, data.selectedIndex, zoom,
             data.defaultStyle, data.style);
           this._selectParentHelper.open(this, menulist, data.rect, data.isOpenedViaTouch);
           break;
         }
 
       case "Forms:HideDropDown":
         {
           if (this._selectParentHelper) {
@@ -1300,35 +1305,16 @@ class MozBrowser extends MozElementMixin
         break;
       case "ImageDocumentLoaded":
         this._imageDocument = {
           width: data.width,
           height: data.height,
         };
         break;
 
-      case "Forms:ShowDropDown":
-        {
-          if (!this._selectParentHelper) {
-            this._selectParentHelper =
-              ChromeUtils.import("resource://gre/modules/SelectParentHelper.jsm", {}).SelectParentHelper;
-          }
-
-          let menulist = document.getElementById(this.getAttribute("selectmenulist"));
-          menulist.menupopup.style.direction = data.style.direction;
-
-          let zoom = Services.prefs.getBoolPref("browser.zoom.full") ||
-            this.isSyntheticDocument ? this._fullZoom : this._textZoom;
-          this._selectParentHelper.populate(menulist, data.options.options,
-            data.options.uniqueStyles, data.selectedIndex, zoom,
-            data.defaultStyle, data.style);
-          this._selectParentHelper.open(this, menulist, data.rect, data.isOpenedViaTouch);
-          break;
-        }
-
       case "FullZoomChange":
         {
           this._fullZoom = data.value;
           let event = document.createEvent("Events");
           event.initEvent("FullZoomChange", true, false);
           this.dispatchEvent(event);
           break;
         }