-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AX: Content editable should not be textbox roles
https://bugs.webkit.org/show_bug.cgi?id=257184 rdar://problem/109699222 Reviewed by Chris Fleizach. We currently expose elements with contenteditable=true as AXTextAreas. However, text areas cannot have children objects that are exposed to AT (such as tables, lists, etc.). This patch addresses that by changing the role for contenteditable (which are non-native text control elements) elements to AXGroup, allowing for its children to be navigated. We still maintain the edit-ability of these elements however by exposing AXValue as editable. On iOS, we use traits to expose leaf elements with a non-native text control ancestor as editable for AT to supply proper context. Tests have been updated and added to reflect this change. This patch was authored by Josh Hoffman, built on work started by Chris Fleizach. * LayoutTests/accessibility/content-editable-property-change-expected.txt: Added. * LayoutTests/accessibility/content-editable-property-change.html: Added. * LayoutTests/accessibility/dynamically-unignored-contenteditable-expected.txt: * LayoutTests/accessibility/ios-simulator/content-editable-expected.txt: Added. * LayoutTests/accessibility/ios-simulator/content-editable.html: Added. * LayoutTests/accessibility/mac/active-descendant-with-aria-controls-expected.txt: * LayoutTests/accessibility/mac/relationships-in-frames-expected.txt: * LayoutTests/accessibility/mac/set-value-editable-dispatch-events-expected.txt: * LayoutTests/accessibility/mac/set-value-editable-types-expected.txt: * LayoutTests/accessibility/nested-textareas-value-changed-notifications-expected.txt: * LayoutTests/platform/glib/TestExpectations: * LayoutTests/platform/glib/accessibility/content-editable-as-textarea-expected.txt: * LayoutTests/platform/glib/accessibility/dynamically-unignored-contenteditable-expected.txt: * LayoutTests/platform/mac-wk1/TestExpectations: * LayoutTests/platform/mac/accessibility/content-editable-as-textarea-expected.txt: * Source/WebCore/accessibility/AXCoreObject.cpp: (WebCore::AXCoreObject::isTextControl const): * Source/WebCore/accessibility/AXLogger.cpp: (WebCore::operator<<): * Source/WebCore/accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::handleAttributeChange): (WebCore::AXObjectCache::updateIsolatedTree): * Source/WebCore/accessibility/AXObjectCache.h: * Source/WebCore/accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::matchesTextAreaRole const): (WebCore::AccessibilityNodeObject::determineAccessibilityRoleFromNode const): * Source/WebCore/accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isNonNativeTextControl const): * Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityTraits]): (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]): (-[WebAccessibilityObjectWrapper accessibilityIsInNonNativeTextControl]): * Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeProperties): (WebCore::AXIsolatedObject::isNonNativeTextControl const): Deleted. * Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h: * Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::updateNodeProperties): * Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h: * Tools/DumpRenderTree/AccessibilityUIElement.cpp: (getIsInNonNativeTextControlCallback): (AccessibilityUIElement::getJSClass): * Tools/DumpRenderTree/AccessibilityUIElement.h: * Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm: (AccessibilityUIElement::isInNonNativeTextControl const): * Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h: * Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl: * Tools/WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp: (WTR::AccessibilityUIElement::isInNonNativeTextControl const): * Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm: (WTR::AccessibilityUIElement::isInNonNativeTextControl const): * Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm: (WTR::AccessibilityUIElement::isInNonNativeTextControl const): * Tools/WebKitTestRunner/InjectedBundle/win/AccessibilityUIElementWin.cpp: (WTR::AccessibilityUIElement::isInNonNativeTextControl const): Canonical link: https://commits.webkit.org/270935@main
- Loading branch information
Showing
33 changed files
with
179 additions
and
21 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
LayoutTests/accessibility/content-editable-property-change-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,9 @@ | ||
This test ensures that changes to the contenteditable property are reflected in accessibility | ||
|
||
PASS: button.editableAncestor() === null | ||
PASS: button.editableAncestor().domIdentifier === 'content' | ||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
Press Me |
28 changes: 28 additions & 0 deletions
28
LayoutTests/accessibility/content-editable-property-change.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,28 @@ | ||
<html> | ||
<head> | ||
<script src="../resources/accessibility-helper.js"></script> | ||
<script src="../resources/js-test.js"></script> | ||
</head> | ||
<body> | ||
|
||
<div id="content"> | ||
<button id="button">Press Me</button> | ||
</div> | ||
|
||
<script> | ||
let output = "This test ensures that changes to the contenteditable property are reflected in accessibility\n\n"; | ||
if (window.accessibilityController) { | ||
window.jsTestIsAsync = true; | ||
var button = accessibilityController.accessibleElementById("button"); | ||
output += expect("button.editableAncestor()", "null"); | ||
|
||
document.getElementById("content").contentEditable = "true"; | ||
setTimeout(async () => { | ||
await waitFor(() => button.editableAncestor()); | ||
output += expect("button.editableAncestor().domIdentifier", "'content'"); | ||
debug(output); | ||
finishJSTest(); | ||
}); | ||
} | ||
</script> | ||
</body> |
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
13 changes: 13 additions & 0 deletions
13
LayoutTests/accessibility/ios-simulator/content-editable-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,13 @@ | ||
This test makes sure that the content editable method on iOS works as expected. | ||
PASS: text1.isInNonNativeTextControl === true | ||
PASS: text2.isInNonNativeTextControl === true | ||
PASS: text3.isInNonNativeTextControl === false | ||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
Text inside | ||
|
||
Nested text inside | ||
|
||
Text outside |
35 changes: 35 additions & 0 deletions
35
LayoutTests/accessibility/ios-simulator/content-editable.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,35 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../../resources/js-test.js"></script> | ||
<script src="../../resources/accessibility-helper.js"></script> | ||
</head> | ||
<body> | ||
|
||
<div id="editable1" contenteditable="true"> | ||
<p id="text1">Text inside</p> | ||
<div> | ||
<p id="text2">Nested text inside</p> | ||
</div> | ||
</div> | ||
|
||
<p id="text3">Text outside</p> | ||
|
||
<script> | ||
var output = "This test makes sure that the content editable method on iOS works as expected.\n"; | ||
|
||
if (window.accessibilityController) { | ||
var text1 = accessibilityController.accessibleElementById("text1").childAtIndex(0); | ||
output += expect("text1.isInNonNativeTextControl", "true"); | ||
|
||
var text2 = accessibilityController.accessibleElementById("text2").childAtIndex(0); | ||
output += expect("text2.isInNonNativeTextControl", "true"); | ||
|
||
var text3 = accessibilityController.accessibleElementById("text3").childAtIndex(0); | ||
output += expect("text3.isInNonNativeTextControl", "false"); | ||
|
||
debug(output); | ||
} | ||
</script> | ||
</body> | ||
</html> |
2 changes: 1 addition & 1 deletion
2
LayoutTests/accessibility/mac/active-descendant-with-aria-controls-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
2 changes: 1 addition & 1 deletion
2
LayoutTests/accessibility/mac/relationships-in-frames-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
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
2 changes: 1 addition & 1 deletion
2
LayoutTests/platform/mac/accessibility/content-editable-as-textarea-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
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
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
Oops, something went wrong.