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 <n_wang at apple.com>
+
+ 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 <utatane.tea at gmail.com>
</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 "PASS" messages, followed by "TEST COMPLETE".
</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"> <span id="label">Birthday:</span>
</span><span class="cx"> <div id="search" role="searchbox" aria-labelledby="label" aria-placeholder="MM-DD-YYYY">03-14-1879</div>
</span><span class="cx">
</span><ins>+ <input type="text" id="input" placeholder="Fill in the blank" aria-placeholder="aria placeholder">
+
</ins><span class="cx"> <p id="description"></p>
</span><span class="cx"> <div id="console"></div>
</span><span class="cx">
</span><span class="lines">@@ -29,7 +31,11 @@
</span><span class="cx">
</span><span class="cx"> var search = accessibilityController.accessibleElementById("search");
</span><span class="cx"> shouldBe("search.stringAttributeValue('AXPlaceholderValue')", "'MM-DD-YYYY'");
</span><del>-
</del><ins>+
+ // When the placeholder and aria-placeholder attributes are both present, use the placeholder
+ // attribute's value.
+ var input = accessibilityController.accessibleElementById("input");
+ shouldBe("input.stringAttributeValue('AXPlaceholderValue')", "'Fill in the blank'");
</ins><span class="cx"> }
</span><span class="cx"> </script>
</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 <n_wang at apple.com>
+
+ 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 <utatane.tea at gmail.com>
</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& AccessibilityObject::placeholderValue() const
</span><span class="cx"> {
</span><ins>+ const AtomicString& placeholder = getAttribute(placeholderAttr);
+ if (!placeholder.isEmpty())
+ return placeholder;
+
</ins><span class="cx"> const AtomicString& 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& 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