mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 06:29:43 +00:00
LibWeb/HTML: Implement focus restoration in HTMLDialogElement
When a dialog is closed, restore focus to the previously focused element if focus is within the dialog or if the dialog was modal.
This commit is contained in:
parent
d082e7ec58
commit
fd3c69227f
Notes:
github-actions[bot]
2025-10-03 06:56:57 +00:00
Author: https://github.com/F3n67u
Commit: fd3c69227f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6164
Reviewed-by: https://github.com/gmta ✅
4 changed files with 117 additions and 7 deletions
|
@ -72,6 +72,9 @@ private:
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/interactive-elements.html#dialog-toggle-task-tracker
|
||||
Optional<ToggleTaskTracker> m_dialog_toggle_task_tracker;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/interactive-elements.html#previously-focused-element
|
||||
GC::Ptr<Node> m_previously_focused_element;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue