Title: [280705] trunk
Revision
280705
Author
[email protected]
Date
2021-08-05 15:47:59 -0700 (Thu, 05 Aug 2021)

Log Message

VoiceOver is not announcing the state as selected/unselected when an item is selected in a grid.
https://bugs.webkit.org/show_bug.cgi?id=228840
<rdar://78225826>

Reviewed by Chris Fleizach.

Source/WebCore:

Test: accessibility/selected-state-changed-notifications.html.

On iOS, a table/grid cell element is not exposed to AX clients. Instead
the content of the cell is. This patch ensures that if the cell element
is selected, the AX objects that represent the content inside the cell
will inherit the selected state from the cell.

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):

LayoutTests:

* accessibility/selected-state-changed-notifications.html:
* platform/ios/TestExpectations:
* platform/ios/accessibility/selected-state-changed-notifications-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (280704 => 280705)


--- trunk/LayoutTests/ChangeLog	2021-08-05 22:39:57 UTC (rev 280704)
+++ trunk/LayoutTests/ChangeLog	2021-08-05 22:47:59 UTC (rev 280705)
@@ -1,3 +1,15 @@
+2021-08-05  Andres Gonzalez  <[email protected]>
+
+        VoiceOver is not announcing the state as selected/unselected when an item is selected in a grid.
+        https://bugs.webkit.org/show_bug.cgi?id=228840
+        <rdar://78225826>
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/selected-state-changed-notifications.html:
+        * platform/ios/TestExpectations:
+        * platform/ios/accessibility/selected-state-changed-notifications-expected.txt: Added.
+
 2021-08-05  Tim Nguyen  <[email protected]>
 
         Implement support for <dialog> element cancel event

Modified: trunk/LayoutTests/accessibility/selected-state-changed-notifications.html (280704 => 280705)


--- trunk/LayoutTests/accessibility/selected-state-changed-notifications.html	2021-08-05 22:39:57 UTC (rev 280704)
+++ trunk/LayoutTests/accessibility/selected-state-changed-notifications.html	2021-08-05 22:47:59 UTC (rev 280705)
@@ -31,6 +31,7 @@
 
     if (window.accessibilityController) {
         window.jsTestIsAsync = true;
+        var platform = accessibilityController.platformName;
 
         var notificationCount = 0;
         accessibilityController.addNotificationListener((axElement, notification) => {
@@ -42,6 +43,10 @@
 
         var axSelectable = accessibilityController.accessibleElementById("selectable");
         shouldBeFalse("axSelectable.isSelected");
+        // On iOS, the cell element is not exposed to clients, but instead its content.
+        // So make sure that the selected state of the contained static text matches the state of the cell.
+        if (platform == "ios")
+            shouldBeFalse("axSelectable.children[0].isSelected");
 
         axSelectable.press();
         setTimeout(async () => {
@@ -49,6 +54,8 @@
                 return notificationCount == 1;
             });
             shouldBeTrue("axSelectable.isSelected");
+            if (platform == "ios")
+                shouldBeTrue("axSelectable.children[0].isSelected");
 
             axSelectable.press();
             await waitFor(() => {
@@ -55,6 +62,8 @@
                 return notificationCount == 2;
             });
             shouldBeFalse("axSelectable.isSelected");
+            if (platform == "ios")
+                shouldBeFalse("axSelectable.children[0].isSelected");
 
             finishJSTest();
         }, 0);

Modified: trunk/LayoutTests/platform/ios/TestExpectations (280704 => 280705)


--- trunk/LayoutTests/platform/ios/TestExpectations	2021-08-05 22:39:57 UTC (rev 280704)
+++ trunk/LayoutTests/platform/ios/TestExpectations	2021-08-05 22:47:59 UTC (rev 280705)
@@ -2102,6 +2102,8 @@
 # Enable "aria-table-attributes" test for iOS
 webkit.org/b/150366 accessibility/aria-table-attributes.html [ Pass ]
 
+accessibility/selected-state-changed-notifications.html [ Pass ]
+
 # Enable "attachment element" test for iOS
 accessibility/attachment-element.html [ Pass ]
 

Added: trunk/LayoutTests/platform/ios/accessibility/selected-state-changed-notifications-expected.txt (0 => 280705)


--- trunk/LayoutTests/platform/ios/accessibility/selected-state-changed-notifications-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios/accessibility/selected-state-changed-notifications-expected.txt	2021-08-05 22:47:59 UTC (rev 280705)
@@ -0,0 +1,18 @@
+This is not aria-selected.	XYZ
+This test ensures that the AXSelectedStateChanged notification is fired when the value for the aria-selected attribute changes in grid cells.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS axSelectable.isSelected is false
+PASS axSelectable.children[0].isSelected is false
+1 AXSelectedCellsChanged for element selectable
+PASS axSelectable.isSelected is true
+PASS axSelectable.children[0].isSelected is true
+2 AXSelectedCellsChanged for element selectable
+PASS axSelectable.isSelected is false
+PASS axSelectable.children[0].isSelected is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Modified: trunk/Source/WebCore/ChangeLog (280704 => 280705)


--- trunk/Source/WebCore/ChangeLog	2021-08-05 22:39:57 UTC (rev 280704)
+++ trunk/Source/WebCore/ChangeLog	2021-08-05 22:47:59 UTC (rev 280705)
@@ -1,3 +1,21 @@
+2021-08-05  Andres Gonzalez  <[email protected]>
+
+        VoiceOver is not announcing the state as selected/unselected when an item is selected in a grid.
+        https://bugs.webkit.org/show_bug.cgi?id=228840
+        <rdar://78225826>
+
+        Reviewed by Chris Fleizach.
+
+        Test: accessibility/selected-state-changed-notifications.html.
+
+        On iOS, a table/grid cell element is not exposed to AX clients. Instead
+        the content of the cell is. This patch ensures that if the cell element
+        is selected, the AX objects that represent the content inside the cell
+        will inherit the selected state from the cell.
+
+        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+        (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
+
 2021-08-05  Tim Nguyen  <[email protected]>
 
         Implement support for <dialog> element cancel event

Modified: trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (280704 => 280705)


--- trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm	2021-08-05 22:39:57 UTC (rev 280704)
+++ trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm	2021-08-05 22:47:59 UTC (rev 280705)
@@ -697,6 +697,11 @@
         case AccessibilityRole::Heading:
             traits |= [self _axHeaderTrait];
             break;
+        case AccessibilityRole::Cell:
+        case AccessibilityRole::GridCell:
+            if (parent->isSelected())
+                traits |= [self _axSelectedTrait];
+            break;
         default:
             if ([self _accessibilityIsLandmarkRole:parentRole])
                 traits |= [self _axContainedByLandmarkTrait];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to