Backed out changeset 71da3a25b572 (bug 1370986) for timing out in browser_photon_customization_context_menus.js. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Fri, 09 Jun 2017 21:19:50 +0200
changeset 592047 ec9d6a6c30ee4f72a279725b882609e18e637100
parent 592046 84141f9b5d9aefd6d912a0d6405c27bdf0c05668
child 592048 675f396003827bd1075128c6620dd38386a2b64f
push id63265
push userbmo:sfoster@mozilla.com
push dateSat, 10 Jun 2017 01:07:46 +0000
reviewersbackout
bugs1370986
milestone55.0a1
backs out71da3a25b5720039ef7a0c84e0b49a35c86cae0a
Backed out changeset 71da3a25b572 (bug 1370986) for timing out in browser_photon_customization_context_menus.js. r=backout
browser/components/customizableui/CustomizableUI.jsm
browser/components/customizableui/content/panelUI.inc.xul
browser/components/customizableui/test/browser_overflow_use_subviews.js
--- a/browser/components/customizableui/CustomizableUI.jsm
+++ b/browser/components/customizableui/CustomizableUI.jsm
@@ -1518,18 +1518,17 @@ var CustomizableUIInternal = {
     } else if (aWidget.type == "view") {
       let ownerWindow = aNode.ownerGlobal;
       let area = this.getPlacementOfWidget(aNode.id).area;
       let areaType = CustomizableUI.getAreaType(area);
       let anchor = aNode;
       if (areaType != CustomizableUI.TYPE_MENU_PANEL) {
         let wrapper = this.wrapWidget(aWidget.id).forWindow(ownerWindow);
 
-        let hasMultiView = !!aNode.closest("photonpanelmultiview,panelmultiview");
-        if (wrapper && !hasMultiView && wrapper.anchor) {
+        if (wrapper && !wrapper.overflowed && wrapper.anchor) {
           this.hidePanelForNode(aNode);
           anchor = wrapper.anchor;
         }
       }
       ownerWindow.PanelUI.showSubView(aWidget.viewId, anchor, area);
     }
   },
 
@@ -1722,23 +1721,19 @@ var CustomizableUIInternal = {
       target = target.parentNode;
     }
     if (closemenu == "none" || widgetType == "view") {
       return;
     }
 
     if (closemenu == "single") {
       let panel = this._getPanelForNode(target);
-      let multiview = panel.querySelector("photonpanelmultiview,panelmultiview");
+      let multiview = panel.querySelector("panelmultiview");
       if (multiview.showingSubView) {
-        if (multiview.instance.panelViews) {
-          multiview.goBack();
-        } else {
-          multiview.showMainView();
-        }
+        multiview.showMainView();
         return;
       }
     }
 
     // If we get here, we can actually hide the popup:
     this.hidePanelForNode(aEvent.target);
   },
 
@@ -4156,25 +4151,19 @@ OverflowableToolbar.prototype = {
 
   show() {
     if (this._panel.state == "open") {
       return Promise.resolve();
     }
     return new Promise(resolve => {
       let doc = this._panel.ownerDocument;
       this._panel.hidden = false;
-      let photonView = this._panel.querySelector("photonpanelmultiview");
-      let contextMenu;
-      if (photonView) {
-        let mainViewId = photonView.getAttribute("mainViewId");
-        let mainView = doc.getElementById(mainViewId);
-        contextMenu = doc.getElementById(mainView.getAttribute("context"));
-      } else {
-        contextMenu = doc.getElementById(this._panel.getAttribute("context"));
-      }
+      let mainViewId = this._panel.querySelector("panelmultiview").getAttribute("mainViewId");
+      let mainView = doc.getElementById(mainViewId);
+      let contextMenu = doc.getElementById(mainView.getAttribute("context"));
       gELS.addSystemEventListener(contextMenu, "command", this, true);
       let anchor = doc.getAnonymousElementByAttribute(this._chevron, "class", "toolbarbutton-icon");
       // Ensure we update the gEditUIVisible flag when opening the popup, in
       // case the edit controls are in it.
       this._panel.addEventListener("popupshowing", () => doc.defaultView.updateEditUIVisibility(), {once: true});
       this._panel.openPopup(anchor || this._chevron);
       this._chevron.open = true;
 
--- a/browser/components/customizableui/content/panelUI.inc.xul
+++ b/browser/components/customizableui/content/panelUI.inc.xul
@@ -335,35 +335,28 @@
   </panelmultiview>
 </panel>
 
 <panel id="widget-overflow"
        role="group"
        type="arrow"
        noautofocus="true"
        position="bottomcenter topright"
-#ifndef MOZ_PHOTON_THEME
-       context="toolbar-context-menu"
-#endif
        hidden="true">
-#ifdef MOZ_PHOTON_THEME
-  <photonpanelmultiview mainViewId="widget-overflow-mainView">
+  <panelmultiview mainViewId="widget-overflow-mainView">
     <panelview id="widget-overflow-mainView"
                context="toolbar-context-menu">
-#endif
       <vbox id="widget-overflow-scroller">
         <vbox id="widget-overflow-list" class="widget-overflow-list"
               overflowfortoolbar="nav-bar"/>
         <toolbarseparator id="widget-overflow-fixed-separator" hidden="true"/>
         <vbox id="widget-overflow-fixed-list" class="widget-overflow-list" hidden="true"/>
       </vbox>
-#ifdef MOZ_PHOTON_THEME
     </panelview>
-  </photonpanelmultiview>
-#endif
+  </panelmultiview>
 </panel>
 
 <panel id="customization-tipPanel"
        type="arrow"
        flip="none"
        side="left"
        position="leftcenter topright"
        noautohide="true"
--- a/browser/components/customizableui/test/browser_overflow_use_subviews.js
+++ b/browser/components/customizableui/test/browser_overflow_use_subviews.js
@@ -36,20 +36,18 @@ add_task(async function check_developer_
   chevron.click();
   await shownPanelPromise;
 
   let developerView = document.getElementById("PanelUI-developer");
   let button = document.getElementById("developer-button");
   let subviewShownPromise = subviewShown(developerView);
   button.click();
   await subviewShownPromise;
-  let hasSubviews = !!kOverflowPanel.querySelector("photonpanelmultiview");
-  let expectedPanel = hasSubviews ? kOverflowPanel : document.getElementById("customizationui-widget-panel");
-  is(developerView.closest("panel"), expectedPanel, "Should be inside the panel");
-  expectedPanel.hidePopup();
+  is(developerView.closest("panel"), kOverflowPanel, "Should be inside the panel");
+  kOverflowPanel.hidePopup();
   await Promise.resolve(); // wait for popup to hide fully.
 });
 
 /**
  * This checks that non-subview-compatible items still work correctly.
  * Ideally we should make the downloads panel and bookmarks/library item
  * proper subview items, then this test can go away, and potentially we can
  * simplify some of the subview anchoring code.