Bug 564075 - Url bar gets displaced, with open sidebar, focusing url bar and then dismissing awesome bar [r=mfinkle]

This commit is contained in:
Vivien Nicolas 2010-05-06 10:32:24 -04:00
parent a03d3624fe
commit 727be4ffff
2 changed files with 15 additions and 9 deletions

View File

@ -197,13 +197,11 @@ var BrowserUI = {
_updateToolbar: function _updateToolbar() {
let icons = document.getElementById("urlbar-icons");
if (Browser.selectedTab.isLoading() && icons.getAttribute("mode") != "loading") {
this.lockToolbar();
let mode = icons.getAttribute("mode");
if (Browser.selectedTab.isLoading() && mode != "loading") {
icons.setAttribute("mode", "loading");
}
else if (icons.getAttribute("mode") != "view") {
if (this.isToolbarLocked())
this.unlockToolbar();
else if (mode != "view") {
icons.setAttribute("mode", "view");
}
},
@ -463,6 +461,7 @@ var BrowserUI = {
this._updateToolbar();
this._updateIcon(browser.mIconURL);
this.unlockToolbar();
break;
case TOOLBARSTATE_LOADING:
@ -471,6 +470,7 @@ var BrowserUI = {
browser.mIconURL = "";
this._updateIcon();
this.lockToolbar();
break;
}
},
@ -754,11 +754,9 @@ var BrowserUI = {
break;
// URL textbox events
case "mouseup":
if (!this._isEventInsidePopup(aEvent))
this._hidePopup();
if (aEvent.detail < 2 && aEvent.button == 0)
if (aEvent.detail < 2 && aEvent.button == 0 && gFocusManager.focusedElement == this._edit.inputField) {
this.doCommand("cmd_openLocation");
}
break;
case "mousedown":
if (!this._isEventInsidePopup(aEvent))

View File

@ -781,12 +781,20 @@ var Browser = {
if (this._selectedTab) {
this._selectedTab.contentScrollOffset = this.getScrollboxPosition(this.contentScrollboxScroller);
this._selectedTab.pageScrollOffset = this.getScrollboxPosition(this.pageScrollboxScroller);
// Make sure we leave the toolbar in an unlocked state
if (this._selectedTab.isLoading())
BrowserUI.unlockToolbar();
}
let isFirstTab = this._selectedTab == null;
let lastTab = this._selectedTab;
this._selectedTab = tab;
// Lock the toolbar if the new tab is still loading
if (this._selectedTab.isLoading())
BrowserUI.lockToolbar();
tab.ensureBrowserExists();
bv.beginBatchOperation();