зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
098e774a8e
Коммит
e153b334e7
|
@ -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/" +
|
Загрузка…
Ссылка в новой задаче