From c40c75a905820912bf88173051f481497a49da16 Mon Sep 17 00:00:00 2001 From: Wes Kocher Date: Fri, 22 Apr 2016 13:13:10 -0700 Subject: [PATCH] Backed out 2 changesets (bug 1263887) for m(oth) and m-e10s(bc7) failures Backed out changeset c0730eb0c5fc (bug 1263887) Backed out changeset 3c2a87839422 (bug 1263887) MozReview-Commit-ID: GDPDmfE5J7d --- toolkit/content/widgets/menulist.xml | 4 --- toolkit/modules/SelectContentHelper.jsm | 25 ++---------------- toolkit/modules/SelectParentHelper.jsm | 34 +++++-------------------- 3 files changed, 8 insertions(+), 55 deletions(-) diff --git a/toolkit/content/widgets/menulist.xml b/toolkit/content/widgets/menulist.xml index 4ecbabd35268..5440849e14ce 100644 --- a/toolkit/content/widgets/menulist.xml +++ b/toolkit/content/widgets/menulist.xml @@ -254,10 +254,6 @@ event.initEvent("ValueChange", true, true); this.dispatchEvent(event); - if (this.menuBoxObject) { - this.menuBoxObject.activeChild = this.mSelectedInternal; - } - return val; ]]> diff --git a/toolkit/modules/SelectContentHelper.jsm b/toolkit/modules/SelectContentHelper.jsm index 9be94182e827..ae2d0a3ca009 100644 --- a/toolkit/modules/SelectContentHelper.jsm +++ b/toolkit/modules/SelectContentHelper.jsm @@ -14,8 +14,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils", "resource://gre/modules/BrowserUtils.jsm"); XPCOMUtils.defineLazyServiceGetter(this, "DOMUtils", "@mozilla.org/inspector/dom-utils;1", "inIDOMUtils"); -XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask", - "resource://gre/modules/DeferredTask.jsm"); const kStateHover = 0x00000004; // NS_EVENT_STATE_HOVER @@ -29,7 +27,6 @@ this.SelectContentHelper = function (aElement, aGlobal) { this.global = aGlobal; this.init(); this.showDropDown(); - this._updateTimer = new DeferredTask(this._update.bind(this), 0); } this.SelectContentHelper.prototype = { @@ -39,14 +36,7 @@ this.SelectContentHelper.prototype = { this.global.addMessageListener("Forms:MouseOver", this); this.global.addMessageListener("Forms:MouseOut", this); this.global.addEventListener("pagehide", this); - let MutationObserver = this.element.ownerDocument.defaultView.MutationObserver; - this.mut = new MutationObserver(mutations => { - // Something changed the was updated while the dropdown was open. - // Let's send up a new list of options. - this.global.sendAsyncMessage("Forms:UpdateDropDown", { - options: this._buildOptionList(), - selectedIndex: this.element.selectedIndex, - }); - }, - receiveMessage: function(message) { switch (message.name) { case "Forms:SelectDropDownItem": diff --git a/toolkit/modules/SelectParentHelper.jsm b/toolkit/modules/SelectParentHelper.jsm index 9ea58458c8c3..17691313f653 100644 --- a/toolkit/modules/SelectParentHelper.jsm +++ b/toolkit/modules/SelectParentHelper.jsm @@ -9,22 +9,18 @@ this.EXPORTED_SYMBOLS = [ ]; var currentBrowser = null; -var currentMenulist = null; -var currentZoom = 1; this.SelectParentHelper = { populate: function(menulist, items, selectedIndex, zoom) { // Clear the current contents of the popup menulist.menupopup.textContent = ""; - currentZoom = zoom; - currentMenulist = menulist; populateChildren(menulist, items, selectedIndex, zoom); }, open: function(browser, menulist, rect) { menulist.hidden = false; currentBrowser = browser; - this._registerListeners(browser, menulist.menupopup); + this._registerListeners(menulist.menupopup); menulist.menupopup.openPopupAtScreenRect("after_start", rect.left, rect.top, rect.width, rect.height, false, false); menulist.selectedItem.scrollIntoView(); @@ -56,44 +52,26 @@ this.SelectParentHelper = { case "popuphidden": currentBrowser.messageManager.sendAsyncMessage("Forms:DismissedDropDown", {}); - let popup = event.target; - this._unregisterListeners(currentBrowser, popup); - popup.parentNode.hidden = true; currentBrowser = null; - currentMenulist = null; - currentZoom = 1; + let popup = event.target; + this._unregisterListeners(popup); + popup.parentNode.hidden = true; break; } }, - receiveMessage(msg) { - if (msg.name == "Forms:UpdateDropDown") { - // Sanity check - we'd better know what the currently - // opened menulist is, and what browser it belongs to... - if (!currentMenulist || !currentBrowser) { - return; - } - - let options = msg.data.options; - let selectedIndex = msg.data.selectedIndex; - this.populate(currentMenulist, options, selectedIndex, currentZoom); - } - }, - - _registerListeners: function(browser, popup) { + _registerListeners: function(popup) { popup.addEventListener("command", this); popup.addEventListener("popuphidden", this); popup.addEventListener("mouseover", this); popup.addEventListener("mouseout", this); - browser.messageManager.addMessageListener("Forms:UpdateDropDown", this); }, - _unregisterListeners: function(browser, popup) { + _unregisterListeners: function(popup) { popup.removeEventListener("command", this); popup.removeEventListener("popuphidden", this); popup.removeEventListener("mouseover", this); popup.removeEventListener("mouseout", this); - browser.messageManager.removeMessageListener("Forms:UpdateDropDown", this); }, };