Back out bug 628179 (make navigation and tab switching always close the Find bar) to reduce risk. r=dao a=backout

--HG--
rename : browser/base/content/test/browser_bug628179.js => browser/base/content/test/browser_findbarClose.js
This commit is contained in:
Gavin Sharp 2011-02-28 11:56:56 -08:00
Родитель 098e774a8e
Коммит e153b334e7
4 изменённых файлов: 12 добавлений и 29 удалений

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

@ -4439,7 +4439,10 @@ var XULBrowserWindow = {
});
if (gFindBarInitialized) {
gFindBar.close();
if (gFindBar.findMode != gFindBar.FIND_NORMAL) {
// Close the Find toolbar if we're in old-style TAF mode
gFindBar.close();
}
// fix bug 253793 - turn off highlight when page changes
gFindBar.getElement("highlight").checked = false;

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

@ -965,6 +965,12 @@
}
}
// If the find bar is focused, keep it focused.
if (gFindBarInitialized &&
!gFindBar.hidden &&
gFindBar.getElement("findbar-textbox").getAttribute("focused") == "true")
break;
// Otherwise, focus the content area.
let fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
let newFocusedElement = fm.getFocusedElementForWindow(window.content, true, {});

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

@ -170,7 +170,7 @@ _BROWSER_FILES = \
browser_bug616836.js \
browser_bug623893.js \
browser_bug624734.js \
browser_bug628179.js \
browser_findbarClose.js \
browser_contextSearchTabPosition.js \
browser_ctrlTab.js \
browser_customize_popupNotification.js \

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

@ -1,39 +1,13 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests that the Find bar goes away on tab switch or location change.
// Tests find bar auto-close behavior
let newTab, iframe;
function test() {
waitForExplicitFinish();
newTab = gBrowser.addTab("about:blank");
gBrowser.addEventListener("DOMContentLoaded", testFindBarCloseOnTabSwitch,
false);
}
function testFindBarCloseOnTabSwitch() {
gBrowser.removeEventListener("DOMContentLoaded", testFindBarCloseOnTabSwitch,
false);
gFindBar.open();
gBrowser.selectedTab = newTab;
ok(gFindBar.hidden, "the Find bar is hidden after switching tabs");
gFindBar.open();
newTab.linkedBrowser.addEventListener("DOMContentLoaded",
testFindBarCloseOnLocationChange,
false);
newTab.linkedBrowser.contentWindow.location = "http://example.com/";
}
function testFindBarCloseOnLocationChange() {
newTab.linkedBrowser.removeEventListener("DOMContentLoaded",
testFindBarCloseOnLocationChange,
false);
ok(gFindBar.hidden, "the Find bar is hidden after the location changes");
newTab.linkedBrowser.addEventListener("DOMContentLoaded",
prepareTestFindBarStaysOpenOnSubdocumentLocationChange, false);
newTab.linkedBrowser.contentWindow.location = "http://example.com/browser/" +