Title: [206391] trunk
Revision
206391
Author
n_w...@apple.com
Date
2016-09-26 14:02:42 -0700 (Mon, 26 Sep 2016)

Log Message

AX: Progress: [Mac] Content in label element should be used as AXTitle or AXDescription
https://bugs.webkit.org/show_bug.cgi?id=162573

Reviewed by Chris Fleizach.

Source/WebCore:

Exposed the label element's text as the AXTitle of the progress indicator.

Test: accessibility/mac/progress-with-label-element.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::titleElementText):
(WebCore::AccessibilityNodeObject::title):

LayoutTests:

* accessibility/mac/progress-with-label-element-expected.txt: Added.
* accessibility/mac/progress-with-label-element.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (206390 => 206391)


--- trunk/LayoutTests/ChangeLog	2016-09-26 20:39:57 UTC (rev 206390)
+++ trunk/LayoutTests/ChangeLog	2016-09-26 21:02:42 UTC (rev 206391)
@@ -1,3 +1,13 @@
+2016-09-26  Nan Wang  <n_w...@apple.com>
+
+        AX: Progress: [Mac] Content in label element should be used as AXTitle or AXDescription
+        https://bugs.webkit.org/show_bug.cgi?id=162573
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/mac/progress-with-label-element-expected.txt: Added.
+        * accessibility/mac/progress-with-label-element.html: Added.
+
 2016-09-26  Ryan Haddad  <ryanhad...@apple.com>
 
         Marking media/media-controls-drag-timeline-set-controls-property.html as flaky on Yosemite Debug WK2.

Added: trunk/LayoutTests/accessibility/mac/progress-with-label-element-expected.txt (0 => 206391)


--- trunk/LayoutTests/accessibility/mac/progress-with-label-element-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/mac/progress-with-label-element-expected.txt	2016-09-26 21:02:42 UTC (rev 206391)
@@ -0,0 +1,13 @@
+label  label wrapping output
+This tests that for progress elements, label should be used as accessible name and title should be used as accessible description.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS prog1.title is 'AXTitle: label'
+PASS prog1.helpText is 'AXHelp: title'
+PASS prog2.title is 'AXTitle: label wrapping output'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/accessibility/mac/progress-with-label-element.html (0 => 206391)


--- trunk/LayoutTests/accessibility/mac/progress-with-label-element.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/mac/progress-with-label-element.html	2016-09-26 21:02:42 UTC (rev 206391)
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body id="body">
+
+<label for=""
+<progress id="progress" title="title" value="22" max="100"></progress>
+
+<label>label wrapping output<progress id="progress2" value="22" max="100"></progress></label>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+    description("This tests that for progress elements, label should be used as accessible name and title should be used as accessible description.");
+
+    if (window.accessibilityController) {
+
+          var prog1 = accessibilityController.accessibleElementById("progress");
+          shouldBe("prog1.title", "'AXTitle: label'");
+          shouldBe("prog1.helpText", "'AXHelp: title'");
+
+          var prog2 = accessibilityController.accessibleElementById("progress2");
+          shouldBe("prog2.title", "'AXTitle: label wrapping output'");
+    }
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (206390 => 206391)


--- trunk/Source/WebCore/ChangeLog	2016-09-26 20:39:57 UTC (rev 206390)
+++ trunk/Source/WebCore/ChangeLog	2016-09-26 21:02:42 UTC (rev 206391)
@@ -1,3 +1,18 @@
+2016-09-26  Nan Wang  <n_w...@apple.com>
+
+        AX: Progress: [Mac] Content in label element should be used as AXTitle or AXDescription
+        https://bugs.webkit.org/show_bug.cgi?id=162573
+
+        Reviewed by Chris Fleizach.
+
+        Exposed the label element's text as the AXTitle of the progress indicator.
+
+        Test: accessibility/mac/progress-with-label-element.html
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::titleElementText):
+        (WebCore::AccessibilityNodeObject::title):
+
 2016-09-26  Ryan Haddad  <ryanhad...@apple.com>
 
         Rebaseline bindings tests after r206386.

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (206390 => 206391)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2016-09-26 20:39:57 UTC (rev 206390)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2016-09-26 21:02:42 UTC (rev 206391)
@@ -1238,7 +1238,7 @@
         return;
     
     bool isInputTag = is<HTMLInputElement>(*node);
-    if (isInputTag || AccessibilityObject::isARIAInput(ariaRoleAttribute()) || isControl()) {
+    if (isInputTag || AccessibilityObject::isARIAInput(ariaRoleAttribute()) || isControl() || isProgressIndicator()) {
         if (HTMLLabelElement* label = labelForElement(downcast<Element>(node))) {
             AccessibilityObject* labelObject = axObjectCache()->getOrCreate(label);
             String innerText = label->innerText();
@@ -1710,7 +1710,7 @@
             return input.valueWithDefault();
     }
 
-    if (isInputTag || AccessibilityObject::isARIAInput(ariaRoleAttribute()) || isControl()) {
+    if (isInputTag || AccessibilityObject::isARIAInput(ariaRoleAttribute()) || isControl() || isProgressIndicator()) {
         HTMLLabelElement* label = labelForElement(downcast<Element>(node));
         // Use the label text as the title if 1) the title element is NOT an exposed element and 2) there's no ARIA override.
         if (label && !exposesTitleUIElement() && !ariaAccessibilityDescription().length())
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to