Title: [207401] trunk
Revision
207401
Author
n_w...@apple.com
Date
2016-10-16 22:58:18 -0700 (Sun, 16 Oct 2016)

Log Message

AX: [Mac] roleDescription for AXTextField input types
https://bugs.webkit.org/show_bug.cgi?id=163419
<rdar://problem/28766192>

Reviewed by Darin Adler.

Source/WebCore:

Provided more detailed role description for input types that
exposed as standard text fields on the mac.

Changes are covered in modified test expectation.

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

LayoutTests:

* platform/mac/accessibility/roles-exposed-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (207400 => 207401)


--- trunk/LayoutTests/ChangeLog	2016-10-17 03:41:01 UTC (rev 207400)
+++ trunk/LayoutTests/ChangeLog	2016-10-17 05:58:18 UTC (rev 207401)
@@ -1,3 +1,13 @@
+2016-10-16  Nan Wang  <n_w...@apple.com>
+
+        AX: [Mac] roleDescription for AXTextField input types
+        https://bugs.webkit.org/show_bug.cgi?id=163419
+        <rdar://problem/28766192>
+
+        Reviewed by Darin Adler.
+
+        * platform/mac/accessibility/roles-exposed-expected.txt:
+
 2016-10-16  Michael Catanzaro  <mcatanz...@igalia.com>
 
         Unreviewed GTK test gardening

Modified: trunk/LayoutTests/platform/mac/accessibility/roles-exposed-expected.txt (207400 => 207401)


--- trunk/LayoutTests/platform/mac/accessibility/roles-exposed-expected.txt	2016-10-17 03:41:01 UTC (rev 207400)
+++ trunk/LayoutTests/platform/mac/accessibility/roles-exposed-expected.txt	2016-10-17 05:58:18 UTC (rev 207401)
@@ -237,7 +237,7 @@
 input[type='date']
       AXRole: AXTextField
       AXSubrole: 
-      AXRoleDescription: text field
+      AXRoleDescription: date field
       
 input[type='datetime']
       AXRole: AXTextField
@@ -252,7 +252,7 @@
 input[type='email']
       AXRole: AXTextField
       AXSubrole: 
-      AXRoleDescription: text field
+      AXRoleDescription: email field
       
 input[type='file']
       AXRole: AXButton
@@ -312,7 +312,7 @@
 input[type='tel']
       AXRole: AXTextField
       AXSubrole: 
-      AXRoleDescription: text field
+      AXRoleDescription: telephone number field
       
 input[type='text']
       AXRole: AXTextField
@@ -322,12 +322,12 @@
 input[type='time']
       AXRole: AXTextField
       AXSubrole: 
-      AXRoleDescription: text field
+      AXRoleDescription: time field
       
 input[type='url']
       AXRole: AXTextField
       AXSubrole: 
-      AXRoleDescription: text field
+      AXRoleDescription: URL field
       
 input[type='week']
       AXRole: AXTextField

Modified: trunk/Source/WebCore/ChangeLog (207400 => 207401)


--- trunk/Source/WebCore/ChangeLog	2016-10-17 03:41:01 UTC (rev 207400)
+++ trunk/Source/WebCore/ChangeLog	2016-10-17 05:58:18 UTC (rev 207401)
@@ -1,3 +1,39 @@
+2016-10-16  Nan Wang  <n_w...@apple.com>
+
+        AX: [Mac] roleDescription for AXTextField input types
+        https://bugs.webkit.org/show_bug.cgi?id=163419
+        <rdar://problem/28766192>
+
+        Reviewed by Darin Adler.
+
+        Provided more detailed role description for input types that
+        exposed as standard text fields on the mac.
+
+        Changes are covered in modified test expectation.
+
+        * English.lproj/Localizable.strings:
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (-[WebAccessibilityObjectWrapper roleDescription]):
+        * platform/LocalizedStrings.cpp:
+        (WebCore::AXEmailFieldText):
+        (WebCore::AXTelephoneFieldText):
+        (WebCore::AXURLFieldText):
+        (WebCore::AXDateFieldText):
+        (WebCore::AXTimeFieldText):
+        * platform/LocalizedStrings.h:
+        * platform/efl/LocalizedStringsEfl.cpp:
+        (WebCore::AXEmailFieldText):
+        (WebCore::AXTelephoneFieldText):
+        (WebCore::AXURLFieldText):
+        (WebCore::AXDateFieldText):
+        (WebCore::AXTimeFieldText):
+        * platform/gtk/LocalizedStringsGtk.cpp:
+        (WebCore::AXEmailFieldText):
+        (WebCore::AXTelephoneFieldText):
+        (WebCore::AXURLFieldText):
+        (WebCore::AXDateFieldText):
+        (WebCore::AXTimeFieldText):
+
 2016-10-16  Chris Dumez  <cdu...@apple.com>
 
         Update WebKit localizable strings

Modified: trunk/Source/WebCore/English.lproj/Localizable.strings (207400 => 207401)


--- trunk/Source/WebCore/English.lproj/Localizable.strings	2016-10-17 03:41:01 UTC (rev 207400)
+++ trunk/Source/WebCore/English.lproj/Localizable.strings	2016-10-17 05:58:18 UTC (rev 207401)
@@ -217,6 +217,9 @@
 /* Undo action name */
 "Cut (Undo action name)" = "Cut";
 
+/* accessibility role description for a date field */
+"date field" = "date field";
+
 /* Default writing direction context menu item */
 "Default" = "Default";
 
@@ -244,6 +247,9 @@
 /* Undo action name */
 "Drag (Undo action name)" = "Drag";
 
+/* accessibility role description for an email field */
+"email field" = "email field";
+
 /* Video Enter Fullscreen context menu item */
 "Enter Full Screen" = "Enter Full Screen";
 
@@ -613,6 +619,9 @@
 /* File Upload alert sheet camera button string for taking only videos */
 "Take Video (file upload action sheet)" = "Take Video";
 
+/* accessibility role description for a telephone number field */
+"telephone number field" = "telephone number field";
+
 /* Text Replacement context menu item */
 "Text Replacement" = "Text Replacement";
 
@@ -1087,6 +1096,9 @@
 /* term word of a description list */
 "term" = "term";
 
+/* accessibility role description for a time field */
+"time field" = "time field";
+
 /* accessibility label for timeline thumb */
 "timeline slider thumb" = "timeline slider thumb";
 
@@ -1132,6 +1144,9 @@
 /* HTTP result code string */
 "unsupported version" = "unsupported version";
 
+/* accessibility role description for a URL field */
+"URL field" = "URL field";
+
 /* Validation message for required form control elements that have no value */
 "value missing" = "value missing";
 

Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (207400 => 207401)


--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2016-10-17 03:41:01 UTC (rev 207400)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2016-10-17 05:58:18 UTC (rev 207401)
@@ -2516,6 +2516,26 @@
     if ([axRole isEqualToString:@"AXHeading"])
         return AXHeadingText();
     
+    if ([axRole isEqualToString:NSAccessibilityTextFieldRole]) {
+        auto* node = m_object->node();
+        if (is<HTMLInputElement>(node)) {
+            auto& input = downcast<HTMLInputElement>(*node);
+            if (input.isEmailField())
+                return AXEmailFieldText();
+            if (input.isTelephoneField())
+                return AXTelephoneFieldText();
+            if (input.isURLField())
+                return AXURLFieldText();
+            
+            // These input types are not enabled on mac yet, we check the type attribute for now.
+            auto& type = input.attributeWithoutSynchronization(typeAttr);
+            if (equalLettersIgnoringASCIICase(type, "date"))
+                return AXDateFieldText();
+            if (equalLettersIgnoringASCIICase(type, "time"))
+                return AXTimeFieldText();
+        }
+    }
+    
     if (m_object->isFileUploadButton())
         return AXFileUploadButtonText();
     

Modified: trunk/Source/WebCore/platform/LocalizedStrings.cpp (207400 => 207401)


--- trunk/Source/WebCore/platform/LocalizedStrings.cpp	2016-10-17 03:41:01 UTC (rev 207400)
+++ trunk/Source/WebCore/platform/LocalizedStrings.cpp	2016-10-17 05:58:18 UTC (rev 207401)
@@ -640,6 +640,31 @@
     return WEB_UI_STRING("figure", "accessibility role description for a figure element.");
 }
 
+String AXEmailFieldText()
+{
+    return WEB_UI_STRING("email field", "accessibility role description for an email field.");
+}
+
+String AXTelephoneFieldText()
+{
+    return WEB_UI_STRING("telephone number field", "accessibility role description for a telephone number field.");
+}
+
+String AXURLFieldText()
+{
+    return WEB_UI_STRING("URL field", "accessibility role description for a URL field.");
+}
+
+String AXDateFieldText()
+{
+    return WEB_UI_STRING("date field", "accessibility role description for a date field.");
+}
+
+String AXTimeFieldText()
+{
+    return WEB_UI_STRING("time field", "accessibility role description for a time field.");
+}
+
 String AXButtonActionVerb()
 {
     return WEB_UI_STRING("press", "Verb stating the action that will occur when a button is pressed, as used by accessibility");

Modified: trunk/Source/WebCore/platform/LocalizedStrings.h (207400 => 207401)


--- trunk/Source/WebCore/platform/LocalizedStrings.h	2016-10-17 03:41:01 UTC (rev 207400)
+++ trunk/Source/WebCore/platform/LocalizedStrings.h	2016-10-17 05:58:18 UTC (rev 207401)
@@ -171,6 +171,11 @@
     String AXDetailsText();
     String AXSummaryText();
     String AXFigureText();
+    String AXEmailFieldText();
+    String AXTelephoneFieldText();
+    String AXURLFieldText();
+    String AXDateFieldText();
+    String AXTimeFieldText();
     
     String AXButtonActionVerb();
     String AXRadioButtonActionVerb();

Modified: trunk/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp (207400 => 207401)


--- trunk/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp	2016-10-17 03:41:01 UTC (rev 207400)
+++ trunk/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp	2016-10-17 05:58:18 UTC (rev 207401)
@@ -413,6 +413,31 @@
     return String::fromUTF8("figure");
 }
 
+String AXEmailFieldText()
+{
+    return String::fromUTF8("email field");
+}
+
+String AXTelephoneFieldText()
+{
+    return String::fromUTF8("telephone number field");
+}
+
+String AXURLFieldText()
+{
+    return String::fromUTF8("URL field");
+}
+
+String AXDateFieldText()
+{
+    return String::fromUTF8("date field");
+}
+
+String AXTimeFieldText()
+{
+    return String::fromUTF8("time field");
+}
+
 String AXFooterRoleDescriptionText()
 {
     return String::fromUTF8("footer");

Modified: trunk/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp (207400 => 207401)


--- trunk/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp	2016-10-17 03:41:01 UTC (rev 207400)
+++ trunk/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp	2016-10-17 05:58:18 UTC (rev 207401)
@@ -461,6 +461,31 @@
     return String::fromUTF8(_("figure"));
 }
 
+String AXEmailFieldText()
+{
+    return String::fromUTF8(_("email field"));
+}
+
+String AXTelephoneFieldText()
+{
+    return String::fromUTF8(_("telephone number field"));
+}
+
+String AXURLFieldText()
+{
+    return String::fromUTF8(_("URL field"));
+}
+
+String AXDateFieldText()
+{
+    return String::fromUTF8(_("date field"));
+}
+
+String AXTimeFieldText()
+{
+    return String::fromUTF8(_("time field"));
+}
+
 String AXFooterRoleDescriptionText()
 {
     return String::fromUTF8(_("footer"));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to