Backed out changeset 333c888c9665 (bug 1304700) for failing devtools pane tests like browser_dbg_instruments-pane-collapse.js. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Fri, 23 Sep 2016 19:15:06 +0200
changeset 315139 76fd7dbb20d5387fe43dd30337b12f8ccb0bd30c
parent 315138 a1130cc17d4c09d8e2f32f7d6934b824902fc89c
child 315140 92d96352192c049c6c3c66e61f3d3c8f4545aaab
push id32563
push userihsiao@mozilla.com
push dateMon, 26 Sep 2016 11:18:33 +0000
treeherderautoland@eb840c87b5fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1304700
milestone52.0a1
backs out333c888c96655486831e87009c6a6fcdf5df3efc
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 333c888c9665 (bug 1304700) for failing devtools pane tests like browser_dbg_instruments-pane-collapse.js. r=backout
devtools/client/shared/widgets/view-helpers.js
--- a/devtools/client/shared/widgets/view-helpers.js
+++ b/devtools/client/shared/widgets/view-helpers.js
@@ -247,21 +247,16 @@ const ViewHelpers = exports.ViewHelpers 
     }
 
     // Hiding is always handled via margins, not the hidden attribute.
     pane.removeAttribute("hidden");
 
     // Add a class to the pane to handle min-widths, margins and animations.
     pane.classList.add("generic-toggled-pane");
 
-    // Avoid toggles in the middle of animation.
-    if (pane.hasAttribute("animated")) {
-      return;
-    }
-
     // Avoid useless toggles.
     if (flags.visible == !pane.classList.contains("pane-collapsed")) {
       if (flags.callback) {
         flags.callback();
       }
       return;
     }
 
@@ -283,46 +278,33 @@ const ViewHelpers = exports.ViewHelpers 
         pane.style.marginBottom = "0";
         pane.classList.remove("pane-collapsed");
       } else {
         let width = Math.floor(pane.getAttribute("width")) + 1;
         let height = Math.floor(pane.getAttribute("height")) + 1;
         pane.style.marginLeft = -width + "px";
         pane.style.marginRight = -width + "px";
         pane.style.marginBottom = -height + "px";
+        pane.classList.add("pane-collapsed");
       }
 
       // Wait for the animation to end before calling afterToggle()
       if (flags.animated) {
-        let options = {
-          useCapture: false,
-          once: true
-        };
-
-        pane.addEventListener("transitionend", () => {
+        pane.addEventListener("transitionend", function onEvent() {
+          pane.removeEventListener("transitionend", onEvent, false);
           // Prevent unwanted transitions: if the panel is hidden and the layout
           // changes margins will be updated and the panel will pop out.
           pane.removeAttribute("animated");
-
-          if (!flags.visible) {
-            pane.classList.add("pane-collapsed");
-          }
           if (flags.callback) {
             flags.callback();
           }
-        }, options);
-      } else {
-        if (!flags.visible) {
-          pane.classList.add("pane-collapsed");
-        }
-
+        }, false);
+      } else if (flags.callback) {
         // Invoke the callback immediately since there's no transition.
-        if (flags.callback) {
-          flags.callback();
-        }
+        flags.callback();
       }
     };
 
     // Sometimes it's useful delaying the toggle a few ticks to ensure
     // a smoother slide in-out animation.
     if (flags.delayed) {
       pane.ownerDocument.defaultView.setTimeout(doToggle,
                                                 PANE_APPEARANCE_DELAY);