Title: [207429] trunk
Revision
207429
Author
n_w...@apple.com
Date
2016-10-17 14:00:47 -0700 (Mon, 17 Oct 2016)

Log Message

AX: [Mac] mapping for output elements
https://bugs.webkit.org/show_bug.cgi?id=163471

Reviewed by Chris Fleizach.

Source/WebCore:

Mapped the output element to status role and exposed its text content
as AXTitle.

Test: accessibility/mac/output-element.html

* English.lproj/Localizable.strings:
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::visibleText):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isOutput):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper roleDescription]):
* platform/LocalizedStrings.cpp:
(WebCore::AXOutputText):
* platform/LocalizedStrings.h:
* platform/efl/LocalizedStringsEfl.cpp:
(WebCore::AXOutputText):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::AXOutputText):

LayoutTests:

* accessibility/mac/output-element-expected.txt: Added.
* accessibility/mac/output-element.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (207428 => 207429)


--- trunk/LayoutTests/ChangeLog	2016-10-17 20:57:28 UTC (rev 207428)
+++ trunk/LayoutTests/ChangeLog	2016-10-17 21:00:47 UTC (rev 207429)
@@ -1,3 +1,13 @@
+2016-10-17  Nan Wang  <n_w...@apple.com>
+
+        AX: [Mac] mapping for output elements
+        https://bugs.webkit.org/show_bug.cgi?id=163471
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/mac/output-element-expected.txt: Added.
+        * accessibility/mac/output-element.html: Added.
+
 2016-10-17  Simon Fraser  <simon.fra...@apple.com>
 
         Implement DOMPoint/DOMPointReadOnly

Added: trunk/LayoutTests/accessibility/mac/output-element-expected.txt (0 => 207429)


--- trunk/LayoutTests/accessibility/mac/output-element-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/mac/output-element-expected.txt	2016-10-17 21:00:47 UTC (rev 207429)
@@ -0,0 +1,14 @@
+output element
+This tests that the output element has correct mapping.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS output.role is 'AXRole: AXGroup'
+PASS output.subrole is 'AXSubrole: AXApplicationStatus'
+PASS output.roleDescription is 'AXRoleDescription: output'
+PASS output.title is 'AXTitle: output element'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/accessibility/mac/output-element.html (0 => 207429)


--- trunk/LayoutTests/accessibility/mac/output-element.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/mac/output-element.html	2016-10-17 21:00:47 UTC (rev 207429)
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body id="body">
+
+<output id="output">output element</output>
+
+
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+    description("This tests that the output element has correct mapping.");
+
+    if (window.accessibilityController) {
+
+          var output = accessibilityController.accessibleElementById("output");
+          shouldBe("output.role", "'AXRole: AXGroup'");
+          shouldBe("output.subrole", "'AXSubrole: AXApplicationStatus'");
+          shouldBe("output.roleDescription", "'AXRoleDescription: output'");
+          
+          shouldBe("output.title", "'AXTitle: output element'");
+    }
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (207428 => 207429)


--- trunk/Source/WebCore/ChangeLog	2016-10-17 20:57:28 UTC (rev 207428)
+++ trunk/Source/WebCore/ChangeLog	2016-10-17 21:00:47 UTC (rev 207429)
@@ -1,3 +1,33 @@
+2016-10-17  Nan Wang  <n_w...@apple.com>
+
+        AX: [Mac] mapping for output elements
+        https://bugs.webkit.org/show_bug.cgi?id=163471
+
+        Reviewed by Chris Fleizach.
+
+        Mapped the output element to status role and exposed its text content
+        as AXTitle. 
+
+        Test: accessibility/mac/output-element.html
+
+        * English.lproj/Localizable.strings:
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::visibleText):
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::isOutput):
+        * accessibility/AccessibilityObject.h:
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (-[WebAccessibilityObjectWrapper roleDescription]):
+        * platform/LocalizedStrings.cpp:
+        (WebCore::AXOutputText):
+        * platform/LocalizedStrings.h:
+        * platform/efl/LocalizedStringsEfl.cpp:
+        (WebCore::AXOutputText):
+        * platform/gtk/LocalizedStringsGtk.cpp:
+        (WebCore::AXOutputText):
+
 2016-10-17  Yusuke Suzuki  <utatane....@gmail.com>
 
         [DOMJIT] Use DOMJIT::Patchpoint in IC

Modified: trunk/Source/WebCore/English.lproj/Localizable.strings (207428 => 207429)


--- trunk/Source/WebCore/English.lproj/Localizable.strings	2016-10-17 20:57:28 UTC (rev 207428)
+++ trunk/Source/WebCore/English.lproj/Localizable.strings	2016-10-17 21:00:47 UTC (rev 207429)
@@ -970,6 +970,9 @@
 /* accessibility help text for remaining time display */
 "number of seconds of movie remaining" = "number of seconds of movie remaining";
 
+/* accessibility role description for an output element */
+"output" = "output";
+
 /* HTTP result code string */
 "partial content" = "partial content";
 

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (207428 => 207429)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2016-10-17 20:57:28 UTC (rev 207428)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2016-10-17 21:00:47 UTC (rev 207429)
@@ -1407,6 +1407,9 @@
     if (isHeading() || isLink())
         useTextUnderElement = true;
     
+    if (isOutput())
+        useTextUnderElement = true;
+    
     if (useTextUnderElement) {
         AccessibilityTextUnderElementMode mode;
         

Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (207428 => 207429)


--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2016-10-17 20:57:28 UTC (rev 207428)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2016-10-17 21:00:47 UTC (rev 207429)
@@ -3105,6 +3105,12 @@
     Node* node = this->node();
     return node && node->hasTagName(figureTag);
 }
+
+bool AccessibilityObject::isOutput() const
+{
+    Node* node = this->node();
+    return node && node->hasTagName(outputTag);
+}
     
 bool AccessibilityObject::isContainedByPasswordField() const
 {

Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (207428 => 207429)


--- trunk/Source/WebCore/accessibility/AccessibilityObject.h	2016-10-17 20:57:28 UTC (rev 207428)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h	2016-10-17 21:00:47 UTC (rev 207429)
@@ -562,6 +562,7 @@
     bool isSuperscriptStyleGroup() const;
     bool isFigure() const;
     bool isSummary() const { return roleValue() == SummaryRole; }
+    bool isOutput() const;
     
     virtual bool isChecked() const { return false; }
     virtual bool isEnabled() const { return false; }

Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (207428 => 207429)


--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2016-10-17 20:57:28 UTC (rev 207428)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2016-10-17 21:00:47 UTC (rev 207429)
@@ -2749,6 +2749,11 @@
         return DetailsRole;
     if (is<HTMLSummaryElement>(node))
         return SummaryRole;
+    
+    // http://rawgit.com/w3c/aria/master/html-aam/html-aam.html
+    // Output elements should be mapped to status role.
+    if (isOutput())
+        return ApplicationStatusRole;
 
 #if ENABLE(VIDEO)
     if (is<HTMLVideoElement>(node))

Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (207428 => 207429)


--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2016-10-17 20:57:28 UTC (rev 207428)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2016-10-17 21:00:47 UTC (rev 207429)
@@ -2474,6 +2474,9 @@
     
     if ([axRole isEqualToString:NSAccessibilityGroupRole]) {
         
+        if (m_object->isOutput())
+            return AXOutputText();
+        
         NSString *ariaLandmarkRoleDescription = [self ariaLandmarkRoleDescription];
         if (ariaLandmarkRoleDescription)
             return ariaLandmarkRoleDescription;

Modified: trunk/Source/WebCore/platform/LocalizedStrings.cpp (207428 => 207429)


--- trunk/Source/WebCore/platform/LocalizedStrings.cpp	2016-10-17 20:57:28 UTC (rev 207428)
+++ trunk/Source/WebCore/platform/LocalizedStrings.cpp	2016-10-17 21:00:47 UTC (rev 207429)
@@ -625,6 +625,11 @@
     return WEB_UI_STRING("file upload button", "accessibility role description for a file upload button");
 }
 
+String AXOutputText()
+{
+    return WEB_UI_STRING("output", "accessibility role description for an output element");
+}
+
 String AXAttachmentRoleText()
 {
     return WEB_UI_STRING("attachment", "accessibility role description for an attachment element");

Modified: trunk/Source/WebCore/platform/LocalizedStrings.h (207428 => 207429)


--- trunk/Source/WebCore/platform/LocalizedStrings.h	2016-10-17 20:57:28 UTC (rev 207428)
+++ trunk/Source/WebCore/platform/LocalizedStrings.h	2016-10-17 21:00:47 UTC (rev 207429)
@@ -166,6 +166,7 @@
     String AXDescriptionListDetailText();
     String AXFooterRoleDescriptionText();
     String AXFileUploadButtonText();
+    String AXOutputText();
     String AXSearchFieldCancelButtonText();
     String AXAttachmentRoleText();
     String AXDetailsText();

Modified: trunk/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp (207428 => 207429)


--- trunk/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp	2016-10-17 20:57:28 UTC (rev 207428)
+++ trunk/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp	2016-10-17 21:00:47 UTC (rev 207429)
@@ -413,6 +413,11 @@
     return String::fromUTF8("figure");
 }
 
+String AXOutputText()
+{
+    return String::fromUTF8("output");
+}
+
 String AXEmailFieldText()
 {
     return String::fromUTF8("email field");

Modified: trunk/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp (207428 => 207429)


--- trunk/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp	2016-10-17 20:57:28 UTC (rev 207428)
+++ trunk/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp	2016-10-17 21:00:47 UTC (rev 207429)
@@ -461,6 +461,11 @@
     return String::fromUTF8(_("figure"));
 }
 
+String AXOutputText()
+{
+    return String::fromUTF8(_("output"));
+}
+
 String AXEmailFieldText()
 {
     return String::fromUTF8(_("email field"));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to