Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
AX: Implement the ARIA 1.3 mark role, which provides parity with the …
…<mark> tag. https://bugs.webkit.org/show_bug.cgi?id=206251 rdar://58577388 Reviewed by Andres Gonzalez. This patch exposes the new ARIA 1.3 mark role. This will allow AX clients to access and convey this content to users. * LayoutTests/accessibility/display-contents-element-roles-expected.txt * LayoutTests/accessibility/roles-computedRoleString.html * LayoutTests/platform/mac-wk2/accessibility/aria-visible-element-roles-expected.txt * LayoutTests/platform/mac/accessibility/roles-computedRoleString-expected.txt * LayoutTests/platform/glib/accessibility/display-contents-element-roles-expected.txt: * LayoutTests/platform/mac-wk1/accessibility/aria-visible-element-roles-expected.txt: * LayoutTests/platform/glib/accessibility/aria-visible-element-roles-expected.txt Updated old layouttests and expectations to correspond with the new "mark" role mapping. * LayoutTests/accessibility/ios-simulator/mark-role-expected.txt: Added. * LayoutTests/accessibility/ios-simulator/mark-role.html: Added. * LayoutTests/accessibility/mac/mark-role-expected.txt: Added. * LayoutTests/accessibility/mac/mark-role.html: Added. New layout tests. * Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityIsMarkAnnotation]): * Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (AXAttributeStringSetStyle): Set's an "AXHighlight" attribute on strings that have an ancestor with a mark role. * Source/WebCore/accessibility/AccessibilityObject.cpp * Source/WebCore/accessibility/AccessibilityNodeObject.cpp Add condition to check for roleAttr = "mark". * Tools/DumpRenderTree/AccessibilityUIElement.cpp: (getIsMarkAnnotationCallback): (AccessibilityUIElement::getJSClass): * Tools/DumpRenderTree/AccessibilityUIElement.h: * Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm: (AccessibilityUIElement::isMarkAnnotation const): * Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp: (WTR::AccessibilityUIElement::isMarkAnnotation const): * Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h: * Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl: * Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm: (WTR::AccessibilityUIElement::isMarkAnnotation const): New methods to check if an element has a mark-role ancestor. Canonical link: https://commits.webkit.org/254008@main
- Loading branch information
1 parent
321c28b
commit 335a5587c31289a3a8043e4c460f7488c59e947b
Showing
22 changed files
with
119 additions
and
3 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
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 makes sure that the mark role exposes the right attributes. | ||
PASS: highlight1.isMarkAnnotation === true | ||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
This is some | ||
highlighted | ||
text. |
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,25 @@ | ||
<!DOCTYPE HTML PUBLIC> | ||
<html> | ||
<head> | ||
<script src="../../resources/js-test.js"></script> | ||
<script src="../../resources/accessibility-helper.js"></script> | ||
</head> | ||
<body> | ||
|
||
<div>This is some <div id="highlight1" role="mark">highlighted</div> text.</div> | ||
|
||
<script> | ||
|
||
if (window.accessibilityController) { | ||
let output = "This test makes sure that the mark role exposes the right attributes.\n"; | ||
|
||
var highlight1 = accessibilityController.accessibleElementById("highlight1").childAtIndex(0); | ||
output += expect("highlight1.isMarkAnnotation", "true"); | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
This test makes sure that the mark role exposes the right attributes in the attriubuted string. | ||
PASS: highlight1.attributedStringForTextMarkerRangeContainsAttribute('AXHighlight', markerRange) === true | ||
PASS: highlight2.attributedStringForTextMarkerRangeContainsAttribute('AXHighlight', markerRange) === true | ||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
This is some | ||
highlighted | ||
text. | ||
This is some highlighted text. |
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,31 @@ | ||
<!DOCTYPE HTML PUBLIC> | ||
<html> | ||
<head> | ||
<script src="../../resources/js-test.js"></script> | ||
<script src="../../resources/accessibility-helper.js"></script> | ||
</head> | ||
<body> | ||
|
||
<div>This is some <div id="highlight1" role="mark">highlighted</div> text.</div> | ||
<div>This is some <mark id="highlight2">highlighted</mark> text.</div> | ||
|
||
<script> | ||
|
||
if (window.accessibilityController) { | ||
let output = "This test makes sure that the mark role exposes the right attributes in the attriubuted string.\n"; | ||
|
||
var highlight1 = accessibilityController.accessibleElementById("highlight1").childAtIndex(0); | ||
var markerRange = highlight1.textMarkerRangeForElement(highlight1); | ||
output += expect("highlight1.attributedStringForTextMarkerRangeContainsAttribute('AXHighlight', markerRange)", "true"); | ||
|
||
var highlight2 = accessibilityController.accessibleElementById("highlight2").childAtIndex(0); | ||
var markerRange = highlight2.textMarkerRangeForElement(highlight2); | ||
output += expect("highlight2.attributedStringForTextMarkerRangeContainsAttribute('AXHighlight', markerRange)", "true"); | ||
|
||
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
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