No subject


Tue May 3 15:05:30 PDT 2016


When the placeholder and aria-placeholder attributes are both present, we
should expose the value of the placeholder attribute. Updated the algorithm
for that.

Changes are covered in the modified test.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::placeholderValue):

LayoutTests:

* accessibility/placeholder-expected.txt:
* accessibility/placeholder.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsaccessibilityplaceholderexpectedtxt">trunk/LayoutTests/accessibility/placeholder-expected.txt</a></li>
<li><a href="#trunkLayoutTestsaccessibilityplaceholderhtml">trunk/LayoutTests/accessibility/placeholder.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityObject.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (207013 => 207014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog	2016-10-10 19:57:55 UTC (rev 207013)
+++ trunk/LayoutTests/ChangeLog	2016-10-10 20:11:50 UTC (rev 207014)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-10-10  Nan Wang  &lt;n_wang at apple.com&gt;
+
+        AX: Update AXPlaceHolder algorithm
+        https://bugs.webkit.org/show_bug.cgi?id=163229
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/placeholder-expected.txt:
+        * accessibility/placeholder.html:
+
</ins><span class="cx"> 2016-10-10  Yusuke Suzuki  &lt;utatane.tea at gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [DOMJIT] Implement Node accessors in DOMJIT
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilityplaceholderexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/placeholder-expected.txt (207013 => 207014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/placeholder-expected.txt	2016-10-10 19:57:55 UTC (rev 207013)
+++ trunk/LayoutTests/accessibility/placeholder-expected.txt	2016-10-10 20:11:50 UTC (rev 207014)
</span><span class="lines">@@ -1,5 +1,6 @@
</span><span class="cx">    Birthday:
</span><span class="cx"> 03-14-1879
</span><ins>+
</ins><span class="cx"> This test makes sure that the placeholder is returned as the correct attribute
</span><span class="cx"> 
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="lines">@@ -8,6 +9,7 @@
</span><span class="cx"> PASS fieldElement.stringAttributeValue('AXPlaceholderValue') is 'search'
</span><span class="cx"> PASS pass.stringAttributeValue('AXPlaceholderValue') is 'Password'
</span><span class="cx"> PASS search.stringAttributeValue('AXPlaceholderValue') is 'MM-DD-YYYY'
</span><ins>+PASS input.stringAttributeValue('AXPlaceholderValue') is 'Fill in the blank'
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsaccessibilityplaceholderhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/accessibility/placeholder.html (207013 => 207014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/accessibility/placeholder.html	2016-10-10 19:57:55 UTC (rev 207013)
+++ trunk/LayoutTests/accessibility/placeholder.html	2016-10-10 20:11:50 UTC (rev 207014)
</span><span class="lines">@@ -12,6 +12,8 @@
</span><span class="cx">     &lt;span id=&quot;label&quot;&gt;Birthday:&lt;/span&gt;
</span><span class="cx">     &lt;div id=&quot;search&quot; role=&quot;searchbox&quot; aria-labelledby=&quot;label&quot; aria-placeholder=&quot;MM-DD-YYYY&quot;&gt;03-14-1879&lt;/div&gt;
</span><span class="cx">     
</span><ins>+    &lt;input type=&quot;text&quot; id=&quot;input&quot; placeholder=&quot;Fill in the blank&quot; aria-placeholder=&quot;aria placeholder&quot;&gt;
+    
</ins><span class="cx">     &lt;p id=&quot;description&quot;&gt;&lt;/p&gt;
</span><span class="cx">     &lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
</span><span class="cx">      
</span><span class="lines">@@ -29,7 +31,11 @@
</span><span class="cx">             
</span><span class="cx">             var search = accessibilityController.accessibleElementById(&quot;search&quot;);
</span><span class="cx">             shouldBe(&quot;search.stringAttributeValue('AXPlaceholderValue')&quot;, &quot;'MM-DD-YYYY'&quot;);
</span><del>-
</del><ins>+            
+            // When the placeholder and aria-placeholder attributes are both present, use the placeholder
+            // attribute's value.
+            var input = accessibilityController.accessibleElementById(&quot;input&quot;);
+            shouldBe(&quot;input.stringAttributeValue('AXPlaceholderValue')&quot;, &quot;'Fill in the blank'&quot;);
</ins><span class="cx">         }
</span><span class="cx">     &lt;/script&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (207013 => 207014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog	2016-10-10 19:57:55 UTC (rev 207013)
+++ trunk/Source/WebCore/ChangeLog	2016-10-10 20:11:50 UTC (rev 207014)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2016-10-10  Nan Wang  &lt;n_wang at apple.com&gt;
+
+        AX: Update AXPlaceHolder algorithm
+        https://bugs.webkit.org/show_bug.cgi?id=163229
+
+        Reviewed by Chris Fleizach.
+
+        From https://w3c.github.io/html-aam/
+        When the placeholder and aria-placeholder attributes are both present, we
+        should expose the value of the placeholder attribute. Updated the algorithm
+        for that.
+
+        Changes are covered in the modified test.
+
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::placeholderValue):
+
</ins><span class="cx"> 2016-10-10  Yusuke Suzuki  &lt;utatane.tea at gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [DOMJIT] Implement Node accessors in DOMJIT
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (207013 => 207014)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2016-10-10 19:57:55 UTC (rev 207013)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2016-10-10 20:11:50 UTC (rev 207014)
</span><span class="lines">@@ -2280,14 +2280,14 @@
</span><span class="cx"> 
</span><span class="cx"> const AtomicString&amp; AccessibilityObject::placeholderValue() const
</span><span class="cx"> {
</span><ins>+    const AtomicString&amp; placeholder = getAttribute(placeholderAttr);
+    if (!placeholder.isEmpty())
+        return placeholder;
+    
</ins><span class="cx">     const AtomicString&amp; ariaPlaceholder = getAttribute(aria_placeholderAttr);
</span><span class="cx">     if (!ariaPlaceholder.isEmpty())
</span><span class="cx">         return ariaPlaceholder;
</span><span class="cx">     
</span><del>-    const AtomicString&amp; placeholder = getAttribute(placeholderAttr);
-    if (!placeholder.isEmpty())
-        return placeholder;
-    
</del><span class="cx">     return nullAtom;
</span><span class="cx"> }
</span><span class="cx">     
</span></span></pre>
</div>
</div>

</body>
</html>


More information about the webkit-changes mailing list