Bug 418673 - "restoring the current location when clicking the identity button is jerky, because handleURLBarRevert selects the address" [p=dao@mozilla.com (Dão Gottwald) r=Mano a1.9=beltzner]

git-svn-id: svn://10.0.0.236/trunk@246396 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
reed%reedloden.com 2008-02-24 07:33:27 +00:00
parent 9e393157c2
commit 75a46132fe

View File

@ -1968,8 +1968,7 @@ function URLBarSetURI(aURI) {
SetPageProxyState(state);
}
// If "ESC" is pressed in the url bar, we replace the urlbar's value with the url of the page
// and highlight it, unless it is empty.
// Replace the urlbar's value with the url of the page.
function handleURLBarRevert() {
var throbberElement = document.getElementById("navigator-throbber");
var isScrolling = gURLBar.popupOpen;
@ -1980,7 +1979,9 @@ function handleURLBarRevert() {
// and user is NOT key-scrolling through autocomplete list
if ((!throbberElement || !throbberElement.hasAttribute("busy")) && !isScrolling) {
URLBarSetURI();
if (gURLBar.value)
// If the value isn't empty and the urlbar has focus, select the value.
if (gURLBar.value && gURLBar.hasAttribute("focused"))
gURLBar.select();
}