Bug 403854: removing location bar or search bar breaks a bunch of stuff (exception thrown in browser.js), r=mano, a=blocking
authorgavin@gavinsharp.com
Mon, 19 Nov 2007 07:25:39 -0800
changeset 8174 bdfb2721d184562aa0d7b466920317565212e66f
parent 8173 33a5cff3838f322ee132b33a5868a09c698c0511
child 8175 3425d3836a498b69354d0faf48445fea91b5c36f
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherderautoland@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmano, blocking
bugs403854
milestone1.9b2pre
Bug 403854: removing location bar or search bar breaks a bunch of stuff (exception thrown in browser.js), r=mano, a=blocking
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -2161,37 +2161,38 @@ function canonizeUrl(aTriggeringEvent, a
 
   // Also update this so the browser display keeps the new value (bug 310651)
   gBrowser.userTypedValue = gURLBar.value;
 }
 
 function UpdateUrlbarSearchSplitterState()
 {
   var splitter = document.getElementById("urlbar-search-splitter");
-
   var urlbar = document.getElementById("urlbar-container");
   var searchbar = document.getElementById("search-container");
+
   var ibefore = null;
-  if (urlbar.nextSibling == searchbar)
-    ibefore = searchbar;
-  else if (searchbar.nextSibling == urlbar)
-    ibefore = urlbar;
-  else if (splitter)
-    splitter.parentNode.removeChild(splitter);
+  if (urlbar && searchbar) {
+    if (urlbar.nextSibling == searchbar)
+      ibefore = searchbar;
+    else if (searchbar.nextSibling == urlbar)
+      ibefore = urlbar;
+  }
 
   if (ibefore) {
     if (!splitter) {
       splitter = document.createElement("splitter");
       splitter.id = "urlbar-search-splitter";
       splitter.setAttribute("resizebefore", "flex");
       splitter.setAttribute("resizeafter", "flex");
       splitter.className = "chromeclass-toolbar-additional";
     }
     urlbar.parentNode.insertBefore(splitter, ibefore);
-  }
+  } else if (splitter)
+    splitter.parentNode.removeChild(splitter);
 }
 
 function UpdatePageProxyState()
 {
   if (gURLBar && gURLBar.value != gLastValidURLStr)
     SetPageProxyState("invalid");
 }