Bug 981418 - followup: add a nullcheck for the height syncing methods in Australis' panelmultiview to avoid generating exceptions from setTimeout-generated calls, rs=jaws over IRC
☠☠ backed out by ac800841c853 ☠ ☠
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 11 Mar 2014 18:16:21 +0000
changeset 191339 f66e3ccb0c419a538cab1200ce16670e31ed007b
parent 191338 e1f1f275f9021b76c20a3b3d5ab09de1a654f4c1
child 191340 512f9b89f5ccf7f69ac5a7a64bc5a13c93895b53
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs981418
milestone30.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 981418 - followup: add a nullcheck for the height syncing methods in Australis' panelmultiview to avoid generating exceptions from setTimeout-generated calls, rs=jaws over IRC
browser/components/customizableui/content/panelUI.xml
--- a/browser/components/customizableui/content/panelUI.xml
+++ b/browser/components/customizableui/content/panelUI.xml
@@ -320,25 +320,32 @@
           this.ignoreMutations = true;
           this._mainView.style.height =
             this.getBoundingClientRect().height + "px";
           this.ignoreMutations = false;
         ]]></body>
       </method>
       <method name="_syncContainerWithSubView">
         <body><![CDATA[
-          if (!this.ignoreMutations && this.showingSubView) {
+          // Need to nullcheck this._currentSubView because we could be called from a
+          // setTimeout from the overflow handler, which means the view might
+          // have been removed at this point.
+          if (!this.ignoreMutations && this._currentSubView && this.showingSubView) {
             let newHeight = this._heightOfSubview(this._currentSubView, this._subViews);
             this._viewContainer.style.height = newHeight + "px";
           }
         ]]></body>
       </method>
       <method name="_syncContainerWithMainView">
         <body><![CDATA[
-          if (!this.ignoreMutations && !this.showingSubView && !this._transitioning) {
+          // Need to nullcheck _mainView because we could be called from a
+          // setTimeout from the overflow handler, which means the view might
+          // have been removed at this point.
+          if (!this.ignoreMutations && this._mainView &&
+              !this.showingSubView && !this._transitioning) {
             let height;
             if (this.showingSubViewAsMainView) {
               height = this._heightOfSubview(this._mainView);
             } else {
               height = this._mainView.scrollHeight;
             }
             this._viewContainer.style.height = height + "px";
           }