forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only restore dialog focus if focus is in dialog
https://bugs.webkit.org/show_bug.cgi?id=256717 rdar://109572320 Reviewed by NOBODY (OOPS!). Implement whatwg/html#9178 to avoid unexpected focus shifting when focus is already outside of the dialog. * LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/dialog-focus-previous-outside-expected.txt: * Source/WebCore/html/HTMLDialogElement.cpp: (WebCore::HTMLDialogElement::close): (WebCore::HTMLDialogElement::runFocusingSteps):
- Loading branch information
Showing
2 changed files
with
12 additions
and
10 deletions.
There are no files selected for viewing
8 changes: 3 additions & 5 deletions
8
...antics/interactive-elements/the-dialog-element/dialog-focus-previous-outside-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
button 1 button 2 | ||
|
||
FAIL Focus should not be restored if the currently focused element is not inside the dialog. assert_equals: expected Element node <button id="b2">button 2</button> but got Element node <button id="b1">button 1</button> | ||
FAIL Focus restore should not occur when the focused element is in a shadowroot outside of the dialog. assert_equals: document.activeElement should point at the shadow host. expected Element node <div id="host"> | ||
|
||
</div> but got Element node <button id="b2">button 2</button> | ||
PASS Focus should not be restored if the currently focused element is not inside the dialog. | ||
PASS Focus restore should not occur when the focused element is in a shadowroot outside of the dialog. | ||
PASS Focus restore should occur when the focused element is in a shadowroot inside the dialog. | ||
PASS Focus restore should occur when the focused element is slotted into a dialog. | ||
FAIL Focus restore should occur when the focused element is slotted into a dialog. assert_equals: expected Element node <button id="b2">button 2</button> but got Element node <button id="host2button">button</button> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters