From b06f77c5a9dca20b8abf1b777bcacef29bbf23c3 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Fri, 26 Jun 2009 00:48:10 -0400 Subject: [PATCH] Bug 500540 - "Can not input any characters in URLBar when focused in it by tab key" [r=mark.finkle] --- mobile/chrome/content/browser-ui.js | 10 ++++++---- mobile/chrome/content/browser.xul | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mobile/chrome/content/browser-ui.js b/mobile/chrome/content/browser-ui.js index 434bb235e0f..14fb1388cc8 100644 --- a/mobile/chrome/content/browser-ui.js +++ b/mobile/chrome/content/browser-ui.js @@ -174,9 +174,8 @@ var BrowserUI = { _editToolbar : function _editToolbar(aEdit) { var icons = document.getElementById("urlbar-icons"); - if (aEdit && this._edit.readOnly) { + if (aEdit && icons.getAttribute("mode") != "edit") { icons.setAttribute("mode", "edit"); - this._edit.readOnly = false; this._edit.defaultValue = this._edit.value; let urlString = this.getDisplayURI(Browser.selectedBrowser); @@ -184,13 +183,16 @@ var BrowserUI = { urlString = ""; this._edit.value = urlString; + // This is a workaround for bug 488420, needed to cycle focus for the + // IME state to be set properly. Testing shows we only really need to + // do this the first time. this._edit.inputField.blur(); + this._edit.inputField.focus(); this._edit.select(); } - else if (!aEdit && !this._edit.readOnly) { + else if (!aEdit && icons.getAttribute("mode") != "view") { icons.setAttribute("mode", "view"); - this._edit.readOnly = true; this._edit.inputField.blur(); this._edit.reallyClosePopup(); } diff --git a/mobile/chrome/content/browser.xul b/mobile/chrome/content/browser.xul index 79571332092..a1836714b5f 100644 --- a/mobile/chrome/content/browser.xul +++ b/mobile/chrome/content/browser.xul @@ -242,7 +242,6 @@ autocompletepopup="popup_autocomplete" enablehistory="false" maxrows="6" - readonly="true" completeselectedindex="true" minresultsforpopup="0" flex="1"