AX: VoiceOver Unable to View Download Progress or Completion Status for Mail Attachments
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Jun 2016 06:06:08 +0000 (06:06 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Jun 2016 06:06:08 +0000 (06:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=158581

Reviewed by Darin Adler.

Source/WebCore:

Update attachment element accessibility so that:
   1) the action name comes first to match UI
   2) on iOS, it has the updates frequently trait

Make sure this test now runs on iOS as well.

Modified tests: accessibility/attachment-element.html

* accessibility/AccessibilityAttachment.cpp:
(WebCore::AccessibilityAttachment::accessibilityText):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
(-[WebAccessibilityObjectWrapper accessibilityTraits]):
(-[WebAccessibilityObjectWrapper accessibilityValue]):
(-[WebAccessibilityObjectWrapper accessibilityIsAttachmentElement]):
(-[WebAccessibilityObjectWrapper accessibilityIsComboBox]):

LayoutTests:

* accessibility/attachment-element-expected.txt:
* accessibility/attachment-element.html:
* accessibility/ios-simulator/attributed-string-for-range-expected.txt:
* platform/ios-simulator/TestExpectations:
* platform/ios-simulator/accessibility/attachment-element-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201913 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/accessibility/attachment-element-expected.txt
LayoutTests/accessibility/attachment-element.html
LayoutTests/accessibility/ios-simulator/attributed-string-for-range-expected.txt
LayoutTests/platform/ios-simulator/TestExpectations
LayoutTests/platform/ios-simulator/accessibility/attachment-element-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityAttachment.cpp
Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm

index 84c30a8..ce7332f 100644 (file)
@@ -1,3 +1,16 @@
+2016-06-09  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: VoiceOver Unable to View Download Progress or Completion Status for Mail Attachments
+        https://bugs.webkit.org/show_bug.cgi?id=158581
+
+        Reviewed by Darin Adler.
+
+        * accessibility/attachment-element-expected.txt:
+        * accessibility/attachment-element.html:
+        * accessibility/ios-simulator/attributed-string-for-range-expected.txt:
+        * platform/ios-simulator/TestExpectations:
+        * platform/ios-simulator/accessibility/attachment-element-expected.txt: Added.
+
 2016-06-09  Zalan Bujtas  <zalan@apple.com>
 
         Hairline borders do not show up on 3x displays.
index e7a404d..ead57f6 100644 (file)
@@ -4,7 +4,7 @@ This tests that attachment elements are accessible.
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-Attachment description: AXDescription: title, subtitle, action
+Attachment description: AXDescription: action, title, subtitle
 Attachment value: AXValue: 0.5
 Attachment role: AXRoleDescription: attachment
 PASS successfullyParsed is true
index 6680c58..0a883f2 100644 (file)
     if (window.accessibilityController) {
         var content = accessibilityController.accessibleElementById("attachment");
         debug("Attachment description: " + content.description);
+
         debug("Attachment value: " + content.stringValue);
-        debug("Attachment role: " + content.roleDescription);
+
+        if (accessibilityController.platformName == "mac") {
+            debug("Attachment role: " + content.roleDescription);
+        }
     }
 
 </script>
index fe77fa2..f49545d 100644 (file)
@@ -15,7 +15,7 @@ Attributed string: hello  {
     UIAccessibilityTokenFontName = "Times New Roman";
     UIAccessibilityTokenFontSize = 16;
 }{
-    UIAccessibilityTokenAttachment = "WebAccessibilityObjectWrapper: title, subtitle, action";
+    UIAccessibilityTokenAttachment = "WebAccessibilityObjectWrapper: action, title, subtitle";
 } {
     UIAccessibilityTokenFontFamily = "Times New Roman";
     UIAccessibilityTokenFontName = "Times New Roman";
index 972e034..c95a9b4 100644 (file)
@@ -2768,6 +2768,9 @@ webkit.org/b/149297 accessibility/aria-current.html [ Pass ]
 # Enable "aria-table-attributes" test for iOS
 webkit.org/b/150366 accessibility/aria-table-attributes.html [ Pass ]
 
+# Enable "attachment element" test for iOS
+accessibility/attachment-element.html [ Pass ]
+
 # Enable Text marker tests for iOS
 webkit.org/b/153292 accessibility/text-marker [ Pass ]
 
diff --git a/LayoutTests/platform/ios-simulator/accessibility/attachment-element-expected.txt b/LayoutTests/platform/ios-simulator/accessibility/attachment-element-expected.txt
new file mode 100644 (file)
index 0000000..bd41812
--- /dev/null
@@ -0,0 +1,12 @@
+
+This tests that attachment elements are accessible.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Attachment description: AXLabel: action, title, subtitle
+Attachment value: AXValue: 0.50
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
index feac2b5..47252d2 100644 (file)
@@ -1,3 +1,27 @@
+2016-06-09  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: VoiceOver Unable to View Download Progress or Completion Status for Mail Attachments
+        https://bugs.webkit.org/show_bug.cgi?id=158581
+
+        Reviewed by Darin Adler.
+
+        Update attachment element accessibility so that:
+           1) the action name comes first to match UI
+           2) on iOS, it has the updates frequently trait
+
+        Make sure this test now runs on iOS as well.
+
+        Modified tests: accessibility/attachment-element.html
+
+        * accessibility/AccessibilityAttachment.cpp:
+        (WebCore::AccessibilityAttachment::accessibilityText):
+        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+        (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
+        (-[WebAccessibilityObjectWrapper accessibilityTraits]):
+        (-[WebAccessibilityObjectWrapper accessibilityValue]):
+        (-[WebAccessibilityObjectWrapper accessibilityIsAttachmentElement]):
+        (-[WebAccessibilityObjectWrapper accessibilityIsComboBox]):
+
 2016-06-09  Alex Christensen  <achristensen@webkit.org>
 
         Clean up WebCore.vcxproj after switching to CMake.
index 2f3f3e9..a7d3c37 100644 (file)
@@ -94,14 +94,14 @@ void AccessibilityAttachment::accessibilityText(Vector<AccessibilityText>& textO
     auto& subtitle = getAttribute(subtitleAttr);
     auto& action = getAttribute(actionAttr);
     
+    if (action.length())
+        textOrder.append(AccessibilityText(action, ActionText));
+
     if (title.length())
         textOrder.append(AccessibilityText(title, TitleText));
 
     if (subtitle.length())
         textOrder.append(AccessibilityText(subtitle, SubtitleText));
-    
-    if (action.length())
-        textOrder.append(AccessibilityText(action, ActionText));
 }
 
 } // namespace WebCore
index 7ef3da7..894da9f 100644 (file)
@@ -326,6 +326,7 @@ static AccessibilityObjectWrapper* AccessibilityUnignoredAncestor(AccessibilityO
 - (uint64_t)_axContainedByFieldsetTrait { return (1 << 22); }
 - (uint64_t)_axSearchFieldTrait { return (1 << 23); }
 - (uint64_t)_axTextAreaTrait { return (1 << 24); }
+- (uint64_t)_axUpdatesFrequentlyTrait { return (1 << 25); }
 
 - (BOOL)accessibilityCanFuzzyHitTest
 {
@@ -698,6 +699,9 @@ static AccessibilityObjectWrapper* AccessibilityUnignoredAncestor(AccessibilityO
             break;
     }
 
+    if (m_object->isAttachmentElement())
+        traits |= [self _axUpdatesFrequentlyTrait];
+    
     if (m_object->isSelected())
         traits |= [self _axSelectedTrait];
 
@@ -1275,6 +1279,14 @@ static void appendStringToResult(NSMutableString *result, NSString *string)
     return nil;
 }
 
+- (BOOL)accessibilityIsAttachmentElement
+{
+    if (![self _prepareAccessibilityCall])
+        return NO;
+
+    return is<AccessibilityAttachment>(m_object);
+}
+
 - (BOOL)accessibilityIsComboBox
 {
     if (![self _prepareAccessibilityCall])