Bug 527716 - Clear previous result data from 'No results' item, r=gavin
--- 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;