Title: [184660] trunk
Revision
184660
Author
[email protected]
Date
2015-05-20 14:38:01 -0700 (Wed, 20 May 2015)

Log Message

AX: AutoFill button is not accessible with VoiceOver
https://bugs.webkit.org/show_bug.cgi?id=145200
<rdar://problem/20507480>

Reviewed by Chris Fleizach.

Source/WebCore:

Add ARIA label and role attributes to the AutoFill button markup so that VoiceOver
can identify and interact with it.

Test: accessibility/input-auto-fill-button.html

* English.lproj/Localizable.strings: Add placeholder localized string for AutoFill button.
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::createAutoFillButton): Add ARIA label and role attributes.
* platform/LocalizedStrings.cpp:
(WebCore::AXAutoFillButtonText): Added; returns the localized string for the AutoFill button.
* platform/LocalizedStrings.h:
* platform/efl/LocalizedStringsEfl.cpp:
(WebCore::AXAutoFillButtonText): Ditto.
* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::AXAutoFillButtonText): Ditto.

LayoutTests:

Test that there is an accessibility element for the AutoFill button.

* accessibility/input-auto-fill-button-expected.txt: Added.
* accessibility/input-auto-fill-button.html: Added.
* platform/win/TestExpectations: For now, mark tests as failing. I suspect the cause
is <https://bugs.webkit.org/show_bug.cgi?id=140798>.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (184659 => 184660)


--- trunk/LayoutTests/ChangeLog	2015-05-20 21:36:20 UTC (rev 184659)
+++ trunk/LayoutTests/ChangeLog	2015-05-20 21:38:01 UTC (rev 184660)
@@ -1,3 +1,18 @@
+2015-05-20  Daniel Bates  <[email protected]>
+
+        AX: AutoFill button is not accessible with VoiceOver
+        https://bugs.webkit.org/show_bug.cgi?id=145200
+        <rdar://problem/20507480>
+
+        Reviewed by Chris Fleizach.
+
+        Test that there is an accessibility element for the AutoFill button.
+
+        * accessibility/input-auto-fill-button-expected.txt: Added.
+        * accessibility/input-auto-fill-button.html: Added.
+        * platform/win/TestExpectations: For now, mark tests as failing. I suspect the cause
+        is <https://bugs.webkit.org/show_bug.cgi?id=140798>.
+
 2015-05-20  Antti Koivisto  <[email protected]>
 
         Assertion failure in WebCore::BidiRun::BidiRun()

Added: trunk/LayoutTests/accessibility/input-auto-fill-button-expected.txt (0 => 184660)


--- trunk/LayoutTests/accessibility/input-auto-fill-button-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/input-auto-fill-button-expected.txt	2015-05-20 21:38:01 UTC (rev 184660)
@@ -0,0 +1,11 @@
+This tests that there exists an accessibility element for the AutoFill button.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS accessibilityController.accessibleElementById("password").childAtIndex(0).description is "AXDescription: autofill"
+PASS accessibilityController.accessibleElementById("password").childAtIndex(0).role is "AXRole: AXButton"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/accessibility/input-auto-fill-button.html (0 => 184660)


--- trunk/LayoutTests/accessibility/input-auto-fill-button.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/input-auto-fill-button.html	2015-05-20 21:38:01 UTC (rev 184660)
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<input type="password" id="password">
+<script>
+description("This tests that there exists an accessibility element for the AutoFill button.");
+
+if (!window.internals || !window.accessibilityController)
+    testFailed("You must run this test in the test tool and have implemented window.internals and window.accessibilityController.");
+else {
+    internals.setShowAutoFillButton(document.getElementById("password"), true);
+
+    shouldBeEqualToString('accessibilityController.accessibleElementById("password").childAtIndex(0).description', "AXDescription: autofill");
+    shouldBeEqualToString('accessibilityController.accessibleElementById("password").childAtIndex(0).role', "AXRole: AXButton");
+}
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/LayoutTests/platform/win/TestExpectations (184659 => 184660)


--- trunk/LayoutTests/platform/win/TestExpectations	2015-05-20 21:36:20 UTC (rev 184659)
+++ trunk/LayoutTests/platform/win/TestExpectations	2015-05-20 21:38:01 UTC (rev 184660)
@@ -1322,6 +1322,8 @@
 webkit.org/b/140798 [ Debug ] accessibility/html-html-element-is-ignored.html [ Skip ] # Debug assertion
 webkit.org/b/140798 [ Release ] accessibility/inline-block-assertion.html [ Failure ]
 webkit.org/b/140798 [ Debug ] accessibility/inline-block-assertion.html [ Skip ] # Debug assertion
+webkit.org/b/140798 [ Release ] accessibility/input-auto-fill-button.html [ Failure ]
+webkit.org/b/140798 [ Debug ] accessibility/input-auto-fill-button.html [ Failure ]
 webkit.org/b/140798 [ Release ] accessibility/input-type-hidden-in-aria-hidden-false.html [ Failure ]
 webkit.org/b/140798 [ Debug ] accessibility/input-type-hidden-in-aria-hidden-false.html [ Skip ] # Debug assertion
 webkit.org/b/140798 [ Release ] accessibility/legend-children-are-visible.html [ Failure ]

Modified: trunk/Source/WebCore/ChangeLog (184659 => 184660)


--- trunk/Source/WebCore/ChangeLog	2015-05-20 21:36:20 UTC (rev 184659)
+++ trunk/Source/WebCore/ChangeLog	2015-05-20 21:38:01 UTC (rev 184660)
@@ -1,3 +1,27 @@
+2015-05-20  Daniel Bates  <[email protected]>
+
+        AX: AutoFill button is not accessible with VoiceOver
+        https://bugs.webkit.org/show_bug.cgi?id=145200
+        <rdar://problem/20507480>
+
+        Reviewed by Chris Fleizach.
+
+        Add ARIA label and role attributes to the AutoFill button markup so that VoiceOver
+        can identify and interact with it.
+
+        Test: accessibility/input-auto-fill-button.html
+
+        * English.lproj/Localizable.strings: Add placeholder localized string for AutoFill button.
+        * html/TextFieldInputType.cpp:
+        (WebCore::TextFieldInputType::createAutoFillButton): Add ARIA label and role attributes.
+        * platform/LocalizedStrings.cpp:
+        (WebCore::AXAutoFillButtonText): Added; returns the localized string for the AutoFill button.
+        * platform/LocalizedStrings.h:
+        * platform/efl/LocalizedStringsEfl.cpp:
+        (WebCore::AXAutoFillButtonText): Ditto.
+        * platform/gtk/LocalizedStringsGtk.cpp:
+        (WebCore::AXAutoFillButtonText): Ditto.
+
 2015-05-20  Dean Jackson  <[email protected]>
 
         Label text for default buttons don’t have the correct white color

Modified: trunk/Source/WebCore/English.lproj/Localizable.strings (184659 => 184660)


--- trunk/Source/WebCore/English.lproj/Localizable.strings	2015-05-20 21:36:20 UTC (rev 184659)
+++ trunk/Source/WebCore/English.lproj/Localizable.strings	2015-05-20 21:38:01 UTC (rev 184660)
@@ -760,6 +760,9 @@
 /* accessibility description for a search field cancel button */
 "cancel" = "cancel";
 
+/* accessibility description for a password field AutoFill button */
+"autofill" = "autofill";
+
 /* Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility */
 "check" = "check";
 

Modified: trunk/Source/WebCore/html/TextFieldInputType.cpp (184659 => 184660)


--- trunk/Source/WebCore/html/TextFieldInputType.cpp	2015-05-20 21:36:20 UTC (rev 184659)
+++ trunk/Source/WebCore/html/TextFieldInputType.cpp	2015-05-20 21:38:01 UTC (rev 184660)
@@ -42,6 +42,7 @@
 #include "HTMLInputElement.h"
 #include "HTMLNames.h"
 #include "KeyboardEvent.h"
+#include "LocalizedStrings.h"
 #include "NodeRenderStyle.h"
 #include "Page.h"
 #include "PlatformKeyboardEvent.h"
@@ -602,6 +603,8 @@
 
     m_autoFillButton = AutoFillButtonElement::create(element().document(), *this);
     m_autoFillButton->setPseudo(AtomicString("-webkit-auto-fill-button", AtomicString::ConstructFromLiteral));
+    m_autoFillButton->setAttribute(aria_labelAttr, AtomicString(AXAutoFillButtonText()));
+    m_autoFillButton->setAttribute(roleAttr, AtomicString("button", AtomicString::ConstructFromLiteral));
     m_container->appendChild(m_autoFillButton, IGNORE_EXCEPTION);
 }
 

Modified: trunk/Source/WebCore/platform/LocalizedStrings.cpp (184659 => 184660)


--- trunk/Source/WebCore/platform/LocalizedStrings.cpp	2015-05-20 21:36:20 UTC (rev 184659)
+++ trunk/Source/WebCore/platform/LocalizedStrings.cpp	2015-05-20 21:38:01 UTC (rev 184660)
@@ -653,6 +653,11 @@
 }
 #endif // !PLATFORM(IOS)
 
+String AXAutoFillButtonText()
+{
+    return WEB_UI_STRING("autofill", "accessibility description for a password field AutoFill button");
+}
+
 #if PLATFORM(COCOA)
 String AXARIAContentGroupText(const String& ariaType)
 {

Modified: trunk/Source/WebCore/platform/LocalizedStrings.h (184659 => 184660)


--- trunk/Source/WebCore/platform/LocalizedStrings.h	2015-05-20 21:36:20 UTC (rev 184659)
+++ trunk/Source/WebCore/platform/LocalizedStrings.h	2015-05-20 21:38:01 UTC (rev 184660)
@@ -162,7 +162,7 @@
     String AXFooterRoleDescriptionText();
     String AXFileUploadButtonText();
     String AXSearchFieldCancelButtonText();
-    
+
     String AXButtonActionVerb();
     String AXRadioButtonActionVerb();
     String AXTextFieldActionVerb();
@@ -174,6 +174,8 @@
     String AXListItemActionVerb();
 #endif
 
+    String AXAutoFillButtonText();
+
 #if ENABLE(INPUT_TYPE_WEEK)
     // weekFormatInLDML() returns week and year format in LDML, Unicode
     // technical standard 35, Locale Data Markup Language, e.g. "'Week' ww, yyyy"

Modified: trunk/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp (184659 => 184660)


--- trunk/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp	2015-05-20 21:36:20 UTC (rev 184659)
+++ trunk/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp	2015-05-20 21:38:01 UTC (rev 184660)
@@ -408,6 +408,11 @@
     return String::fromUTF8("cancel");
 }
 
+String AXAutoFillButtonText()
+{
+    return String::fromUTF8("autofill");
+}
+
 String AXButtonActionVerb()
 {
     return String::fromUTF8("press");

Modified: trunk/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp (184659 => 184660)


--- trunk/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp	2015-05-20 21:36:20 UTC (rev 184659)
+++ trunk/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp	2015-05-20 21:38:01 UTC (rev 184660)
@@ -456,6 +456,11 @@
     return String::fromUTF8(_("cancel"));
 }
 
+String AXAutoFillButtonText()
+{
+    return String::fromUTF8(_("autofill"));
+}
+
 String AXButtonActionVerb()
 {
     return String::fromUTF8(_("press"));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to