Title: [210605] trunk
Revision
210605
Author
[email protected]
Date
2017-01-11 16:11:00 -0800 (Wed, 11 Jan 2017)

Log Message

AX: role=treeitem accessible name not spoken to VoiceOver macOS when using string contained inside element
https://bugs.webkit.org/show_bug.cgi?id=164950
<rdar://problem/29337573>

Reviewed by Chris Fleizach.

Source/WebCore:

>From the spec: https://www.w3.org/TR/wai-aria-practices/#TreeView
The element with role treeitem missing a label is labeled by its child elements.

Test: accessibility/mac/aria-tree-item-name.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::alternativeText):

LayoutTests:

* accessibility/mac/aria-tree-item-name-expected.txt: Added.
* accessibility/mac/aria-tree-item-name.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (210604 => 210605)


--- trunk/LayoutTests/ChangeLog	2017-01-12 00:05:20 UTC (rev 210604)
+++ trunk/LayoutTests/ChangeLog	2017-01-12 00:11:00 UTC (rev 210605)
@@ -1,3 +1,14 @@
+2017-01-11  Nan Wang  <[email protected]>
+
+        AX: role=treeitem accessible name not spoken to VoiceOver macOS when using string contained inside element
+        https://bugs.webkit.org/show_bug.cgi?id=164950
+        <rdar://problem/29337573>
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/mac/aria-tree-item-name-expected.txt: Added.
+        * accessibility/mac/aria-tree-item-name.html: Added.
+
 2017-01-11  Myles C. Maxfield  <[email protected]>
 
         ASSERTION FAILED: run->m_stop > 0 in *WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment

Added: trunk/LayoutTests/accessibility/mac/aria-tree-item-name-expected.txt (0 => 210605)


--- trunk/LayoutTests/accessibility/mac/aria-tree-item-name-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/mac/aria-tree-item-name-expected.txt	2017-01-12 00:11:00 UTC (rev 210605)
@@ -0,0 +1,17 @@
+Release Notes
+Power Search
+Power Search
+item 2
+
+This tests that name calculation is correct for treeitems.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS item0.description is 'AXDescription: Release Notes'
+PASS item1.description is 'AXDescription: item 1'
+PASS item2.description is 'AXDescription: item 2'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/accessibility/mac/aria-tree-item-name.html (0 => 210605)


--- trunk/LayoutTests/accessibility/mac/aria-tree-item-name.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/mac/aria-tree-item-name.html	2017-01-12 00:11:00 UTC (rev 210605)
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body id="body">
+
+<ul id="tree" role="tree" aria-label="Help Topics">
+  <li id="item0" role="treeitem" aria-expanded="true">Release Notes
+    <ul role="group">
+      <li id="item1" role="treeitem" aria-label="item 1">Power Search</li>
+      <li id="item2" role="treeitem" aria-labelledby="label">Power Search</li>
+    </ul>
+  </li>
+</ul>
+
+<p id="label">item 2</p>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that name calculation is correct for treeitems.");
+
+    if (window.accessibilityController) {
+    
+          // Treeitems missing a label are labeled by child elements.
+          var item0 = accessibilityController.accessibleElementById("item0");
+          shouldBe("item0.description", "'AXDescription: Release Notes'");
+          
+          // aria-label case.
+          var item1 = accessibilityController.accessibleElementById("item1");
+          shouldBe("item1.description", "'AXDescription: item 1'");
+          
+          // aria-labelledby case.
+          var item2 = accessibilityController.accessibleElementById("item2");
+          shouldBe("item2.description", "'AXDescription: item 2'");
+    }
+
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (210604 => 210605)


--- trunk/Source/WebCore/ChangeLog	2017-01-12 00:05:20 UTC (rev 210604)
+++ trunk/Source/WebCore/ChangeLog	2017-01-12 00:11:00 UTC (rev 210605)
@@ -1,3 +1,19 @@
+2017-01-11  Nan Wang  <[email protected]>
+
+        AX: role=treeitem accessible name not spoken to VoiceOver macOS when using string contained inside element
+        https://bugs.webkit.org/show_bug.cgi?id=164950
+        <rdar://problem/29337573>
+
+        Reviewed by Chris Fleizach.
+
+        From the spec: https://www.w3.org/TR/wai-aria-practices/#TreeView
+        The element with role treeitem missing a label is labeled by its child elements.
+
+        Test: accessibility/mac/aria-tree-item-name.html
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::alternativeText):
+
 2017-01-11  Brent Fulgham  <[email protected]>
 
         [GTK] Unreviewed build fix after r210600.

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (210604 => 210605)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2017-01-12 00:05:20 UTC (rev 210604)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2017-01-12 00:11:00 UTC (rev 210605)
@@ -1363,6 +1363,10 @@
             textOrder.append(AccessibilityText(accessibleNameForNode(captionForFigure->node()), AlternativeText));
     }
     
+    // Tree items missing a label are labeled by all child elements.
+    if (isTreeItem() && ariaLabel.isEmpty() && ariaLabeledByAttribute().isEmpty())
+        textOrder.append(AccessibilityText(accessibleNameForNode(node), AlternativeText));
+    
 #if ENABLE(MATHML)
     if (node->isMathMLElement())
         textOrder.append(AccessibilityText(getAttribute(MathMLNames::alttextAttr), AlternativeText));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to