Bug 527716 - Clear previous result data from 'No results' item, r=gavin
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 10 Nov 2009 20:47:38 +0100
changeset 65775 ce9572505aa68bec0d06a235ac5ea6b51faf047f
parent 65774 919711144841944e577f6ddcb55fa27f88089298
child 65776 146ab96418a6104883266a9538b25750d01da93d
push idunknown
push userunknown
push dateunknown
reviewersgavin
bugs527716
Bug 527716 - Clear previous result data from 'No results' item, r=gavin
mobile/chrome/content/bindings.xml
mobile/themes/hildon/browser.css
mobile/themes/wince/browser.css
--- a/mobile/chrome/content/bindings.xml
+++ b/mobile/chrome/content/bindings.xml
@@ -213,19 +213,19 @@
               item = document.createElementNS(this._XULNS, "xul:autocompleteresult");
               items.appendChild(item);
             }
 
             item._index = i;
 
             // Check whether there's an entry to fill
             if (i > matchCount - 1) {
-              // Just clear out the old item
+              // Just clear out the old item's value. CSS takes care of hiding
+              // everything else based on value="" (star, tags, etc.)
               item.setAttribute("value", "");
-              item.removeAttribute("favorite");
               item._empty = true;
 
               continue;
             }
             item._empty = false;
 
             // Assign the values
             let type = controller.getStyleAt(i);
@@ -259,16 +259,20 @@
         <body><![CDATA[
           let noResultsItem = this._items.childNodes.item(1);
           if (isResults) {
             noResultsItem.className = "";
           }
           else {
             noResultsItem.className = "noresults";
             noResultsItem.setAttribute("value", "]]>&noResults.label;<![CDATA[");
+            noResultsItem.removeAttribute("favorite");
+            noResultsItem.removeAttribute("url");
+            noResultsItem.removeAttribute("src");
+            noResultsItem.removeAttribute("tags");
           }
         ]]></body>
       </method>
 
       <field name="_allBookmarksItem">document.getAnonymousElementByAttribute(this, "anonid", "allbookmarks");</field>
       
       <property name="allBookmarksItemSelected" readonly="true"
                 onget="return this._selectedItem == this._allBookmarksItem;"/>
--- a/mobile/themes/hildon/browser.css
+++ b/mobile/themes/hildon/browser.css
@@ -621,21 +621,16 @@ autocompleteresult.noresults:active {
   background-color: white;
 }
 
 autocompleteresult.noresults > .autocomplete-item-label {
   text-align: center;
   color: grey;
 }
 
-autocompleteresult.noresults > .autocomplete-item-label > image,
-autocompleteresult.noresults > .autocomplete-item-url {
-  visibility: hidden;
-}
-
 autocompleteresult.allbookmarks {
   -moz-box-pack: center;
   background: #E9E9E9 url("images/arrowright-16.png") no-repeat 98% 50%;
 }
 
 autocompleteresult.allbookmarks:active,
 autocompleteresult.allbookmarks.autocompleteresult-selected {
   background-color: #8db8d8;
--- a/mobile/themes/wince/browser.css
+++ b/mobile/themes/wince/browser.css
@@ -380,21 +380,16 @@ autocompleteresult.noresults:active {
   background-color: white;
 }
 
 autocompleteresult.noresults > .autocomplete-item-label {
   text-align: center;
   color: grey;
 }
 
-autocompleteresult.noresults > .autocomplete-item-label > image,
-autocompleteresult.noresults > .autocomplete-item-url {
-  visibility: hidden;
-}
-
 autocompleteresult.allbookmarks {
   -moz-box-pack: center;
   background: #E9E9E9 url("images/arrowright-16.png") no-repeat 98% 50%;
 }
 
 autocompleteresult.allbookmarks:active,
 autocompleteresult.allbookmarks.autocompleteresult-selected {
   background-color: #8db8d8;