AX: AXRoleDescription for details and summary elements
authorn_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Oct 2016 17:44:51 +0000 (17:44 +0000)
committern_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Oct 2016 17:44:51 +0000 (17:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=163094

Reviewed by Chris Fleizach.

Source/WebCore:

details and summary elements should have AXRoleDescription that is consistent with other
elements that have custom AXSubRole.

Test: accessibility/mac/details-summary-role-description.html

* English.lproj/Localizable.strings:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper roleDescription]):
* platform/LocalizedStrings.cpp:
(WebCore::AXDetailsText):
(WebCore::AXSummaryText):
* platform/LocalizedStrings.h:
* platform/efl/LocalizedStringsEfl.cpp:
(WebCore::AXDetailsText):
(WebCore::AXSummaryText):
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::AXDetailsText):
(WebCore::AXSummaryText):

LayoutTests:

* accessibility/mac/details-summary-role-description-expected.txt: Added.
* accessibility/mac/details-summary-role-description.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206921 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/accessibility/mac/details-summary-role-description-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/mac/details-summary-role-description.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/English.lproj/Localizable.strings
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Source/WebCore/platform/LocalizedStrings.cpp
Source/WebCore/platform/LocalizedStrings.h
Source/WebCore/platform/efl/LocalizedStringsEfl.cpp
Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp

index abe6420..2595133 100644 (file)
@@ -1,3 +1,13 @@
+2016-10-07  Nan Wang  <n_wang@apple.com>
+
+        AX: AXRoleDescription for details and summary elements
+        https://bugs.webkit.org/show_bug.cgi?id=163094
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/mac/details-summary-role-description-expected.txt: Added.
+        * accessibility/mac/details-summary-role-description.html: Added.
+
 2016-10-07  Ryan Haddad  <ryanhaddad@apple.com>
 
         Marking imported/blink/storage/indexeddb/blob-valid-after-deletion.html as flaky on mac.
diff --git a/LayoutTests/accessibility/mac/details-summary-role-description-expected.txt b/LayoutTests/accessibility/mac/details-summary-role-description-expected.txt
new file mode 100644 (file)
index 0000000..b28cf71
--- /dev/null
@@ -0,0 +1,18 @@
+Summary
+some detail
+
+This tests that summary and detail elements have correct role description.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS summary.role is 'AXRole: AXGroup'
+PASS details.role is 'AXRole: AXGroup'
+PASS summary.subrole is 'AXSubrole: AXSummary'
+PASS details.subrole is 'AXSubrole: AXDetails'
+PASS summary.roleDescription is 'AXRoleDescription: summary'
+PASS details.roleDescription is 'AXRoleDescription: details'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/accessibility/mac/details-summary-role-description.html b/LayoutTests/accessibility/mac/details-summary-role-description.html
new file mode 100644 (file)
index 0000000..9b0a91f
--- /dev/null
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../../resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+
+<details id="details" open=""><summary id="summary">Summary</summary><p>some detail</p></details>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that summary and detail elements have correct role description.");
+
+    if (window.accessibilityController) {
+
+          var summary = accessibilityController.accessibleElementById("summary");
+          var details = accessibilityController.accessibleElementById("details");
+         
+          shouldBe("summary.role", "'AXRole: AXGroup'");
+          shouldBe("details.role", "'AXRole: AXGroup'");
+          shouldBe("summary.subrole", "'AXSubrole: AXSummary'");
+          shouldBe("details.subrole", "'AXSubrole: AXDetails'");
+          shouldBe("summary.roleDescription", "'AXRoleDescription: summary'");
+          shouldBe("details.roleDescription", "'AXRoleDescription: details'");
+    }
+
+</script>
+
+<script src="../../resources/js-test-post.js"></script>
+</body>
+</html>
index 0f44406..42a18b9 100644 (file)
@@ -1,3 +1,29 @@
+2016-10-07  Nan Wang  <n_wang@apple.com>
+
+        AX: AXRoleDescription for details and summary elements
+        https://bugs.webkit.org/show_bug.cgi?id=163094
+
+        Reviewed by Chris Fleizach.
+
+        details and summary elements should have AXRoleDescription that is consistent with other
+        elements that have custom AXSubRole.
+
+        Test: accessibility/mac/details-summary-role-description.html
+
+        * English.lproj/Localizable.strings:
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (-[WebAccessibilityObjectWrapper roleDescription]):
+        * platform/LocalizedStrings.cpp:
+        (WebCore::AXDetailsText):
+        (WebCore::AXSummaryText):
+        * platform/LocalizedStrings.h:
+        * platform/efl/LocalizedStringsEfl.cpp:
+        (WebCore::AXDetailsText):
+        (WebCore::AXSummaryText):
+        * platform/gtk/LocalizedStringsGtk.cpp:
+        (WebCore::AXDetailsText):
+        (WebCore::AXSummaryText):
+
 2016-10-07  Ryan Haddad  <ryanhaddad@apple.com>
 
         Fix the Windows build after r206917.
index bcc13b4..b6515fb 100644 (file)
 /* accessibility role description of a description list */
 "description list" = "description list";
 
+/* accessibility role description for a details element */
+"details" = "details";
+
 /* An ARIA accessibility group that acts as a document. */
 "document" = "document";
 
 /* HTTP result code string */
 "success" = "success";
 
+/* accessibility role description for a summary element */
+"summary" = "summary";
+
 /* HTTP result code string */
 "switching protocols" = "switching protocols";
 
index 603f03c..dcd95a0 100644 (file)
@@ -2487,8 +2487,12 @@ static NSString* roleValueToNSString(AccessibilityRole value)
             return AXDescriptionListTermText();
         case DescriptionListDetailRole:
             return AXDescriptionListDetailText();
+        case DetailsRole:
+            return AXDetailsText();
         case FooterRole:
             return AXFooterRoleDescriptionText();
+        case SummaryRole:
+            return AXSummaryText();
         case VideoRole:
             return localizedMediaControlElementString("VideoElement");
         default:
index 623b956..66453ba 100644 (file)
@@ -605,6 +605,16 @@ String AXDescriptionListDetailText()
     return WEB_UI_STRING("description", "description detail");
 }
 
+String AXDetailsText()
+{
+    return WEB_UI_STRING("details", "accessibility role description for a details element");
+}
+
+String AXSummaryText()
+{
+    return WEB_UI_STRING("summary", "accessibility role description for a summary element");
+}
+
 String AXFooterRoleDescriptionText()
 {
     return WEB_UI_STRING("footer", "accessibility role description for a footer");
index 0edaa4d..7965f8b 100644 (file)
@@ -168,6 +168,8 @@ namespace WebCore {
     String AXFileUploadButtonText();
     String AXSearchFieldCancelButtonText();
     String AXAttachmentRoleText();
+    String AXDetailsText();
+    String AXSummaryText();
     
     String AXButtonActionVerb();
     String AXRadioButtonActionVerb();
index b7f2c6d..ee5d180 100644 (file)
@@ -398,6 +398,16 @@ String AXDescriptionListDetailText()
     return String::fromUTF8("description");
 }
 
+String AXDetailsText()
+{
+    return String::fromUTF8("details");
+}
+
+String AXSummaryText()
+{
+    return String::fromUTF8("summary");
+}
+
 String AXFooterRoleDescriptionText()
 {
     return String::fromUTF8("footer");
index 63c5085..d1df269 100644 (file)
@@ -446,6 +446,16 @@ String AXDescriptionListDetailText()
     return String::fromUTF8(_("description"));
 }
 
+String AXDetailsText()
+{
+    return String::fromUTF8(_("details"));
+}
+
+String AXSummaryText()
+{
+    return String::fromUTF8(_("summary"));
+}
+
 String AXFooterRoleDescriptionText()
 {
     return String::fromUTF8(_("footer"));