Bug 1383076 - restore workaround for 'current' setter on panelviews in non-photon panelmultiview, r=mconley
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 24 Jul 2017 14:56:01 +0100
changeset 421734 14eb6424b03d36ccb2d4c2bd99893706e7a81d9b
parent 421733 4a36a9d7e962b66b3b6c2d1b3fc589c47f80840f
child 421735 b4c1365ff9419c7cde5b5e61759c2f19598598c9
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1383076
milestone56.0a1
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
Bug 1383076 - restore workaround for 'current' setter on panelviews in non-photon panelmultiview, r=mconley MozReview-Commit-ID: 6YZ6Wyu0Spc
browser/components/extensions/ext-browserAction.js
--- a/browser/components/extensions/ext-browserAction.js
+++ b/browser/components/extensions/ext-browserAction.js
@@ -176,16 +176,22 @@ this.browserAction = class extends Exten
         let popupURL = this.getProperty(tab, "popup");
         this.tabManager.addActiveTabPermission(tab);
 
         // Popups are shown only if a popup URL is defined; otherwise
         // a "click" event is dispatched. This is done for compatibility with the
         // Google Chrome onClicked extension API.
         if (popupURL) {
           try {
+            if (event.target.closest("panelmultiview")) {
+              // FIXME: The line below needs to change eventually, but for now:
+              // ensure the view is _always_ visible _before_ `popup.attach()` is
+              // called. PanelMultiView.jsm dictates different behavior.
+              event.target.setAttribute("current", true);
+            }
             let popup = this.getPopup(document.defaultView, popupURL);
             let attachPromise = popup.attach(event.target);
             event.detail.addBlocker(attachPromise);
             await attachPromise;
             TelemetryStopwatch.finish(POPUP_OPEN_MS_HISTOGRAM, this);
             if (this.eventQueue.length) {
               let histogram = Services.telemetry.getHistogramById(POPUP_RESULT_HISTOGRAM);
               histogram.add("popupShown");