Bug 869919 - Find bar should hide on disablefastfind pages. r=dao

--HG--
extra : rebase_source : 851224b741bef5b8020d91eb93b8d22ccff47db2
This commit is contained in:
Jared Wein 2013-05-09 10:19:02 -04:00
parent 36df22ee4c
commit 6461c5ee08
2 changed files with 23 additions and 2 deletions

View File

@ -3911,7 +3911,16 @@ var XULBrowserWindow = {
else
elt.removeAttribute("disabled");
}
}
if (gFindBarInitialized) {
if (!gFindBar.hidden && aDisable) {
gFindBar.hidden = true;
this._findbarTemporarilyHidden = true;
} else if (this._findbarTemporarilyHidden && !aDisable) {
gFindBar.hidden = false;
this._findbarTemporarilyHidden = false;
}
}
}.bind(this);
var onContentRSChange = function onContentRSChange(e) {
if (e.target.readyState != "interactive" && e.target.readyState != "complete")

View File

@ -20,7 +20,12 @@ function load(url, cb) {
function test() {
waitForExplicitFinish();
ok(gFindBar.hidden, "Find bar should not be visible");
ok(gFindBar.hidden, "Find bar should not be visible by default");
// Open the Find bar before we navigate to pages that shouldn't have it.
EventUtils.synthesizeKey("f", { accelKey: true });
ok(!gFindBar.hidden, "Find bar should be visible");
nextTest();
}
@ -60,6 +65,13 @@ function testFindEnabled(url, cb) {
ok(!document.getElementById("cmd_find").getAttribute("disabled"),
"Find command should not be disabled");
ok(!gFindBar.hidden, "Find bar should be visible again");
// Give focus to the Find bar and then close it.
EventUtils.synthesizeKey("f", { accelKey: true });
EventUtils.synthesizeKey("VK_ESCAPE", { });
ok(gFindBar.hidden, "Find bar should now be hidden");
gBrowser.removeTab(gTab);
cb();
});