diff --git a/browser/components/preferences/in-content/subdialogs.js b/browser/components/preferences/in-content/subdialogs.js --- a/browser/components/preferences/in-content/subdialogs.js +++ b/browser/components/preferences/in-content/subdialogs.js @@ -494,37 +494,11 @@ return; } let fm = Services.focus; - let isLastFocusableElement = el => { - // XXXgijs unfortunately there is no way to get the last focusable element without asking - // the focus manager to move focus to it. - let rv = - el == - fm.moveFocus(this._frame.contentWindow, null, fm.MOVEFOCUS_LAST, 0); - fm.setFocus(el, 0); - return rv; - }; - - let forward = !aEvent.shiftKey; - // check if focus is leaving the frame (incl. the close button): - if ( - (aEvent.target == this._closeButton && !forward) || - (isLastFocusableElement(aEvent.originalTarget) && forward) - ) { - aEvent.preventDefault(); - aEvent.stopImmediatePropagation(); - let parentWin = this._getBrowser().ownerGlobal; - if (forward) { - fm.moveFocus(parentWin, null, fm.MOVEFOCUS_FIRST, fm.FLAG_BYKEY); - } else { - // Somehow, moving back 'past' the opening doc is not trivial. Cheat by doing it in 2 steps: - fm.moveFocus(window, null, fm.MOVEFOCUS_ROOT, fm.FLAG_BYKEY); - fm.moveFocus(parentWin, null, fm.MOVEFOCUS_BACKWARD, fm.FLAG_BYKEY); - } - } + // Let's display some error again }, _onParentWinFocus(aEvent) { // Explicitly check for the focus target of |window| to avoid triggering this when the window // is refocused