Bug 1580949 - avoid re-entry when showing extension subviews in the overflow panel, r=johannh
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 17 Sep 2019 14:57:52 +0000
changeset 493601 cf84fbd266c78c157c7a53682c3a7c9302ab2c38
parent 493600 9f4f0c7453b9652e3516ad8e7767c92b7412fff3
child 493602 2cf45cdd0a1be73da673a59a3673dcc453e9b83b
push id95583
push usergijskruitbosch@gmail.com
push dateTue, 17 Sep 2019 15:38:32 +0000
treeherderautoland@cf84fbd266c7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh
bugs1580949
milestone71.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 1580949 - avoid re-entry when showing extension subviews in the overflow panel, r=johannh Differential Revision: https://phabricator.services.mozilla.com/D46078
browser/components/customizableui/PanelMultiView.jsm
--- a/browser/components/customizableui/PanelMultiView.jsm
+++ b/browser/components/customizableui/PanelMultiView.jsm
@@ -947,16 +947,20 @@ var PanelMultiView = class extends Assoc
       // Wait for layout before measuring it
       let header = viewNode.firstElementChild;
       if (header && header.classList.contains("panel-header")) {
         viewRect.height += await window.promiseDocumentFlushed(() => {
           return this._getBoundsWithoutFlushing(header).height;
         });
       }
       await nextPanelView.descriptionHeightWorkaround();
+      // Bail out if the panel was closed in the meantime.
+      if (!nextPanelView.isOpenIn(this)) {
+        return;
+      }
     } else {
       this._offscreenViewStack.style.minHeight = olderView.knownHeight + "px";
       this._offscreenViewStack.appendChild(viewNode);
       nextPanelView.visible = true;
 
       // Now that the subview is visible, we can check the height of the
       // description elements it contains.
       await nextPanelView.descriptionHeightWorkaround();