bug 643172 - Some searchbar cleanup found by SeaMonkey reviews - whitespace and nits, r=gavin
authorRobert Kaiser <kairo@kairo.at>
Thu, 23 Feb 2012 13:55:04 +0100
changeset 87558 0d34a35066448bd31ab88b3d6880be5023df8780
parent 87557 1b1c461e3ba09247da443f8d0336568a3a568fc0
child 87559 0b5e42a04630745b9fbf375f62737d864e71f151
push id22130
push userrnewman@mozilla.com
push dateFri, 24 Feb 2012 02:35:54 +0000
treeherdermozilla-central@d23600a1d4a7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs643172
milestone13.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 643172 - Some searchbar cleanup found by SeaMonkey reviews - whitespace and nits, r=gavin
browser/base/content/browser.js
browser/components/search/content/search.xml
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -3568,17 +3568,16 @@ const BrowserSearch = {
    */
   get searchBar() {
     return document.getElementById("searchbar");
   },
 
   loadAddEngines: function BrowserSearch_loadAddEngines() {
     var newWindowPref = gPrefService.getIntPref("browser.link.open_newwindow");
     var where = newWindowPref == 3 ? "tab" : "window";
-    var regionBundle = document.getElementById("bundle_browser_region");
     var searchEnginesURL = formatURL("browser.search.searchEnginesURL", true);
     openUILinkIn(searchEnginesURL, where);
   }
 }
 
 function FillHistoryMenu(aParent) {
   // Lazily add the hover listeners on first showing and never remove them
   if (!aParent.hasStatusListener) {
--- a/browser/components/search/content/search.xml
+++ b/browser/components/search/content/search.xml
@@ -45,19 +45,19 @@
 <!DOCTYPE bindings [
 <!ENTITY % searchBarDTD SYSTEM "chrome://browser/locale/searchbar.dtd" >
 %searchBarDTD;
 <!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
 %browserDTD;
 ]>
 
 <bindings id="SearchBindings"
-      xmlns="http://www.mozilla.org/xbl"
-      xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-      xmlns:xbl="http://www.mozilla.org/xbl">
+          xmlns="http://www.mozilla.org/xbl"
+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+          xmlns:xbl="http://www.mozilla.org/xbl">
 
   <binding id="searchbar">
     <resources>
       <stylesheet src="chrome://browser/content/search/searchbarBindings.css"/>
       <stylesheet src="chrome://browser/skin/searchbar.css"/>
     </resources>
     <content>
       <xul:stringbundle src="chrome://browser/locale/search.properties"
@@ -91,23 +91,22 @@
                             oncommand="openManager(event);"/>
             </xul:menupopup>
           </xul:button>
         </xul:box>
         <xul:hbox class="search-go-container">
           <xul:image class="search-go-button"
                      anonid="search-go-button"
                      onclick="handleSearchCommand(event);"
-                     tooltiptext="&searchEndCap.label;" />
+                     tooltiptext="&searchEndCap.label;"/>
         </xul:hbox>
       </xul:textbox>
     </content>
 
     <implementation implements="nsIObserver">
-
       <constructor><![CDATA[
         if (this.parentNode.parentNode.localName == "toolbarpaletteitem")
           return;
         setTimeout(function (a) { a.init(); }, 0, this);
       ]]></constructor>
 
       <method name="init">
         <body><![CDATA[
@@ -159,17 +158,17 @@
       <field name="searchButton">document.getAnonymousElementByAttribute(this,
           "anonid", "searchbar-engine-button");</field>
 
       <property name="currentEngine"
                 onset="this.searchService.currentEngine = val; return val;">
         <getter><![CDATA[
           var currentEngine = this.searchService.currentEngine;
           // Return a dummy engine if there is no currentEngine
-          return currentEngine || {name:"", uri:null};
+          return currentEngine || {name: "", uri: null};
         ]]></getter>
       </property>
 
       <!-- textbox is used by sanitize.js to clear the undo history when
            clearing form information. -->
       <property name="textbox" readonly="true"
                 onget="return this._textbox;"/>
 
@@ -439,17 +438,17 @@
       </method>
 
       <method name="selectEngine">
         <parameter name="aEvent"/>
         <parameter name="isNextEngine"/>
         <body><![CDATA[
           // Find the new index
           var newIndex = this.engines.indexOf(this.currentEngine);
-          newIndex += (isNextEngine) ? 1 : -1;
+          newIndex += isNextEngine ? 1 : -1;
 
           if (newIndex >= 0 && newIndex < this.engines.length)
             this.currentEngine = this.engines[newIndex];
 
           aEvent.preventDefault();
           aEvent.stopPropagation();
         ]]></body>
       </method>
@@ -490,17 +489,16 @@
         <parameter name="aData"/>
         <parameter name="aWhere"/>
         <body><![CDATA[
           // null parameter below specifies HTML response for search
           var submission = this.currentEngine.getSubmission(aData);
           openUILinkIn(submission.uri.spec, aWhere, null, submission.postData);
         ]]></body>
       </method>
-
     </implementation>
 
     <handlers>
       <handler event="command"><![CDATA[
         const target = event.originalTarget;
         if (target.getAttribute("class").indexOf("addengine-item") != -1) {
           var searchService =
             Components.classes["@mozilla.org/browser/search-service;1"]
@@ -714,17 +712,17 @@
               document.getBindingParent(this).searchButton.open = true;
               return false;
             }
             return true;
           ]]>
         </body>
       </method>
 
-      <!-- overload |onTextEntered| in autocomplete.xml -->
+      <!-- override |onTextEntered| in autocomplete.xml -->
       <method name="onTextEntered">
         <parameter name="aEvent"/>
         <body><![CDATA[
           var evt = aEvent || this.mEnterEvent;
           document.getBindingParent(this).handleSearchCommand(evt);
           this.mEnterEvent = null;
         ]]></body>
       </method>