From 58983e2e743bef2393e7744529f35de6be350e7d Mon Sep 17 00:00:00 2001 From: Raymond Lee Date: Thu, 31 May 2012 14:45:28 +0200 Subject: [PATCH] Bug 724821 - Firefox menu bar becomes disabled after toggling toolbars while 'Customize Toolbars' dialog open. r=mak77 --- browser/base/content/browser-places.js | 10 ++++++++-- browser/base/content/test/browser_bug422590.js | 2 -- browser/base/content/test/browser_bug599325.js | 2 -- browser/base/content/test/browser_customize.js | 1 - browser/components/search/content/search.xml | 1 + 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/browser/base/content/browser-places.js b/browser/base/content/browser-places.js index 94e711ac2741..85243945f05b 100644 --- a/browser/base/content/browser-places.js +++ b/browser/base/content/browser-places.js @@ -1109,10 +1109,13 @@ let PlacesToolbarHelper = { return; // If the bookmarks toolbar item is hidden because the parent toolbar is - // collapsed or hidden (i.e. in a popup), spare the initialization. + // collapsed or hidden (i.e. in a popup), spare the initialization. Also, + // there is no need to initialize the toolbar if customizing because + // init() will be called when the customization is done. let toolbar = viewElt.parentNode.parentNode; if (toolbar.collapsed || - getComputedStyle(toolbar, "").display == "none") + getComputedStyle(toolbar, "").display == "none" || + this._isCustomizing) return; new PlacesToolbar(this._place); @@ -1122,9 +1125,12 @@ let PlacesToolbarHelper = { let viewElt = this._viewElt; if (viewElt && viewElt._placesView) viewElt._placesView.uninit(); + + this._isCustomizing = true; }, customizeDone: function PTH_customizeDone() { + this._isCustomizing = false; this.init(); } }; diff --git a/browser/base/content/test/browser_bug422590.js b/browser/base/content/test/browser_bug422590.js index 5ab809d8ef08..05a158cbdeb8 100644 --- a/browser/base/content/test/browser_bug422590.js +++ b/browser/base/content/test/browser_bug422590.js @@ -1,7 +1,5 @@ function test() { waitForExplicitFinish(); - ignoreAllUncaughtExceptions(); - // test the main (normal) browser window testCustomize(window, testChromeless); } diff --git a/browser/base/content/test/browser_bug599325.js b/browser/base/content/test/browser_bug599325.js index 41c0ff2bb196..fe78a8788632 100644 --- a/browser/base/content/test/browser_bug599325.js +++ b/browser/base/content/test/browser_bug599325.js @@ -1,7 +1,5 @@ function test() { waitForExplicitFinish(); - ignoreAllUncaughtExceptions(); - testCustomize(window, finish); } diff --git a/browser/base/content/test/browser_customize.js b/browser/base/content/test/browser_customize.js index ee4dc8cb17fc..c719bfbace8a 100644 --- a/browser/base/content/test/browser_customize.js +++ b/browser/base/content/test/browser_customize.js @@ -1,7 +1,6 @@ function test() { waitForExplicitFinish(); - ignoreAllUncaughtExceptions(); var frame = document.getElementById("customizeToolbarSheetIFrame"); frame.addEventListener("load", testCustomizeFrameLoadedPre, true); diff --git a/browser/components/search/content/search.xml b/browser/components/search/content/search.xml index 45d10a36283d..ab2a3c2ea886 100644 --- a/browser/components/search/content/search.xml +++ b/browser/components/search/content/search.xml @@ -92,6 +92,7 @@ var os = Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService); os.removeObserver(this, "browser-search-engine-modified"); + this._addedObserver = false; } // Make sure to break the cycle from _textbox to us. Otherwise we leak