зеркало из https://github.com/mozilla/gecko-dev.git
Bug 316059: Clean up use of userTypedClear, patch by Yoni Gilad <yonigilad@gmail.com>, r=mconnor
This commit is contained in:
Родитель
c0d402ae65
Коммит
3120aa0ea8
|
@ -3490,7 +3490,7 @@ nsBrowserStatusHandler.prototype =
|
|||
}
|
||||
|
||||
// The document loaded correctly, clear the value if we should
|
||||
if (browser.userTypedClear > 0)
|
||||
if (browser.userTypedClear > 0 && aRequest)
|
||||
browser.userTypedValue = null;
|
||||
|
||||
if (!gBrowser.mTabbedMode && aWebProgress.isLoadingDocument)
|
||||
|
@ -5444,16 +5444,7 @@ function setStyleDisabled(disabled) {
|
|||
}
|
||||
|
||||
#ifdef ALTSS_ICON
|
||||
function updatePageStyles(evt)
|
||||
{
|
||||
// XXX - Accessing window.content.document can generate an
|
||||
// onLocationChange for the current tab, this can cause the url
|
||||
// bar to be cleared. Prevent that happening by setting the clear
|
||||
// state to zero for the duration of this function.
|
||||
var browser = getBrowser().selectedBrowser;
|
||||
var userTypedClear = browser.userTypedClear;
|
||||
browser.userTypedClear = 0;
|
||||
|
||||
function updatePageStyles(evt) {
|
||||
if (!gPageStyleButton)
|
||||
gPageStyleButton = document.getElementById("page-theme-button");
|
||||
|
||||
|
@ -5480,9 +5471,6 @@ function updatePageStyles(evt)
|
|||
}
|
||||
else
|
||||
gPageStyleButton.removeAttribute("themes");
|
||||
|
||||
// Restore clear state
|
||||
browser.userTypedClear = userTypedClear;
|
||||
}
|
||||
#endif
|
||||
/* End of the Page Style functions */
|
||||
|
|
|
@ -377,7 +377,7 @@
|
|||
onLocationChange : function(aWebProgress, aRequest, aLocation)
|
||||
{
|
||||
// The document loaded correctly, clear the value if we should
|
||||
if (this.mBrowser.userTypedClear > 0)
|
||||
if (this.mBrowser.userTypedClear > 0 && aRequest)
|
||||
this.mBrowser.userTypedValue = null;
|
||||
|
||||
if (aWebProgress.DOMWindow == this.mBrowser.contentWindow &&
|
||||
|
@ -677,11 +677,7 @@
|
|||
|
||||
var webProgress = this.mCurrentBrowser.webProgress;
|
||||
var securityUI = this.mCurrentBrowser.securityUI;
|
||||
// Remember the current clear state, then set it to zero
|
||||
// so we don't clear the userTypedValue when just switching
|
||||
// tabs. Set it back to its old state after we're done.
|
||||
var userTypedClear = this.mCurrentBrowser.userTypedClear;
|
||||
this.mCurrentBrowser.userTypedClear = 0;
|
||||
|
||||
var i, p;
|
||||
for (i = 0; i < this.mProgressListeners.length; i++) {
|
||||
p = this.mProgressListeners[i];
|
||||
|
@ -691,8 +687,7 @@
|
|||
p.onSecurityChange(webProgress, null, securityUI.state);
|
||||
}
|
||||
}
|
||||
this.mCurrentBrowser.userTypedClear = userTypedClear;
|
||||
|
||||
|
||||
this._fastFind.setDocShell(this.mCurrentBrowser.docShell);
|
||||
|
||||
// Update the window title.
|
||||
|
|
Загрузка…
Ссылка в новой задаче