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
AX: VoiceOver word echo doesn't work on text inputs with a combobox role
https://bugs.webkit.org/show_bug.cgi?id=259811 rdar://112488137 Reviewed by Chris Fleizach. This happens because prior to this patch, we didn't expose the text entry trait for comboboxes, despite comboboxes generally (but not always) being a combination of a text input, plus a listbox of possible options. With this patch, when a text input has a role of combobox, we expose the text entry trait. * LayoutTests/accessibility/ios-simulator/combobox-is-editable-expected.txt: Added. * LayoutTests/accessibility/ios-simulator/combobox-is-editable.html: Added. * Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityTraits]): * Tools/DumpRenderTree/AccessibilityUIElement.cpp: (hasTextEntryTraitCallback): (AccessibilityUIElement::getJSClass): * Tools/DumpRenderTree/AccessibilityUIElement.h: * Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm: (AccessibilityUIElement::hasTextEntryTrait): * Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp: (WTR::AccessibilityUIElement::hasTextEntryTrait): * Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h: * Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl: * Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm: (WTR::AccessibilityUIElement::hasTextEntryTrait): Canonical link: https://commits.webkit.org/266569@main
- Loading branch information
Showing
10 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
LayoutTests/accessibility/ios-simulator/text-input-combobox-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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
This test ensures that the text entry trait is exposed for text controls with a combobox role. | ||
|
||
PASS: accessibilityController.accessibleElementById('textarea').hasTextEntryTrait === true | ||
PASS: accessibilityController.accessibleElementById('text-input').hasTextEntryTrait === true | ||
PASS: accessibilityController.accessibleElementById('submit-input').hasTextEntryTrait === false | ||
PASS: accessibilityController.accessibleElementById('select').hasTextEntryTrait === false | ||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
36 changes: 36 additions & 0 deletions
36
LayoutTests/accessibility/ios-simulator/text-input-combobox.html
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../../resources/accessibility-helper.js"></script> | ||
<script src="../../resources/js-test.js"></script> | ||
</head> | ||
<body> | ||
|
||
<!-- Some websites implement searchboxes this way. Without the proper traits, | ||
things like VoiceOver word echo will not work. --> | ||
<textarea role="combobox" id="textarea"></textarea> | ||
<input type="text" role="combobox" id="text-input"></input> | ||
<input type="submit" role="combobox" id="submit-input"></input> | ||
<select name="pets" role="combobox" id="select"> | ||
<option value="">--Please choose an option--</option> | ||
<option value="dog">Dog</option> | ||
<option value="cat">Cat</option> | ||
</select> | ||
|
||
<script> | ||
var output = "This test ensures that the text entry trait is exposed for text controls with a combobox role.\n\n"; | ||
|
||
if (window.accessibilityController) { | ||
output += expect("accessibilityController.accessibleElementById('textarea').hasTextEntryTrait", "true"); | ||
output += expect("accessibilityController.accessibleElementById('text-input').hasTextEntryTrait", "true"); | ||
// Non-text inputs with a role of combobox should not have the text entry trait because they are not "editable" in | ||
// the same way a text input is. | ||
output += expect("accessibilityController.accessibleElementById('submit-input').hasTextEntryTrait", "false"); | ||
output += expect("accessibilityController.accessibleElementById('select').hasTextEntryTrait", "false"); | ||
|
||
debug(output); | ||
} | ||
</script> | ||
</body> | ||
</html> | ||
|
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
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
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