Title: [271790] trunk
Revision
271790
Author
cfleiz...@apple.com
Date
2021-01-25 04:28:27 -0800 (Mon, 25 Jan 2021)

Log Message

AX: iOS: VO: Web: Column Names Not Announced
https://bugs.webkit.org/show_bug.cgi?id=220829
<rdar://problem/73469037>

Reviewed by Zalan Bujtas.

Source/WebCore:

We no longer use containedInTraits, but mean to override the tableAncestor methods.
Those need to account for the three types of tables.

Test: accessibility/ios-simulator/table-ancestory.html

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

Tools:

* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
(WTR::AccessibilityUIElement::isInTable const):
(WTR::AccessibilityUIElement::isInLandmark const):
(WTR::AccessibilityUIElement::isInList const):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::isInTable const):
(WTR::AccessibilityUIElement::isInLandmark const):
(WTR::AccessibilityUIElement::isInList const):

LayoutTests:

* accessibility/ios-simulator/table-ancestory.html: Added.
* accessibility/ios-simulator/table-ancestory-expected.txt: Added.
* accessibility/ios-simulator/tables-lists.html: Updated.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (271789 => 271790)


--- trunk/LayoutTests/ChangeLog	2021-01-25 10:23:06 UTC (rev 271789)
+++ trunk/LayoutTests/ChangeLog	2021-01-25 12:28:27 UTC (rev 271790)
@@ -1,3 +1,15 @@
+2021-01-25  Chris Fleizach  <cfleiz...@apple.com>
+
+        AX: iOS: VO: Web: Column Names Not Announced
+        https://bugs.webkit.org/show_bug.cgi?id=220829
+        <rdar://problem/73469037>
+
+        Reviewed by Zalan Bujtas.
+
+        * accessibility/ios-simulator/table-ancestory.html: Added.
+        * accessibility/ios-simulator/table-ancestory-expected.txt: Added.
+        * accessibility/ios-simulator/tables-lists.html: Updated.
+
 2021-01-25  Martin Robinson  <mrobin...@igalia.com>
 
         scroll-padding should affect paging operations

Added: trunk/LayoutTests/accessibility/ios-simulator/table-ancestory-expected.txt (0 => 271790)


--- trunk/LayoutTests/accessibility/ios-simulator/table-ancestory-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/ios-simulator/table-ancestory-expected.txt	2021-01-25 12:28:27 UTC (rev 271790)
@@ -0,0 +1,16 @@
+c
+a
+b
+1
+This tests that objects in various kinds of tables report they are in the table.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS button1.isInTable is true
+PASS button2.isInTable is true
+PASS button3.isInTable is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/accessibility/ios-simulator/table-ancestory.html (0 => 271790)


--- trunk/LayoutTests/accessibility/ios-simulator/table-ancestory.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/ios-simulator/table-ancestory.html	2021-01-25 12:28:27 UTC (rev 271790)
@@ -0,0 +1,57 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+<script>
+var successfullyParsed = false;
+</script>
+</head>
+<body id="body">
+
+<div role="button" id="button3">c</div>
+
+<div role="grid">
+  <div role="row">
+     <div role="gridcell">
+      <div role="button" id="button1">a</div>
+     </div>
+  </div>
+</div>
+
+<table border=1>
+  <tr>
+    <td>
+      <div role="button" id="button2">b</div>
+    </td>
+    <td>
+      <button>1</button>
+    </td>
+  </tr>
+</table>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that objects in various kinds of tables report they are in the table.");
+
+    if (window.accessibilityController) {
+
+        var button1 = accessibilityController.accessibleElementById("button1");
+        shouldBeTrue("button1.isInTable");
+
+        var button2 = accessibilityController.accessibleElementById("button2");
+        shouldBeTrue("button2.isInTable");
+
+        var button3 = accessibilityController.accessibleElementById("button3");
+        shouldBeFalse("button3.isInTable");
+    }
+
+    successfullyParsed = true;
+</script>
+
+<script src=""
+</body>
+</html>
+

Modified: trunk/LayoutTests/accessibility/ios-simulator/tables-lists-expected.txt (271789 => 271790)


--- trunk/LayoutTests/accessibility/ios-simulator/tables-lists-expected.txt	2021-01-25 10:23:06 UTC (rev 271789)
+++ trunk/LayoutTests/accessibility/ios-simulator/tables-lists-expected.txt	2021-01-25 12:28:27 UTC (rev 271790)
@@ -8,13 +8,10 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS listItem.traits != initialItem.traits is true
-PASS listItem.traits != tableItem.traits is true
-PASS listItem.traits != landmarkItem.traits is true
-PASS tableItem.traits != initialItem.traits is true
-PASS tableItem.traits != landmarkItem.traits is true
-PASS landmarkItem.traits != initialItem.traits is true
-PASS nonTableItem.traits != tableItem.traits is true
+PASS listItem.isInList is true
+PASS tableItem.isInTable is true
+PASS landmarkItem.isInLandmark is true
+PASS nonTableItem.isInTable is false
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/accessibility/ios-simulator/tables-lists.html (271789 => 271790)


--- trunk/LayoutTests/accessibility/ios-simulator/tables-lists.html	2021-01-25 10:23:06 UTC (rev 271789)
+++ trunk/LayoutTests/accessibility/ios-simulator/tables-lists.html	2021-01-25 12:28:27 UTC (rev 271790)
@@ -49,16 +49,11 @@
         var landmarkItem = root.childAtIndex(3).childAtIndex(0);
         var nonTableItem = root.childAtIndex(4);
 
-        shouldBe("listItem.traits != initialItem.traits", "true");
-        shouldBe("listItem.traits != tableItem.traits", "true");
-        shouldBe("listItem.traits != landmarkItem.traits", "true");
+        shouldBe("listItem.isInList", "true");
+        shouldBe("tableItem.isInTable", "true");
+        shouldBe("landmarkItem.isInLandmark", "true");
 
-        shouldBe("tableItem.traits != initialItem.traits", "true");
-        shouldBe("tableItem.traits != landmarkItem.traits", "true");
-
-        shouldBe("landmarkItem.traits != initialItem.traits", "true");
-
-        shouldBe("nonTableItem.traits != tableItem.traits", "true");
+        shouldBe("nonTableItem.isInTable", "false");
     }
 
     successfullyParsed = true;

Modified: trunk/Source/WebCore/ChangeLog (271789 => 271790)


--- trunk/Source/WebCore/ChangeLog	2021-01-25 10:23:06 UTC (rev 271789)
+++ trunk/Source/WebCore/ChangeLog	2021-01-25 12:28:27 UTC (rev 271790)
@@ -1,3 +1,20 @@
+2021-01-25  Chris Fleizach  <cfleiz...@apple.com>
+
+        AX: iOS: VO: Web: Column Names Not Announced
+        https://bugs.webkit.org/show_bug.cgi?id=220829
+        <rdar://problem/73469037>
+
+        Reviewed by Zalan Bujtas.
+
+        We no longer use containedInTraits, but mean to override the tableAncestor methods.
+        Those need to account for the three types of tables.
+
+        Test: accessibility/ios-simulator/table-ancestory.html
+
+        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+        (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
+        (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
+
 2021-01-25  Martin Robinson  <mrobin...@igalia.com>
 
         scroll-padding should affect paging operations

Modified: trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (271789 => 271790)


--- trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm	2021-01-25 10:23:06 UTC (rev 271789)
+++ trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm	2021-01-25 12:28:27 UTC (rev 271790)
@@ -611,7 +611,14 @@
 - (AccessibilityObjectWrapper*)_accessibilityTableAncestor
 {
     if (const AXCoreObject* parent = Accessibility::findAncestor<AXCoreObject>(*self.axBackingObject, false, [] (const AXCoreObject& object) {
-        return object.roleValue() == AccessibilityRole::Table;
+        switch (object.roleValue()) {
+        case AccessibilityRole::Table:
+        case AccessibilityRole::TreeGrid:
+        case AccessibilityRole::Grid:
+            return true;
+        default:
+            return false;
+        }
     }))
         return parent->wrapper();
     return nil;
@@ -680,15 +687,6 @@
             [self setAccessibilityValue:[wrapper accessibilityValue]];
             break;
         }
-        case AccessibilityRole::ListBox:
-        case AccessibilityRole::List:
-            traits |= [self _axContainedByListTrait];
-            break;
-        case AccessibilityRole::Grid:
-        case AccessibilityRole::Table:
-        case AccessibilityRole::TreeGrid:
-            traits |= [self _axContainedByTableTrait];
-            break;
         default:
             if ([self _accessibilityIsLandmarkRole:parentRole])
                 traits |= [self _axContainedByLandmarkTrait];

Modified: trunk/Tools/ChangeLog (271789 => 271790)


--- trunk/Tools/ChangeLog	2021-01-25 10:23:06 UTC (rev 271789)
+++ trunk/Tools/ChangeLog	2021-01-25 12:28:27 UTC (rev 271790)
@@ -1,3 +1,22 @@
+2021-01-25  Chris Fleizach  <cfleiz...@apple.com>
+
+        AX: iOS: VO: Web: Column Names Not Announced
+        https://bugs.webkit.org/show_bug.cgi?id=220829
+        <rdar://problem/73469037>
+
+        Reviewed by Zalan Bujtas.
+
+        * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
+        (WTR::AccessibilityUIElement::isInTable const):
+        (WTR::AccessibilityUIElement::isInLandmark const):
+        (WTR::AccessibilityUIElement::isInList const):
+        * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
+        * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
+        * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
+        (WTR::AccessibilityUIElement::isInTable const):
+        (WTR::AccessibilityUIElement::isInLandmark const):
+        (WTR::AccessibilityUIElement::isInList const):
+
 2021-01-25  Alicia Boya GarcĂ­a  <ab...@igalia.com>
 
         [GTK] run-gtk-tests: Use sys.exit(1) instead of return 1

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp (271789 => 271790)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp	2021-01-25 10:23:06 UTC (rev 271789)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp	2021-01-25 12:28:27 UTC (rev 271790)
@@ -88,6 +88,9 @@
 RefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeMatchesTextNearMarkers(JSStringRef, AccessibilityTextMarker*, AccessibilityTextMarker*) { return nullptr; }
 JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForElement() { return nullptr; }
 bool AccessibilityUIElement::isInTableCell() const { return false; }
+bool AccessibilityUIElement::isInTable() const { return false; }
+bool AccessibilityUIElement::isInLandmark() const { return false; }
+bool AccessibilityUIElement::isInList() const { return false; }
 #endif
     
 // Unsupported methods on various platforms. As they're implemented on other platforms this list should be modified.

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h (271789 => 271790)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h	2021-01-25 10:23:06 UTC (rev 271789)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h	2021-01-25 12:28:27 UTC (rev 271790)
@@ -202,6 +202,9 @@
     JSRetainPtr<JSStringRef> attributesOfVisibleCells();
     JSRetainPtr<JSStringRef> attributesOfHeader();
     bool isInTableCell() const;
+    bool isInTable() const;
+    bool isInList() const;
+    bool isInLandmark() const;
     int indexInTable();
     JSRetainPtr<JSStringRef> rowIndexRange();
     JSRetainPtr<JSStringRef> columnIndexRange();

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl (271789 => 271790)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl	2021-01-25 10:23:06 UTC (rev 271789)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl	2021-01-25 12:28:27 UTC (rev 271790)
@@ -154,6 +154,9 @@
     AccessibilityUIElement disclosedRowAtIndex(unsigned long index);
     AccessibilityUIElement rowAtIndex(unsigned long index);
     boolean isInTableCell();
+    readonly attribute boolean isInTable;
+    readonly attribute boolean isInLandmark;
+    readonly attribute boolean isInList;
     long indexInTable();
     DOMString rowIndexRange();
     DOMString columnIndexRange();

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm (271789 => 271790)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm	2021-01-25 10:23:06 UTC (rev 271789)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm	2021-01-25 12:28:27 UTC (rev 271790)
@@ -95,6 +95,9 @@
 - (BOOL)accessibilityHasPopup;
 - (NSString *)accessibilityPopupValue;
 - (NSString *)accessibilityColorStringValue;
+- (id)_accessibilityTableAncestor;
+- (id)_accessibilityLandmarkAncestor;
+- (id)_accessibilityListAncestor;
 
 // TextMarker related
 - (NSArray *)textMarkerRange;
@@ -792,6 +795,21 @@
     return [m_element _accessibilityIsInTableCell];
 }
 
+bool AccessibilityUIElement::isInTable() const
+{
+    return [m_element _accessibilityTableAncestor] != nullptr;
+}
+
+bool AccessibilityUIElement::isInLandmark() const
+{
+    return [m_element _accessibilityLandmarkAncestor] != nullptr;
+}
+
+bool AccessibilityUIElement::isInList() const
+{
+    return [m_element _accessibilityListAncestor] != nullptr;
+}
+
 int AccessibilityUIElement::indexInTable()
 {
     return -1;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to