mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 18:26:15 +00:00
Bug 892384 - When switching to a tab with an open find bar, focus it. r=dao
--HG-- extra : rebase_source : b55d5a749c8349552fdcebd531da893bebe18007
This commit is contained in:
parent
105030e61b
commit
4e45c5bb30
@ -1105,11 +1105,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
// If the find bar is focused, keep it focused.
|
||||
if (gFindBarInitialized &&
|
||||
!gFindBar.hidden &&
|
||||
gFindBar.getElement("findbar-textbox").getAttribute("focused") == "true")
|
||||
// If the find bar is open, focus it.
|
||||
if (gFindBarInitialized && !gFindBar.hidden) {
|
||||
gFindBar._findField.focus();
|
||||
break;
|
||||
}
|
||||
|
||||
// Otherwise, focus the content area.
|
||||
let fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
|
||||
|
@ -69,6 +69,9 @@ function continueTests() {
|
||||
ok(gFindBar.hidden, "First tab doesn't show find bar!");
|
||||
gBrowser.selectedTab = tabs[1];
|
||||
ok(!gFindBar.hidden, "Second tab shows find bar!");
|
||||
// Test for bug 892384
|
||||
is(gFindBar._findField.getAttribute("focused"), "true",
|
||||
"Open findbar refocused on tab change!");
|
||||
gBrowser.selectedTab = tabs[0];
|
||||
ok(gFindBar.hidden, "First tab doesn't show find bar!");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user