diff --git a/mobile/chrome/content/browser-ui.js b/mobile/chrome/content/browser-ui.js index 8fe9218cea7d..6881e79a2a38 100644 --- a/mobile/chrome/content/browser-ui.js +++ b/mobile/chrome/content/browser-ui.js @@ -273,15 +273,11 @@ var BrowserUI = { if (window != aEvent.target) { return } - var rect = document.getElementById("browser-container").getBoundingClientRect(); - var containerW = rect.right - rect.left; - var containerH = rect.bottom - rect.top; - - var toolbar = document.getElementById("toolbar-main"); - var toolbarH = toolbar.boxObject.height; + var toolbarH = document.getElementById("toolbar-main").boxObject.height; var popup = document.getElementById("popup_autocomplete"); - popup.height = containerH - toolbarH; + popup.height = window.innerHeight - toolbarH; + popup.width = window.innerWidth; // XXX need to handle make some of these work again /* @@ -303,7 +299,6 @@ var BrowserUI = { this._edit = document.getElementById("urlbar-edit"); this._edit.addEventListener("blur", this, false); this._edit.addEventListener("keypress", this, true); - this._edit.addEventListener("input", this, false); this._throbber = document.getElementById("urlbar-throbber"); this._favicon = document.getElementById("urlbar-favicon"); this._favicon.addEventListener("error", this, false); @@ -425,10 +420,9 @@ var BrowserUI = { this.show(UIMODE_URLVIEW); }, - updateAutoComplete : function(showDefault) { + showAutoComplete : function(showDefault) { this.updateSearchEngines(); - if (showDefault || this._edit.getAttribute("nomatch")) - this._edit.showHistoryPopup(); + this._edit.showHistoryPopup(); }, doButtonSearch : function(button) { @@ -629,9 +623,6 @@ var BrowserUI = { case "click": this.doCommand("cmd_openLocation"); break; - case "input": - this.updateAutoComplete(false); - break; case "keypress": if (aEvent.keyCode == aEvent.DOM_VK_ESCAPE) { this._edit.reallyClosePopup(); @@ -705,7 +696,7 @@ var BrowserUI = { break; case "cmd_openLocation": this.show(UIMODE_URLEDIT); - setTimeout(function () {BrowserUI.updateAutoComplete(true)}, 0); + setTimeout(function () { BrowserUI.showAutoComplete(); }, 0); break; case "cmd_star": { diff --git a/mobile/chrome/content/browser.css b/mobile/chrome/content/browser.css index bc84f1d881a1..c01b3e93a43e 100644 --- a/mobile/chrome/content/browser.css +++ b/mobile/chrome/content/browser.css @@ -34,3 +34,7 @@ notification { notification button { -moz-binding: url("chrome://browser/content/notification.xml#notification-button"); } + +#popup_autocomplete { + -moz-binding: url("chrome://browser/content/urlbar.xml#popup_autocomplete"); +} diff --git a/mobile/chrome/content/browser.js b/mobile/chrome/content/browser.js index 4de399a9f560..2acb44307c42 100644 --- a/mobile/chrome/content/browser.js +++ b/mobile/chrome/content/browser.js @@ -1270,7 +1270,9 @@ Tab.prototype = { browser.className = "deckbrowser-browser"; browser.setAttribute("style", "overflow: hidden; visibility: hidden; width: 1024px; height: 800px;"); browser.setAttribute("contextmenu", document.getElementById("canvas").getAttribute("contextmenu")); - browser.setAttribute("autocompletepopup", document.getElementById("canvas").getAttribute("autocompletepopup")); + let autocompletepopup = document.getElementById("canvas").getAttribute("autocompletepopup"); + if (autocompletepopup) + browser.setAttribute("autocompletepopup", autocompletepopup); browser.setAttribute("type", "content"); document.getElementById("browsers").appendChild(browser); diff --git a/mobile/chrome/content/browser.xul b/mobile/chrome/content/browser.xul index c55391e8fb07..2c40ae83abcc 100644 --- a/mobile/chrome/content/browser.xul +++ b/mobile/chrome/content/browser.xul @@ -162,14 +162,6 @@ - - - - - -