Title: [232331] trunk
Revision
232331
Author
n_w...@apple.com
Date
2018-05-30 19:27:08 -0700 (Wed, 30 May 2018)

Log Message

AX: VoiceOver on macOS does not announce fieldset description from aria-describedby when focussing inputs
https://bugs.webkit.org/show_bug.cgi?id=185246
<rdar://problem/39939028>

Reviewed by Chris Fleizach.

Source/WebCore:

Exposed the fieldset's description to its form control children.

Test: accessibility/mac/aria-describedby-fieldset.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::helpText const):

LayoutTests:

* accessibility/mac/aria-describedby-fieldset-expected.txt: Added.
* accessibility/mac/aria-describedby-fieldset.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (232330 => 232331)


--- trunk/LayoutTests/ChangeLog	2018-05-31 01:52:49 UTC (rev 232330)
+++ trunk/LayoutTests/ChangeLog	2018-05-31 02:27:08 UTC (rev 232331)
@@ -1,3 +1,14 @@
+2018-05-30  Nan Wang  <n_w...@apple.com>
+
+        AX: VoiceOver on macOS does not announce fieldset description from aria-describedby when focussing inputs
+        https://bugs.webkit.org/show_bug.cgi?id=185246
+        <rdar://problem/39939028>
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/mac/aria-describedby-fieldset-expected.txt: Added.
+        * accessibility/mac/aria-describedby-fieldset.html: Added.
+
 2018-05-30  Chris Fleizach  <cfleiz...@apple.com>
 
         AX: Expose link rel type to voiceover

Added: trunk/LayoutTests/accessibility/mac/aria-describedby-fieldset-expected.txt (0 => 232331)


--- trunk/LayoutTests/accessibility/mac/aria-describedby-fieldset-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/mac/aria-describedby-fieldset-expected.txt	2018-05-31 02:27:08 UTC (rev 232331)
@@ -0,0 +1,12 @@
+Some hint   Yes   No
+This tests form controls use their fieldset parent's description as AXHelp.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS yesRadio.helpText is 'AXHelp: Some hint'
+PASS noRadio.helpText is 'AXHelp: Some hint'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/accessibility/mac/aria-describedby-fieldset.html (0 => 232331)


--- trunk/LayoutTests/accessibility/mac/aria-describedby-fieldset.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/mac/aria-describedby-fieldset.html	2018-05-31 02:27:08 UTC (rev 232331)
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body id="body">
+
+<form>
+    <fieldset aria-describedby="hint">
+      <span id="hint">Some hint</span>
+      <input id="yes" type="radio" value="yes" >
+      <label for=""
+      <input id="no" type="radio" value="no">
+      <label for=""
+    </fieldset>
+  </form>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests form controls use their fieldset parent's description as AXHelp.");
+
+    if (window.accessibilityController) {
+
+        var yesRadio = accessibilityController.accessibleElementById("yes");
+        var noRadio = accessibilityController.accessibleElementById("no");
+        shouldBe("yesRadio.helpText", "'AXHelp: Some hint'");
+        shouldBe("noRadio.helpText", "'AXHelp: Some hint'");
+    }
+
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (232330 => 232331)


--- trunk/Source/WebCore/ChangeLog	2018-05-31 01:52:49 UTC (rev 232330)
+++ trunk/Source/WebCore/ChangeLog	2018-05-31 02:27:08 UTC (rev 232331)
@@ -1,3 +1,18 @@
+2018-05-30  Nan Wang  <n_w...@apple.com>
+
+        AX: VoiceOver on macOS does not announce fieldset description from aria-describedby when focussing inputs
+        https://bugs.webkit.org/show_bug.cgi?id=185246
+        <rdar://problem/39939028>
+
+        Reviewed by Chris Fleizach.
+
+        Exposed the fieldset's description to its form control children.
+
+        Test: accessibility/mac/aria-describedby-fieldset.html
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::helpText const):
+
 2018-05-30  Chris Fleizach  <cfleiz...@apple.com>
 
         AX: Expose link rel type to voiceover

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (232330 => 232331)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2018-05-31 01:52:49 UTC (rev 232330)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2018-05-31 02:27:08 UTC (rev 232331)
@@ -1441,6 +1441,14 @@
     String describedBy = ariaDescribedByAttribute();
     if (!describedBy.isEmpty())
         textOrder.append(AccessibilityText(describedBy, AccessibilityTextSource::Summary));
+    else if (isControl()) {
+        // For controls, use their fieldset parent's described-by text if available.
+        auto matchFunc = [] (const AccessibilityObject& object) {
+            return object.isFieldset() && !object.ariaDescribedByAttribute().isEmpty();
+        };
+        if (const auto* parent = AccessibilityObject::matchedParent(*this, false, WTFMove(matchFunc)))
+            textOrder.append(AccessibilityText(parent->ariaDescribedByAttribute(), AccessibilityTextSource::Summary));
+    }
 
     // Summary attribute used as help text on tables.
     const AtomicString& summary = getAttribute(summaryAttr);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to