Bug 1849689 - Initial steps on handling Esc key for popover. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D186643
This commit is contained in:
Ziran Sun
2023-08-28 07:47:24 +00:00
parent 47c422728b
commit 5b9fbf874d
7 changed files with 31 additions and 43 deletions

View File

@@ -3447,13 +3447,10 @@ void nsGenericHTMLElement::FocusPreviousElementAfterHidingPopover() {
return;
}
// Run the focusing steps for previouslyFocusedElement if focus is within the
// popover hierarchy.
if (IsShadowIncludingInclusiveDescendantOf(control)) {
FocusOptions options;
options.mPreventScroll = true;
control->Focus(options, CallerType::NonSystem, IgnoreErrors());
}
// Run the focusing steps for previouslyFocusedElement.
FocusOptions options;
options.mPreventScroll = true;
control->Focus(options, CallerType::NonSystem, IgnoreErrors());
}
// https://html.spec.whatwg.org/multipage/popover.html#dom-togglepopover