diff --git a/browser/base/content/urlbarBindings.xml b/browser/base/content/urlbarBindings.xml index b08523143a4..4c7766e9b31 100644 --- a/browser/base/content/urlbarBindings.xml +++ b/browser/base/content/urlbarBindings.xml @@ -1544,15 +1544,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. - = 0) { - let controller = this.view.QueryInterface(Components.interfaces.nsIAutoCompleteController); - controller.stopSearch(); - } - ]]> - @@ -1044,6 +1046,12 @@ extends="chrome://global/content/bindings/popup.xml#popup"> + + + + @@ -1226,9 +1234,13 @@ extends="chrome://global/content/bindings/popup.xml#popup"> // re-use the existing item item = this.richlistbox.childNodes[this._currentIndex]; - // Completely re-use the existing richlistitem if it's the same + // Completely re-use the existing richlistitem if it's the same. + // Also re-use it if we are about to replace the currently mouse + // selected item, to avoid surprising the user. if (item.getAttribute("text") == trimmedSearchString && - item.getAttribute("url") == url) { + (item.getAttribute("url") == url || + this.richlistbox.mouseSelectedIndex === this._currentIndex) + ) { item.collapsed = false; this._currentIndex++; continue; @@ -1992,15 +2004,16 @@ extends="chrome://global/content/bindings/popup.xml#popup"> Date.now() + -1 30) { - var item = event.target; - - while (item && item.localName != "richlistitem") + let item = event.target; + while (item && item.localName != "richlistitem") { item = item.parentNode; + } if (!item) return; - var rc = this.getIndexOfItem(item); - if (rc != this.selectedIndex) - this.selectedIndex = rc; + let index = this.getIndexOfItem(item); + if (index != this.selectedIndex) { + this.mouseSelectedIndex = this.selectedIndex = index; + } this.mLastMoveTime = Date.now(); }