<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[184660] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/184660">184660</a></dd>
<dt>Author</dt> <dd>dbates@webkit.org</dd>
<dt>Date</dt> <dd>2015-05-20 14:38:01 -0700 (Wed, 20 May 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>AX: AutoFill button is not accessible with VoiceOver
https://bugs.webkit.org/show_bug.cgi?id=145200
&lt;rdar://problem/20507480&gt;

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 &lt;https://bugs.webkit.org/show_bug.cgi?id=140798&gt;.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformwinTestExpectations">trunk/LayoutTests/platform/win/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreEnglishlprojLocalizablestrings">trunk/Source/WebCore/English.lproj/Localizable.strings</a></li>
<li><a href="#trunkSourceWebCorehtmlTextFieldInputTypecpp">trunk/Source/WebCore/html/TextFieldInputType.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformLocalizedStringscpp">trunk/Source/WebCore/platform/LocalizedStrings.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformLocalizedStringsh">trunk/Source/WebCore/platform/LocalizedStrings.h</a></li>
<li><a href="#trunkSourceWebCoreplatformeflLocalizedStringsEflcpp">trunk/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkLocalizedStringsGtkcpp">trunk/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsaccessibilityinputautofillbuttonexpectedtxt">trunk/LayoutTests/accessibility/input-auto-fill-button-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilityinputautofillbuttonhtml">trunk/LayoutTests/accessibility/input-auto-fill-button.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (184659 => 184660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-05-20 21:36:20 UTC (rev 184659)
+++ trunk/LayoutTests/ChangeLog        2015-05-20 21:38:01 UTC (rev 184660)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-05-20  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        AX: AutoFill button is not accessible with VoiceOver
+        https://bugs.webkit.org/show_bug.cgi?id=145200
+        &lt;rdar://problem/20507480&gt;
+
+        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 &lt;https://bugs.webkit.org/show_bug.cgi?id=140798&gt;.
+
</ins><span class="cx"> 2015-05-20  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Assertion failure in WebCore::BidiRun::BidiRun()
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilityinputautofillbuttonexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/input-auto-fill-button-expected.txt (0 => 184660)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+This tests that there exists an accessibility element for the AutoFill button.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS accessibilityController.accessibleElementById(&quot;password&quot;).childAtIndex(0).description is &quot;AXDescription: autofill&quot;
+PASS accessibilityController.accessibleElementById(&quot;password&quot;).childAtIndex(0).role is &quot;AXRole: AXButton&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsaccessibilityinputautofillbuttonhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/accessibility/input-auto-fill-button.html (0 => 184660)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;input type=&quot;password&quot; id=&quot;password&quot;&gt;
+&lt;script&gt;
+description(&quot;This tests that there exists an accessibility element for the AutoFill button.&quot;);
+
+if (!window.internals || !window.accessibilityController)
+    testFailed(&quot;You must run this test in the test tool and have implemented window.internals and window.accessibilityController.&quot;);
+else {
+    internals.setShowAutoFillButton(document.getElementById(&quot;password&quot;), true);
+
+    shouldBeEqualToString('accessibilityController.accessibleElementById(&quot;password&quot;).childAtIndex(0).description', &quot;AXDescription: autofill&quot;);
+    shouldBeEqualToString('accessibilityController.accessibleElementById(&quot;password&quot;).childAtIndex(0).role', &quot;AXRole: AXButton&quot;);
+}
+&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformwinTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/win/TestExpectations (184659 => 184660)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1322,6 +1322,8 @@
</span><span class="cx"> webkit.org/b/140798 [ Debug ] accessibility/html-html-element-is-ignored.html [ Skip ] # Debug assertion
</span><span class="cx"> webkit.org/b/140798 [ Release ] accessibility/inline-block-assertion.html [ Failure ]
</span><span class="cx"> webkit.org/b/140798 [ Debug ] accessibility/inline-block-assertion.html [ Skip ] # Debug assertion
</span><ins>+webkit.org/b/140798 [ Release ] accessibility/input-auto-fill-button.html [ Failure ]
+webkit.org/b/140798 [ Debug ] accessibility/input-auto-fill-button.html [ Failure ]
</ins><span class="cx"> webkit.org/b/140798 [ Release ] accessibility/input-type-hidden-in-aria-hidden-false.html [ Failure ]
</span><span class="cx"> webkit.org/b/140798 [ Debug ] accessibility/input-type-hidden-in-aria-hidden-false.html [ Skip ] # Debug assertion
</span><span class="cx"> webkit.org/b/140798 [ Release ] accessibility/legend-children-are-visible.html [ Failure ]
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (184659 => 184660)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2015-05-20  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        AX: AutoFill button is not accessible with VoiceOver
+        https://bugs.webkit.org/show_bug.cgi?id=145200
+        &lt;rdar://problem/20507480&gt;
+
+        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.
+
</ins><span class="cx"> 2015-05-20  Dean Jackson  &lt;dino@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Label text for default buttons don’t have the correct white color
</span></span></pre></div>
<a id="trunkSourceWebCoreEnglishlprojLocalizablestrings"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/English.lproj/Localizable.strings (184659 => 184660)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -760,6 +760,9 @@
</span><span class="cx"> /* accessibility description for a search field cancel button */
</span><span class="cx"> &quot;cancel&quot; = &quot;cancel&quot;;
</span><span class="cx"> 
</span><ins>+/* accessibility description for a password field AutoFill button */
+&quot;autofill&quot; = &quot;autofill&quot;;
+
</ins><span class="cx"> /* Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility */
</span><span class="cx"> &quot;check&quot; = &quot;check&quot;;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlTextFieldInputTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/TextFieldInputType.cpp (184659 => 184660)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #include &quot;HTMLInputElement.h&quot;
</span><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;KeyboardEvent.h&quot;
</span><ins>+#include &quot;LocalizedStrings.h&quot;
</ins><span class="cx"> #include &quot;NodeRenderStyle.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;PlatformKeyboardEvent.h&quot;
</span><span class="lines">@@ -602,6 +603,8 @@
</span><span class="cx"> 
</span><span class="cx">     m_autoFillButton = AutoFillButtonElement::create(element().document(), *this);
</span><span class="cx">     m_autoFillButton-&gt;setPseudo(AtomicString(&quot;-webkit-auto-fill-button&quot;, AtomicString::ConstructFromLiteral));
</span><ins>+    m_autoFillButton-&gt;setAttribute(aria_labelAttr, AtomicString(AXAutoFillButtonText()));
+    m_autoFillButton-&gt;setAttribute(roleAttr, AtomicString(&quot;button&quot;, AtomicString::ConstructFromLiteral));
</ins><span class="cx">     m_container-&gt;appendChild(m_autoFillButton, IGNORE_EXCEPTION);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformLocalizedStringscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/LocalizedStrings.cpp (184659 => 184660)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -653,6 +653,11 @@
</span><span class="cx"> }
</span><span class="cx"> #endif // !PLATFORM(IOS)
</span><span class="cx"> 
</span><ins>+String AXAutoFillButtonText()
+{
+    return WEB_UI_STRING(&quot;autofill&quot;, &quot;accessibility description for a password field AutoFill button&quot;);
+}
+
</ins><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> String AXARIAContentGroupText(const String&amp; ariaType)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformLocalizedStringsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/LocalizedStrings.h (184659 => 184660)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -162,7 +162,7 @@
</span><span class="cx">     String AXFooterRoleDescriptionText();
</span><span class="cx">     String AXFileUploadButtonText();
</span><span class="cx">     String AXSearchFieldCancelButtonText();
</span><del>-    
</del><ins>+
</ins><span class="cx">     String AXButtonActionVerb();
</span><span class="cx">     String AXRadioButtonActionVerb();
</span><span class="cx">     String AXTextFieldActionVerb();
</span><span class="lines">@@ -174,6 +174,8 @@
</span><span class="cx">     String AXListItemActionVerb();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    String AXAutoFillButtonText();
+
</ins><span class="cx"> #if ENABLE(INPUT_TYPE_WEEK)
</span><span class="cx">     // weekFormatInLDML() returns week and year format in LDML, Unicode
</span><span class="cx">     // technical standard 35, Locale Data Markup Language, e.g. &quot;'Week' ww, yyyy&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformeflLocalizedStringsEflcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/efl/LocalizedStringsEfl.cpp (184659 => 184660)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -408,6 +408,11 @@
</span><span class="cx">     return String::fromUTF8(&quot;cancel&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String AXAutoFillButtonText()
+{
+    return String::fromUTF8(&quot;autofill&quot;);
+}
+
</ins><span class="cx"> String AXButtonActionVerb()
</span><span class="cx"> {
</span><span class="cx">     return String::fromUTF8(&quot;press&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkLocalizedStringsGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp (184659 => 184660)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -456,6 +456,11 @@
</span><span class="cx">     return String::fromUTF8(_(&quot;cancel&quot;));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+String AXAutoFillButtonText()
+{
+    return String::fromUTF8(_(&quot;autofill&quot;));
+}
+
</ins><span class="cx"> String AXButtonActionVerb()
</span><span class="cx"> {
</span><span class="cx">     return String::fromUTF8(_(&quot;press&quot;));
</span></span></pre>
</div>
</div>

</body>
</html>