Backed out changeset 658b68ee4d0a (bug 1401383) for frequently failing browser-chrome's browser/components/extensions/test/browser/browser_ext_browserAction_popup_resize.js, especially on Linux x64 asan. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Wed, 20 Sep 2017 17:28:51 +0200
changeset 381923 dbe8d28ff6effc8ceb07fdd38b73cc0815b237be
parent 381922 5e19b6a153a62680c3edb31a09db9ab1a39b2833
child 381924 928f5840c78d9edd83c496e136e5b054ffb073a9
push id32542
push userkwierso@gmail.com
push dateWed, 20 Sep 2017 21:07:55 +0000
treeherdermozilla-central@319a34bea9e4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1401383
milestone57.0a1
backs out658b68ee4d0ae1b6c5ffb44ed38c310f50d4b283
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
Backed out changeset 658b68ee4d0a (bug 1401383) for frequently failing browser-chrome's browser/components/extensions/test/browser/browser_ext_browserAction_popup_resize.js, especially on Linux x64 asan. r=backout
browser/components/customizableui/PanelMultiView.jsm
--- a/browser/components/customizableui/PanelMultiView.jsm
+++ b/browser/components/customizableui/PanelMultiView.jsm
@@ -529,17 +529,23 @@ this.PanelMultiView = class {
         if (!playTransition) {
           viewNode.setAttribute("current", true);
           this.descriptionHeightWorkaround(viewNode);
         }
       }
 
       // Now we have to transition the panel.
       if (this.panelViews && playTransition) {
-        await this._transitionViews(previousViewNode, viewNode, reverse, previousRect, aAnchor);
+        if (aAnchor)
+          aAnchor.setAttribute("open", true);
+
+        await this._transitionViews(previousViewNode, viewNode, reverse, previousRect);
+
+        if (aAnchor)
+          aAnchor.removeAttribute("open");
 
         this._dispatchViewEvent(viewNode, "ViewShown");
         this._updateKeyboardFocus(viewNode);
       } else if (!this.panelViews) {
         this._transitionHeight(() => {
           viewNode.setAttribute("current", true);
           if (viewNode.id == this._mainViewId) {
             this.node.setAttribute("viewtype", "main");
@@ -566,39 +572,37 @@ this.PanelMultiView = class {
    * @param {panelview} previousViewNode Node that is currently shown as active,
    *                                     but is about to be transitioned away.
    * @param {panelview} viewNode         Node that will becode the active view,
    *                                     after the transition has finished.
    * @param {Boolean}   reverse          Whether we're navigation back to a
    *                                     previous view or forward to a next view.
    * @param {Object}    previousRect     Rect object, with the same structure as
    *                                     a DOMRect, of the `previousViewNode`.
-   * @param {Element}   anchor           the anchor for which we're opening
-   *                                     a new panelview, if any
+   * @param {Function}  callback         Function that will be invoked when the
+   *                                     transition is finished or when the
+   *                                     operation was canceled (early return).
    */
-  async _transitionViews(previousViewNode, viewNode, reverse, previousRect, anchor) {
+  async _transitionViews(previousViewNode, viewNode, reverse, previousRect) {
     // There's absolutely no need to show off our epic animation skillz when
     // the panel's not even open.
     if (this._panel.state != "open") {
       return;
     }
 
     const {window, document} = this;
 
     if (this._autoResizeWorkaroundTimer)
       window.clearTimeout(this._autoResizeWorkaroundTimer);
 
     this._transitionDetails = {
       phase: TRANSITION_PHASES.START,
-      previousViewNode, viewNode, reverse, anchor
+      previousViewNode, viewNode, reverse
     };
 
-    if (anchor)
-      anchor.setAttribute("open", "true");
-
     // Set the viewContainer dimensions to make sure only the current view is
     // visible.
     this._viewContainer.style.height = Math.max(previousRect.height, this._mainViewHeight) + "px";
     this._viewContainer.style.width = previousRect.width + "px";
     // Lock the dimensions of the window that hosts the popup panel.
     let rect = this._panel.popupBoxObject.getOuterScreenRect();
     this._panel.setAttribute("width", rect.width);
     this._panel.setAttribute("height", rect.height);
@@ -695,30 +699,27 @@ this.PanelMultiView = class {
    * Attempt to clean up the attributes and properties set by `_transitionViews`
    * above. Which attributes and properties depends on the phase the transition
    * was left from - normally that'd be `TRANSITION_PHASES.END`.
    */
   async _cleanupTransitionPhase() {
     if (!this._transitionDetails)
       return;
 
-    let {phase, previousViewNode, viewNode, reverse, resolve, listener, anchor} = this._transitionDetails;
+    let {phase, previousViewNode, viewNode, reverse, resolve, listener} = this._transitionDetails;
     this._transitionDetails = null;
 
     // Do the things we _always_ need to do whenever the transition ends or is
     // interrupted.
     this._dispatchViewEvent(previousViewNode, "ViewHiding");
     previousViewNode.removeAttribute("current");
     if (reverse)
       this._resetKeyNavigation(previousViewNode);
     this.descriptionHeightWorkaround(viewNode);
 
-    if (anchor)
-      anchor.removeAttribute("open");
-
     if (phase >= TRANSITION_PHASES.START) {
       this._panel.removeAttribute("width");
       this._panel.removeAttribute("height");
       // Myeah, panel layout auto-resizing is a funky thing. We'll wait
       // another few milliseconds to remove the width and height 'fixtures',
       // to be sure we don't flicker annoyingly.
       // NB: HACK! Bug 1363756 is there to fix this.
       this._autoResizeWorkaroundTimer = this.window.setTimeout(() => {
@@ -989,16 +990,17 @@ this.PanelMultiView = class {
         this.descriptionHeightWorkaround();
         break;
       case "popuphidden":
         // WebExtensions consumers can hide the popup from viewshowing, or
         // mid-transition, which disrupts our state:
         this._viewShowing = null;
         this._transitioning = false;
         this.node.removeAttribute("panelopen");
+        this.showMainView();
         if (this.panelViews) {
           this._cleanupTransitionPhase();
           for (let panelView of this._viewStack.children) {
             if (panelView.nodeName != "children") {
               panelView.__lastKnownBoundingRect = null;
               panelView.style.removeProperty("min-width");
               panelView.style.removeProperty("max-width");
             }
@@ -1011,17 +1013,16 @@ this.PanelMultiView = class {
           // when the popup is opened again, e.g. through touch mode sizing.
           this._mainViewHeight = 0;
           this._mainViewWidth = 0;
           this._viewContainer.style.removeProperty("min-height");
           this._viewStack.style.removeProperty("max-height");
           this._viewContainer.style.removeProperty("min-width");
           this._viewContainer.style.removeProperty("max-width");
         }
-        this.showMainView();
 
         // Always try to layout the panel normally when reopening it. This is
         // also the layout that will be used in customize mode.
         if (this._mainView.hasAttribute("blockinboxworkaround")) {
           this._mainView.style.removeProperty("height");
           this._mainView.removeAttribute("exceeding");
         }
         this._dispatchViewEvent(this.node, "PanelMultiViewHidden");