Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[popover] Improve focus handling
https://bugs.webkit.org/show_bug.cgi?id=255454 Reviewed by Ryosuke Niwa. A lot of tests are failing because on macOS buttons are not considered to be focusable. Start allowing this in case tabindex is set on form controls and adjust the tests accordingly. * LayoutTests/fast/events/focus-label-legend-elements-with-tab-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-focus-2-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-focus-2.html: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-focus-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-focus.html: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-light-dismiss-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-light-dismiss.html: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-not-keyboard-focusable-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-not-keyboard-focusable.html: * LayoutTests/platform/glib/fast/events/focus-label-legend-elements-with-tab-expected.txt: Removed. * LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/semantics/popovers/popover-focus-2-expected.txt: * LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/semantics/popovers/popover-focus-expected.txt: * LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/popovers/popover-focus-2-expected.txt: * LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/popovers/popover-not-keyboard-focusable-expected.txt: * LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/semantics/popovers/popover-light-dismiss-expected.txt: * LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/popovers/popover-focus-expected.txt: * Source/WebCore/html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::isKeyboardFocusable const): (WebCore::HTMLFormControlElement::isMouseFocusable const): Canonical link: https://commits.webkit.org/263527@main
- Loading branch information
Showing
18 changed files
with
109 additions
and
123 deletions.
There are no files selected for viewing
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
8 changes: 4 additions & 4 deletions
8
...ests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-focus-2-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,10 +1,10 @@ | ||
Button1 Button2 Invoker1 Button3 Button4 | ||
Invoker after | ||
Show popover | ||
Toggle popover Popover with focusable element Other focusable element | ||
Toggle popover Other focusable element | ||
|
||
FAIL Popover focus navigation assert_equals: Hidden popover should be skipped expected Element node <button id="button2">Button2</button> but got Element node <span tabindex="0">Other focusable element</span> | ||
FAIL Circular reference tab navigation assert_equals: Step 2 expected Element node <button id="circular1" autofocus="" popovertarget="popove... but got Element node <span tabindex="0">Other focusable element</span> | ||
FAIL Popover focus navigation assert_equals: Focus should move from invoker into the open popover expected Element node <button id="inside_popover1" tabindex="0">Inside1</button> but got Element node <button id="button3" tabindex="0">Button3</button> | ||
PASS Circular reference tab navigation | ||
PASS Popover focus returns when popover is hidden by invoker | ||
FAIL Popover focus only returns to invoker when focus is within the popover assert_equals: next up is the popover expected Element node <button>focusable element</button> but got Element node <span tabindex="0">Other focusable element</span> | ||
FAIL Popover focus only returns to invoker when focus is within the popover assert_equals: focus does not move because it was not inside the popover expected Element node <span tabindex="0">Other focusable element</span> but got Element node <button popovertarget="focus-return2-p" tabindex="0">Togg... | ||
|
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
16 changes: 8 additions & 8 deletions
16
...tTests/imported/w3c/web-platform-tests/html/semantics/popovers/popover-focus-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,26 +1,26 @@ | ||
|
||
PASS Popover focus test: default behavior - popover is not focused | ||
FAIL Popover button click focus test: default behavior - popover is not focused assert_equals: focus should move to the button when clicked, and should stay there when the popover closes expected Element node <button popovertarget="popover-id">Click me</button> but got Element node <button id="priorFocus"></button> | ||
FAIL Popover button click focus test: default behavior - popover is not focused assert_equals: focus should move to the button when clicked, and should stay there when the popover closes expected Element node <button tabindex="0" popovertarget="popover-id">Click me<... but got Element node <button tabindex="0" id="priorFocus"></button> | ||
PASS Popover corner cases test: default behavior - popover is not focused | ||
PASS Popover focus test: autofocus popover | ||
FAIL Popover button click focus test: autofocus popover assert_equals: focus should move to the button when clicked, and should stay there when the popover closes expected Element node <button popovertarget="popover-id">Click me</button> but got Element node <button id="priorFocus"></button> | ||
FAIL Popover button click focus test: autofocus popover assert_equals: focus should move to the button when clicked, and should stay there when the popover closes expected Element node <button tabindex="0" popovertarget="popover-id">Click me<... but got Element node <button tabindex="0" id="priorFocus"></button> | ||
PASS Popover corner cases test: autofocus popover | ||
PASS Popover focus test: autofocus empty popover | ||
FAIL Popover button click focus test: autofocus empty popover assert_equals: focus should move to the button when clicked, and should stay there when the popover closes expected Element node <button popovertarget="popover-id">Click me</button> but got Element node <button id="priorFocus"></button> | ||
FAIL Popover button click focus test: autofocus empty popover assert_equals: focus should move to the button when clicked, and should stay there when the popover closes expected Element node <button tabindex="0" popovertarget="popover-id">Click me<... but got Element node <button tabindex="0" id="priorFocus"></button> | ||
PASS Popover corner cases test: autofocus empty popover | ||
PASS Popover focus test: autofocus popover with button | ||
FAIL Popover button click focus test: autofocus popover with button assert_equals: focus should move to the button when clicked, and should stay there when the popover closes expected Element node <button popovertarget="popover-id">Click me</button> but got Element node <button id="priorFocus"></button> | ||
FAIL Popover button click focus test: autofocus popover with button assert_equals: focus should move to the button when clicked, and should stay there when the popover closes expected Element node <button tabindex="0" popovertarget="popover-id">Click me<... but got Element node <button tabindex="0" id="priorFocus"></button> | ||
PASS Popover corner cases test: autofocus popover with button | ||
PASS Popover focus test: autofocus child | ||
FAIL Popover button click focus test: autofocus child assert_equals: focus should move to the button when clicked, and should stay there when the popover closes expected Element node <button popovertarget="popover-id">Click me</button> but got Element node <button id="priorFocus"></button> | ||
FAIL Popover button click focus test: autofocus child assert_equals: focus should move to the button when clicked, and should stay there when the popover closes expected Element node <button tabindex="0" popovertarget="popover-id">Click me<... but got Element node <button tabindex="0" id="priorFocus"></button> | ||
PASS Popover corner cases test: autofocus child | ||
PASS Popover focus test: autofocus on tabindex=0 element | ||
FAIL Popover button click focus test: autofocus on tabindex=0 element assert_equals: focus should move to the button when clicked, and should stay there when the popover closes expected Element node <button popovertarget="popover-id">Click me</button> but got Element node <button id="priorFocus"></button> | ||
FAIL Popover button click focus test: autofocus on tabindex=0 element assert_equals: focus should move to the button when clicked, and should stay there when the popover closes expected Element node <button tabindex="0" popovertarget="popover-id">Click me<... but got Element node <button tabindex="0" id="priorFocus"></button> | ||
PASS Popover corner cases test: autofocus on tabindex=0 element | ||
PASS Popover focus test: autofocus multiple children | ||
FAIL Popover button click focus test: autofocus multiple children assert_equals: focus should move to the button when clicked, and should stay there when the popover closes expected Element node <button popovertarget="popover-id">Click me</button> but got Element node <button id="priorFocus"></button> | ||
FAIL Popover button click focus test: autofocus multiple children assert_equals: focus should move to the button when clicked, and should stay there when the popover closes expected Element node <button tabindex="0" popovertarget="popover-id">Click me<... but got Element node <button tabindex="0" id="priorFocus"></button> | ||
PASS Popover corner cases test: autofocus multiple children | ||
PASS Popover focus test: autofocus popover and multiple autofocus children | ||
FAIL Popover button click focus test: autofocus popover and multiple autofocus children assert_equals: focus should move to the button when clicked, and should stay there when the popover closes expected Element node <button popovertarget="popover-id">Click me</button> but got Element node <button id="priorFocus"></button> | ||
FAIL Popover button click focus test: autofocus popover and multiple autofocus children assert_equals: focus should move to the button when clicked, and should stay there when the popover closes expected Element node <button tabindex="0" popovertarget="popover-id">Click me<... but got Element node <button tabindex="0" id="priorFocus"></button> | ||
PASS Popover corner cases test: autofocus popover and multiple autofocus children | ||
|
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
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
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
8 changes: 2 additions & 6 deletions
8
...3c/web-platform-tests/html/semantics/popovers/popover-not-keyboard-focusable-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,8 +1,4 @@ | ||
Button 1 | ||
This is a popover without a focusable element | ||
Button 1 Button 2 | ||
|
||
Button 2 | ||
|
||
FAIL Popover should not be keyboard focusable assert_equals: Keyboard focus should skip the open popover expected Element node <button id="secondfocus">Button 2</button> but got Element node <body><button id="firstfocus">Button 1</button> | ||
<div popo... | ||
PASS Popover should not be keyboard focusable | ||
|
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
19 changes: 0 additions & 19 deletions
19
LayoutTests/platform/glib/fast/events/focus-label-legend-elements-with-tab-expected.txt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.