Title: [207014] trunk
- Revision
- 207014
- Author
- n_w...@apple.com
- Date
- 2016-10-10 13:11:50 -0700 (Mon, 10 Oct 2016)
Log Message
AX: Update AXPlaceHolder algorithm
https://bugs.webkit.org/show_bug.cgi?id=163229
Reviewed by Chris Fleizach.
Source/WebCore:
>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):
LayoutTests:
* accessibility/placeholder-expected.txt:
* accessibility/placeholder.html:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (207013 => 207014)
--- trunk/LayoutTests/ChangeLog 2016-10-10 19:57:55 UTC (rev 207013)
+++ trunk/LayoutTests/ChangeLog 2016-10-10 20:11:50 UTC (rev 207014)
@@ -1,3 +1,13 @@
+2016-10-10 Nan Wang <n_w...@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:
+
2016-10-10 Yusuke Suzuki <utatane....@gmail.com>
[DOMJIT] Implement Node accessors in DOMJIT
Modified: trunk/LayoutTests/accessibility/placeholder-expected.txt (207013 => 207014)
--- 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)
@@ -1,5 +1,6 @@
Birthday:
03-14-1879
+
This test makes sure that the placeholder is returned as the correct attribute
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
@@ -8,6 +9,7 @@
PASS fieldElement.stringAttributeValue('AXPlaceholderValue') is 'search'
PASS pass.stringAttributeValue('AXPlaceholderValue') is 'Password'
PASS search.stringAttributeValue('AXPlaceholderValue') is 'MM-DD-YYYY'
+PASS input.stringAttributeValue('AXPlaceholderValue') is 'Fill in the blank'
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/accessibility/placeholder.html (207013 => 207014)
--- 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)
@@ -12,6 +12,8 @@
<span id="label">Birthday:</span>
<div id="search" role="searchbox" aria-labelledby="label" aria-placeholder="MM-DD-YYYY">03-14-1879</div>
+ <input type="text" id="input" placeholder="Fill in the blank" aria-placeholder="aria placeholder">
+
<p id="description"></p>
<div id="console"></div>
@@ -29,7 +31,11 @@
var search = accessibilityController.accessibleElementById("search");
shouldBe("search.stringAttributeValue('AXPlaceholderValue')", "'MM-DD-YYYY'");
-
+
+ // 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'");
}
</script>
Modified: trunk/Source/WebCore/ChangeLog (207013 => 207014)
--- 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)
@@ -1,3 +1,20 @@
+2016-10-10 Nan Wang <n_w...@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):
+
2016-10-10 Yusuke Suzuki <utatane....@gmail.com>
[DOMJIT] Implement Node accessors in DOMJIT
Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (207013 => 207014)
--- 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)
@@ -2280,14 +2280,14 @@
const AtomicString& AccessibilityObject::placeholderValue() const
{
+ const AtomicString& placeholder = getAttribute(placeholderAttr);
+ if (!placeholder.isEmpty())
+ return placeholder;
+
const AtomicString& ariaPlaceholder = getAttribute(aria_placeholderAttr);
if (!ariaPlaceholder.isEmpty())
return ariaPlaceholder;
- const AtomicString& placeholder = getAttribute(placeholderAttr);
- if (!placeholder.isEmpty())
- return placeholder;
-
return nullAtom;
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes