Bug 571517 [SeaMonkey] Don't pass strings to setTimeout. Part 2. r=Neil

This commit is contained in:
Philip Chee 2010-06-28 18:30:07 +08:00
Родитель de32942237
Коммит d145129cec
6 изменённых файлов: 28 добавлений и 29 удалений

Просмотреть файл

@ -596,7 +596,7 @@ function Startup()
setTimeout(WindowFocusTimerCallback, 0, content);
// Perform default browser checking (after window opens).
setTimeout( checkForDefaultBrowser, 0 );
setTimeout(checkForDefaultBrowser, 0);
// hook up browser access support
window.browserDOMWindow = new nsBrowserAccess();
@ -687,7 +687,8 @@ function InitSessionStoreCallback()
function WindowFocusTimerCallback(element)
{
// This fuction is a redo of the fix for jag bug 91884
// This function is a redo of the fix for jag bug 91884.
// See Bug 97067 and Bug 89214 for details.
if (window == Services.ww.activeWindow) {
element.focus();
} else {
@ -1248,9 +1249,9 @@ function BrowserOpenTab()
gBrowser.selectedTab = gBrowser.addTab(uriToLoad);
if (uriToLoad == "about:blank" && isElementVisible(gURLBar))
setTimeout("gURLBar.focus();", 0);
setTimeout(WindowFocusTimerCallback, 0, gURLBar);
else
setTimeout("content.focus();", 0);
setTimeout(WindowFocusTimerCallback, 0, content);
}
}

Просмотреть файл

@ -129,10 +129,10 @@ function Boot()
if (document.getElementById('tree'))
Init();
else
setTimeout("Boot()", 500);
setTimeout(Boot, 500);
}
setTimeout("Boot()", 0);
setTimeout(Boot, 0);
function Init()
{

Просмотреть файл

@ -785,7 +785,7 @@ function checkSearchProgress()
}
if (activeSearchFlag)
setTimeout("checkSearchProgress()", 1000);
setTimeout(checkSearchProgress, 1000);
else
doStop();
@ -889,7 +889,7 @@ function OpenSearch(aSearchStr, engineURIs)
debug("Exception: " + ex);
}
setTimeout("checkSearchProgress()", 1000);
setTimeout(checkSearchProgress, 1000);
}
function saveSearch()

Просмотреть файл

@ -141,8 +141,7 @@ var panels_observer = {
//debug ("observer: assert");
// "refresh" is asserted by select menu and by customize.js.
if (prop == RDF.GetResource(NC + "link")) {
setTimeout("fixup_remote_container('"+src.Value+"')",100);
//fixup_remote_container(src.Value);
setTimeout(fixup_remote_container, 100, src.Value);
}
},
onUnassert : function(ds,src,prop,target) {
@ -234,7 +233,7 @@ function ClickOnOtherPanels(event)
add_datasource_to_other_panels(link);
treeitem.setAttribute('loaded_link', 'true');
} else {
setTimeout('fixup_children("'+ treeitem.getAttribute('id') +'")', 100);
setTimeout(fixup_children, 100, treeitem.getAttribute('id'));
}
}
}

Просмотреть файл

@ -446,7 +446,7 @@ function (force_reload)
clearTimeout(gTimeoutID);
gCurFrame = iframe;
gTimeoutID = setTimeout (setBlank, 20000);
gTimeoutID = setTimeout(setBlank, 20000);
}
}
@ -835,7 +835,7 @@ function sidebar_open_default_panel(wait, tries) {
} else {
if (tries < 3) {
// No children yet, try again later
setTimeout('sidebar_open_default_panel(' + (wait*2) + ',' + (tries+1) + ')',wait);
setTimeout(sidebar_open_default_panel, wait, wait*2, ++tries);
gBusyOpeningDefault = false;
return;
} else {
@ -1233,7 +1233,7 @@ function SidebarShowHide() {
}
// Immediately save persistent values
document.persist('sidebar-title-box', 'hidden');
persist_width();
PersistWidth();
window.content.focus();
}
@ -1495,8 +1495,8 @@ function SidebarCleanUpExpandCollapse() {
sidebar_overlay_init();
}
setTimeout("document.persist('sidebar-box', 'collapsed');",100);
setTimeout("sidebarObj.panels.refresh();",100);
setTimeout(Persist, 100, "sidebar-box", "collapsed");
setTimeout(function() sidebarObj.panels.refresh(), 100);
}
function PersistHeight() {
@ -1504,26 +1504,25 @@ function PersistHeight() {
// but wait until the last drag has been committed.
// May want to do something smarter here like only force it if the
// height has really changed.
setTimeout("document.persist('sidebar-panels-splitter-box','height');",100);
setTimeout(Persist, 100, "sidebar-panels-splitter-box", "height");
}
function persist_width() {
function PersistWidth() {
// XXX Mini hack. Persist isn't working too well. Force the persist,
// but wait until the width change has commited.
setTimeout("document.persist('sidebar-box', 'width');",100);
// but wait until the width change has commited. Also see bug 16516.
setTimeout(Persist, 100, "sidebar-box", "width");
var is_collapsed = document.getElementById('sidebar-box').
getAttribute('collapsed') == 'true';
var is_collapsed = document.getElementById("sidebar-box")
.getAttribute("collapsed") == "true";
SidebarSetButtonOpen(!is_collapsed);
}
function SidebarFinishClick() {
function Persist(aAttribute, aValue) {
document.persist(aAttribute, aValue);
}
// XXX Semi-hack for bug #16516.
// If we had the proper drag event listener, we would not need this
// timeout. The timeout makes sure the width is written to disk after
// the sidebar-box gets the newly dragged width.
setTimeout("persist_width()",100);
function SidebarFinishClick() {
PersistWidth();
var is_collapsed = document.getElementById('sidebar-box').getAttribute('collapsed') == 'true';
debug("collapsed: " + is_collapsed);

Просмотреть файл

@ -418,7 +418,7 @@ var MigrationWizard = {
this._wiz.advance();
if (this._autoMigrate)
setTimeout(function() {window.close();}, 5000);
setTimeout(close, 5000);
break;
}