Title: [204563] trunk
Revision
204563
Author
[email protected]
Date
2016-08-17 11:01:41 -0700 (Wed, 17 Aug 2016)

Log Message

AX: Support abbreviations in iOS
https://bugs.webkit.org/show_bug.cgi?id=160907

Reviewed by Joanmarie Diggs.

Source/WebCore:

Expose the expandedTextValue attribute for iOS, so that VoiceOver can speak abbreviations correctly.

Test: accessibility/ios-simulator/abbreviation.html

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper textMarkersForRange:]):
(-[WebAccessibilityObjectWrapper accessibilityExpandedTextValue]):
(-[WebAccessibilityObjectWrapper accessibilityIdentifier]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(AXAttributeStringSetSpelling):
(AXAttributeStringSetExpandedTextValue):
(AXAttributedStringAppendText):
(AXAttributeStringSetexpandedTextValue): Deleted.

Tools:

* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::stringAttributeValue):
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::stringAttributeValue):

LayoutTests:

* accessibility/ios-simulator/abbreviation-expected.txt: Added.
* accessibility/ios-simulator/abbreviation.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (204562 => 204563)


--- trunk/LayoutTests/ChangeLog	2016-08-17 17:48:59 UTC (rev 204562)
+++ trunk/LayoutTests/ChangeLog	2016-08-17 18:01:41 UTC (rev 204563)
@@ -1,3 +1,13 @@
+2016-08-17  Chris Fleizach  <[email protected]>
+
+        AX: Support abbreviations in iOS
+        https://bugs.webkit.org/show_bug.cgi?id=160907
+
+        Reviewed by Joanmarie Diggs.
+
+        * accessibility/ios-simulator/abbreviation-expected.txt: Added.
+        * accessibility/ios-simulator/abbreviation.html: Added.
+
 2016-08-16  Simon Fraser  <[email protected]>
 
         [iOS WK2] Don't throw touchMove events on the floor

Added: trunk/LayoutTests/accessibility/ios-simulator/abbreviation-expected.txt (0 => 204563)


--- trunk/LayoutTests/accessibility/ios-simulator/abbreviation-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/ios-simulator/abbreviation-expected.txt	2016-08-17 18:01:41 UTC (rev 204563)
@@ -0,0 +1,12 @@
+IRS
+This tests that expanded text values can be retrieved.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS text.description is 'AXLabel: IRS'
+PASS text.stringAttributeValue('AXExpandedTextValue') is 'Internal Revenue Service'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/accessibility/ios-simulator/abbreviation.html (0 => 204563)


--- trunk/LayoutTests/accessibility/ios-simulator/abbreviation.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/ios-simulator/abbreviation.html	2016-08-17 18:01:41 UTC (rev 204563)
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+<script>
+var successfullyParsed = false;
+</script>
+</head>
+<body id="body">
+
+<abbr id="content" title='Internal Revenue Service'>IRS</abbr>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that expanded text values can be retrieved.");
+
+    if (window.accessibilityController) {
+
+        var text = accessibilityController.accessibleElementById("content").childAtIndex(0);
+        
+        shouldBe("text.description", "'AXLabel: IRS'");
+        shouldBe("text.stringAttributeValue('AXExpandedTextValue')", "'Internal Revenue Service'");
+    }
+
+    successfullyParsed = true;
+</script>
+
+<script src=""
+</body>
+</html>
+

Modified: trunk/Source/WebCore/ChangeLog (204562 => 204563)


--- trunk/Source/WebCore/ChangeLog	2016-08-17 17:48:59 UTC (rev 204562)
+++ trunk/Source/WebCore/ChangeLog	2016-08-17 18:01:41 UTC (rev 204563)
@@ -1,3 +1,24 @@
+2016-08-17  Chris Fleizach  <[email protected]>
+
+        AX: Support abbreviations in iOS
+        https://bugs.webkit.org/show_bug.cgi?id=160907
+
+        Reviewed by Joanmarie Diggs.
+
+        Expose the expandedTextValue attribute for iOS, so that VoiceOver can speak abbreviations correctly.
+
+        Test: accessibility/ios-simulator/abbreviation.html
+
+        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+        (-[WebAccessibilityObjectWrapper textMarkersForRange:]):
+        (-[WebAccessibilityObjectWrapper accessibilityExpandedTextValue]):
+        (-[WebAccessibilityObjectWrapper accessibilityIdentifier]):
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (AXAttributeStringSetSpelling):
+        (AXAttributeStringSetExpandedTextValue):
+        (AXAttributedStringAppendText):
+        (AXAttributeStringSetexpandedTextValue): Deleted.
+
 2016-08-17  Antti Koivisto  <[email protected]>
 
         Remove StyleCachedImageSet

Modified: trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (204562 => 204563)


--- trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm	2016-08-17 17:48:59 UTC (rev 204562)
+++ trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm	2016-08-17 18:01:41 UTC (rev 204563)
@@ -2592,6 +2592,13 @@
     return [NSArray arrayWithObjects:start, end, nil];
 }
 
+- (NSString *)accessibilityExpandedTextValue
+{
+    if (![self _prepareAccessibilityCall])
+        return nil;
+    return m_object->expandedTextValue();
+}
+
 - (NSString *)accessibilityIdentifier
 {
     if (![self _prepareAccessibilityCall])

Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (204562 => 204563)


--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2016-08-17 17:48:59 UTC (rev 204562)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2016-08-17 18:01:41 UTC (rev 204563)
@@ -1194,7 +1194,7 @@
     }
 }
 
-static void AXAttributeStringSetexpandedTextValue(NSMutableAttributedString *attrString, RenderObject* renderer, NSRange range)
+static void AXAttributeStringSetExpandedTextValue(NSMutableAttributedString *attrString, RenderObject* renderer, NSRange range)
 {
     if (!renderer || !AXAttributedStringRangeIsValid(attrString, range))
         return;
@@ -1283,7 +1283,7 @@
     AXAttributeStringSetStyle(attrString, renderer, attrStringRange);
     AXAttributeStringSetHeadingLevel(attrString, renderer, attrStringRange);
     AXAttributeStringSetBlockquoteLevel(attrString, renderer, attrStringRange);
-    AXAttributeStringSetexpandedTextValue(attrString, renderer, attrStringRange);
+    AXAttributeStringSetExpandedTextValue(attrString, renderer, attrStringRange);
     AXAttributeStringSetElement(attrString, NSAccessibilityLinkTextAttribute, AccessibilityObject::anchorElementForNode(node), attrStringRange);
     
     // do spelling last because it tends to break up the range

Modified: trunk/Tools/ChangeLog (204562 => 204563)


--- trunk/Tools/ChangeLog	2016-08-17 17:48:59 UTC (rev 204562)
+++ trunk/Tools/ChangeLog	2016-08-17 18:01:41 UTC (rev 204563)
@@ -1,3 +1,15 @@
+2016-08-17  Chris Fleizach  <[email protected]>
+
+        AX: Support abbreviations in iOS
+        https://bugs.webkit.org/show_bug.cgi?id=160907
+
+        Reviewed by Joanmarie Diggs.
+
+        * DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
+        (AccessibilityUIElement::stringAttributeValue):
+        * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
+        (WTR::AccessibilityUIElement::stringAttributeValue):
+
 2016-08-17  Gyuyoung Kim  <[email protected]>
 
         [EFL] Bump efl version from 1.17 to 1.18

Modified: trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm (204562 => 204563)


--- trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm	2016-08-17 17:48:59 UTC (rev 204562)
+++ trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm	2016-08-17 18:01:41 UTC (rev 204563)
@@ -96,6 +96,7 @@
 - (UIAccessibilityTraits)_axContainedByFieldsetTrait;
 - (id)_accessibilityFieldsetAncestor;
 - (BOOL)_accessibilityHasTouchEventListener;
+- (NSString *)accessibilityExpandedTextValue;
 
 // TextMarker related
 - (NSArray *)textMarkerRange;
@@ -647,6 +648,9 @@
     
     if (JSStringIsEqualToUTF8CString(attribute, "AXARIACurrent"))
         return [[m_element accessibilityARIACurrentStatus] createJSStringRef];
+
+    if (JSStringIsEqualToUTF8CString(attribute, "AXExpandedTextValue"))
+        return [[m_element accessibilityExpandedTextValue] createJSStringRef];
     
     return JSStringCreateWithCharacters(0, 0);
 }

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm (204562 => 204563)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm	2016-08-17 17:48:59 UTC (rev 204562)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm	2016-08-17 18:01:41 UTC (rev 204563)
@@ -73,6 +73,7 @@
 - (UIAccessibilityTraits)_axContainedByFieldsetTrait;
 - (id)_accessibilityFieldsetAncestor;
 - (BOOL)_accessibilityHasTouchEventListener;
+- (NSString *)accessibilityExpandedTextValue;
 
 // TextMarker related
 - (NSArray *)textMarkerRange;
@@ -339,7 +340,10 @@
     
     if (JSStringIsEqualToUTF8CString(attribute, "AXARIACurrent"))
         return [[m_element accessibilityARIACurrentStatus] createJSStringRef];
-    
+
+    if (JSStringIsEqualToUTF8CString(attribute, "AXExpandedTextValue"))
+        return [[m_element accessibilityExpandedTextValue] createJSStringRef];
+
     return JSStringCreateWithCharacters(0, 0);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to