Bug 613763 - Form elements can regain focus under a tab-modal prompt. r=enn, a=blocking

This commit is contained in:
Justin Dolske 2010-11-23 19:33:00 -08:00
parent 595ad9a4b9
commit 875f2aaf77
2 changed files with 11 additions and 0 deletions

View File

@ -475,3 +475,7 @@ window[chromehidden~="toolbar"] toolbar:not(.toolbar-primary):not(.chromeclass-m
#status-bar > .statusbar-resizerpanel {
display: none;
}
browser[tabmodalPromptShowing] {
-moz-user-focus: none !important;
}

View File

@ -422,7 +422,14 @@ function openTabPrompt(domWin, tabPrompt, args) {
callbackInvoked = true;
if (newPrompt)
tabPrompt.removePrompt(newPrompt);
winUtils.leaveModalState();
// Restore focus to the previously focused element within tab.
let fm = Cc["@mozilla.org/focus-manager;1"].
getService(Ci.nsIFocusManager);
let e = fm.getFocusedElementForWindow(domWin.top, false, {});
fm.setFocus(e, fm.FLAG_NOSCROLL);
}
let newPrompt;