Bug 994194, don't set height of panels when they are on the toolbar, prevents scrollbars from appearing, r=mconley, a=lsblakk
authorNeil Deakin <neil@mozilla.com>
Wed, 14 May 2014 08:05:04 -0400
changeset 192271 9bd4a69ee2e0
parent 192270 937f11ea90b2
child 192272 f29ab60028d4
push id3555
push userneil@mozilla.com
push date2014-05-14 12:06 +0000
treeherdermozilla-beta@9bd4a69ee2e0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley, lsblakk
bugs994194
milestone30.0
Bug 994194, don't set height of panels when they are on the toolbar, prevents scrollbars from appearing, r=mconley, a=lsblakk
browser/components/customizableui/content/panelUI.xml
--- a/browser/components/customizableui/content/panelUI.xml
+++ b/browser/components/customizableui/content/panelUI.xml
@@ -308,18 +308,27 @@
               this._mainView.style.removeProperty("height");
               this.showMainView();
               this._mainViewObserver.disconnect();
               break;
           }
         ]]></body>
       </method>
 
+      <method name="_shouldSetHeight">
+        <body><![CDATA[
+          return this.getAttribute("nosubviews") != "true";
+        ]]></body>
+      </method>
+
       <method name="_setMaxHeight">
         <body><![CDATA[
+          if (!this._shouldSetHeight())
+            return;
+
           // Ignore the mutation that'll fire when we set the height of
           // the main view.
           this.ignoreMutations = true;
           this._mainView.style.height =
             this.getBoundingClientRect().height + "px";
           this.ignoreMutations = false;
         ]]></body>
       </method>
@@ -334,17 +343,17 @@
             let newHeight = this._heightOfSubview(this._currentSubView, this._subViews);
             this._viewContainer.style.height = newHeight + "px";
           }
         ]]></body>
       </method>
       <method name="_syncContainerWithMainView">
         <body><![CDATA[
           // Check that this panel is still alive:
-          if (!this._panel || !this._panel.parentNode) {
+          if (!this._panel || !this._panel.parentNode || !this._shouldSetHeight()) {
             return;
           }
 
           if (!this.ignoreMutations && !this.showingSubView && !this._transitioning) {
             let height;
             if (this.showingSubViewAsMainView) {
               height = this._heightOfSubview(this._mainView);
             } else {