Backed out changeset af176d040fad (bug 1370580) for frequently failing browser_ext_sidebarAction.js on Linux debug. r=backout a=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sat, 17 Jun 2017 23:18:55 +0200
changeset 364532 316014448e427486cce211217e2aee2f18ee3d69
parent 364531 90436b206b3d754e482c8d6160274e62a87d5e8d
child 364533 cdb8d789c591f8bf576aae1d434fb7c35d8c70fa
child 364548 3673b20f7b49b6749773a4882331c260cbf821af
child 364559 119147f274e2e80da340fb00a3631b7f1b858731
push id32045
push userarchaeopteryx@coole-files.de
push dateSat, 17 Jun 2017 21:19:11 +0000
treeherdermozilla-central@316014448e42 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout, backout
bugs1370580
milestone56.0a1
backs outaf176d040fad713b19f6f57a82b5cfad9520b21f
first release with
nightly linux32
316014448e42 / 56.0a1 / 20170618100241 / files
nightly linux64
316014448e42 / 56.0a1 / 20170618100241 / files
nightly mac
316014448e42 / 56.0a1 / 20170618030207 / files
nightly win32
316014448e42 / 56.0a1 / 20170618030207 / files
nightly win64
316014448e42 / 56.0a1 / 20170618030207 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset af176d040fad (bug 1370580) for frequently failing browser_ext_sidebarAction.js on Linux debug. r=backout a=backout MozReview-Commit-ID: AwnMjAQTdmC
browser/components/customizableui/PanelMultiView.jsm
browser/components/customizableui/content/panelUI.js
browser/components/customizableui/test/browser_947914_button_history.js
browser/components/extensions/ext-browserAction.js
browser/components/extensions/test/browser/browser_ext_popup_corners.js
browser/themes/shared/customizableui/panelUI.inc.css
--- a/browser/components/customizableui/PanelMultiView.jsm
+++ b/browser/components/customizableui/PanelMultiView.jsm
@@ -162,16 +162,19 @@ this.PanelMultiView = class {
   }
   set _mainViewId(val) {
     this.node.setAttribute("mainViewId", val);
     return val;
   }
   get _mainView() {
     return this._mainViewId ? this.document.getElementById(this._mainViewId) : null;
   }
+  get showingSubViewAsMainView() {
+    return this.node.getAttribute("mainViewIsSubView") == "true";
+  }
 
   get _transitioning() {
     return this.__transitioning;
   }
   set _transitioning(val) {
     this.__transitioning = val;
     if (val) {
       this.node.setAttribute("transitioning", "true");
@@ -452,52 +455,50 @@ this.PanelMultiView = class {
       let detail = {
         blockers: new Set(),
         addBlocker(aPromise) {
           this.blockers.add(aPromise);
         },
       };
 
       // Make sure that new panels always have a title set.
-      let cancel = false;
       if (this.panelViews && aAnchor) {
         if (aAnchor && !viewNode.hasAttribute("title"))
           viewNode.setAttribute("title", aAnchor.getAttribute("label"));
         viewNode.classList.add("PanelUI-subView");
         let custWidget = CustomizableWidgets.find(widget => widget.viewId == viewNode.id);
         if (custWidget) {
           if (custWidget.onInit)
             custWidget.onInit(aAnchor);
-          custWidget.onViewShowing({ target: viewNode, preventDefault: () => cancel = true, detail });
+          custWidget.onViewShowing({ target: aAnchor, detail });
         }
       }
+      viewNode.setAttribute("current", true);
       if (this.panelViews && this._mainViewWidth)
         viewNode.style.maxWidth = viewNode.style.minWidth = this._mainViewWidth + "px";
 
       let evt = new window.CustomEvent("ViewShowing", { bubbles: true, cancelable: true, detail });
       viewNode.dispatchEvent(evt);
 
-      if (!cancel)
-        cancel = evt.defaultPrevented;
+      let cancel = evt.defaultPrevented;
       if (detail.blockers.size) {
         try {
           let results = await Promise.all(detail.blockers);
           cancel = cancel || results.some(val => val === false);
         } catch (e) {
           Cu.reportError(e);
           cancel = true;
         }
       }
 
       if (cancel) {
         return;
       }
 
       this._currentSubView = viewNode;
-      viewNode.setAttribute("current", true);
       if (this.panelViews) {
         this.node.setAttribute("viewtype", "subview");
         if (!playTransition)
           this.descriptionHeightWorkaround(viewNode);
       }
 
       // Now we have to transition the panel. There are a few parts to this:
       //
@@ -619,31 +620,29 @@ this.PanelMultiView = class {
 
                 if (!reverse)
                   viewNode.style.removeProperty("margin-inline-start");
                 if (aAnchor)
                   aAnchor.removeAttribute("open");
 
                 this._viewContainer.removeAttribute("transition-reverse");
 
-                viewNode.dispatchEvent(new window.CustomEvent("ViewShown",
-                  { bubbles: true, cancelable: false }));
+                evt = new window.CustomEvent("ViewShown", { bubbles: true, cancelable: false });
+                viewNode.dispatchEvent(evt);
               }, { once: true });
             });
           }, { once: true });
         });
       } else if (!this.panelViews) {
         this._transitionHeight(() => {
           viewNode.setAttribute("current", true);
           this.node.setAttribute("viewtype", "subview");
           // Now that the subview is visible, we can check the height of the
           // description elements it contains.
           this.descriptionHeightWorkaround(viewNode);
-          viewNode.dispatchEvent(new window.CustomEvent("ViewShown",
-            { bubbles: true, cancelable: false }));
         });
         this._shiftMainView(aAnchor);
       }
     })().catch(e => Cu.reportError(e));
   }
 
   /**
    * Calculate the correct bounds of a panelview node offscreen to minimize the
--- a/browser/components/customizableui/content/panelUI.js
+++ b/browser/components/customizableui/content/panelUI.js
@@ -510,24 +510,22 @@ const PanelUI = {
       tempPanel.classList.toggle("cui-widget-panelWithFooter",
                                  viewNode.querySelector(".panel-subview-footer"));
 
       let multiView = document.createElement(gPhotonStructure ? "photonpanelmultiview" : "panelmultiview");
       multiView.setAttribute("id", "customizationui-widget-multiview");
       multiView.setAttribute("nosubviews", "true");
       multiView.setAttribute("viewCacheId", "appMenu-viewCache");
       if (gPhotonStructure) {
-        tempPanel.setAttribute("photon", true);
         multiView.setAttribute("mainViewId", viewNode.id);
         multiView.appendChild(viewNode);
       }
       tempPanel.appendChild(multiView);
-      if (!gPhotonStructure) {
-        multiView.setMainView(viewNode);
-      }
+      multiView.setAttribute("mainViewIsSubView", "true");
+      multiView.setMainView(viewNode);
       viewNode.classList.add("cui-widget-panelview");
 
       let viewShown = false;
       let panelRemover = () => {
         viewNode.classList.remove("cui-widget-panelview");
         if (viewShown) {
           CustomizableUI.removePanelCloseListeners(tempPanel);
           tempPanel.removeEventListener("popuphidden", panelRemover);
--- a/browser/components/customizableui/test/browser_947914_button_history.js
+++ b/browser/components/customizableui/test/browser_947914_button_history.js
@@ -9,19 +9,17 @@ add_task(async function() {
   info("Check history button existence and functionality");
 
   await PanelUI.show();
   info("Menu panel was opened");
 
   let historyButton = document.getElementById("history-panelmenu");
   ok(historyButton, "History button appears in Panel Menu");
 
+  historyButton.click();
   let historyPanel = document.getElementById("PanelUI-history");
-  let promise = BrowserTestUtils.waitForEvent(historyPanel, "ViewShown");
-  historyButton.click();
-  await promise;
   ok(historyPanel.getAttribute("current"), "History Panel is in view");
 
   let panelHiddenPromise = promisePanelHidden(window);
   PanelUI.hide();
   await panelHiddenPromise
   info("Menu panel was closed");
 });
--- a/browser/components/extensions/ext-browserAction.js
+++ b/browser/components/extensions/ext-browserAction.js
@@ -125,17 +125,16 @@ this.browserAction = class extends Exten
       label: this.defaults.title || this.extension.name,
       tooltiptext: this.defaults.title || "",
       defaultArea: this.defaults.area,
 
       onBeforeCreated: document => {
         let view = document.createElementNS(XUL_NS, "panelview");
         view.id = this.viewId;
         view.setAttribute("flex", "1");
-        view.setAttribute("extension", true);
 
         document.getElementById("PanelUI-multiView").appendChild(view);
         document.addEventListener("popupshowing", this);
       },
 
       onDestroyed: document => {
         document.removeEventListener("popupshowing", this);
 
@@ -167,20 +166,16 @@ 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 {
-            // 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);
             event.detail.addBlocker(popup.attach(event.target));
           } catch (e) {
             Cu.reportError(e);
             event.preventDefault();
           }
         } else {
           // This isn't not a hack, but it seems to provide the correct behavior
--- a/browser/components/extensions/test/browser/browser_ext_popup_corners.js
+++ b/browser/components/extensions/test/browser/browser_ext_popup_corners.js
@@ -1,15 +1,13 @@
 /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set sts=2 sw=2 et tw=80: */
 "use strict";
 
 add_task(async function testPopupBorderRadius() {
-  await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]});
-
   let extension = ExtensionTestUtils.loadExtension({
     background() {
       browser.tabs.query({active: true, currentWindow: true}, tabs => {
         browser.pageAction.show(tabs[0].id);
       });
     },
 
     manifest: {
--- a/browser/themes/shared/customizableui/panelUI.inc.css
+++ b/browser/themes/shared/customizableui/panelUI.inc.css
@@ -256,18 +256,17 @@ photonpanelmultiview .panel-subview-head
 }
 
 #appMenu-popup > arrowscrollbox > scrollbox,
 #PanelUI-popup > arrowscrollbox > scrollbox {
   overflow: visible;
 }
 
 #appMenu-popup > .panel-arrowcontainer > .panel-arrowcontent,
-#PanelUI-popup > .panel-arrowcontainer > .panel-arrowcontent,
-panel[photon] > .panel-arrowcontainer > .panel-arrowcontent {
+#PanelUI-popup > .panel-arrowcontainer > .panel-arrowcontent {
   overflow: hidden;
 }
 
 #PanelUI-popup > .panel-arrowcontainer > .panel-arrowcontent,
 .cui-widget-panel > .panel-arrowcontainer > .panel-arrowcontent > .popup-internal-box {
   padding: 0;
 }
 
@@ -334,29 +333,27 @@ panelview:not([mainview]) .toolbarbutton
 }
 
 .cui-widget-panel > .panel-arrowcontainer > .panel-arrowcontent {
   padding: 4px 0;
 }
 
 /* START photonpanelview adjustments */
 
-#appMenu-popup > .panel-arrowcontainer > .panel-arrowcontent,
-panel[photon] > .panel-arrowcontainer > .panel-arrowcontent {
+#appMenu-popup > .panel-arrowcontainer > .panel-arrowcontent {
   padding: 0;
   border-radius: 0;
 }
 
 photonpanelmultiview panelview {
   background: var(--arrowpanel-background);
   padding: 6px 0;
 }
 
-#appMenu-popup panelview,
-#customizationui-widget-multiview panelview:not([extension]) {
+#appMenu-popup panelview {
   min-width: @menuPanelWidth@;
 }
 
 photonpanelmultiview panelview[title] {
   padding-top: 0;
 }
 
 /* END photonpanelview adjustments */
@@ -2074,19 +2071,9 @@ photonpanelmultiview .PanelUI-subView .p
   display: none;
 }
 
 photonpanelmultiview .PanelUI-subView toolbarseparator {
   margin-inline-start: 0;
   margin-inline-end: 0;
 }
 
-photonpanelmultiview#customizationui-widget-multiview > .panel-viewcontainer {
-  overflow: hidden;
-}
-
-/* This is explicitly overriding the overflow properties set above. */
-photonpanelmultiview .cui-widget-panelview {
-  overflow-x: visible;
-  overflow-y: visible;
-}
-
 /* END photon adjustments */