Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Unified Diff: third_party/WebKit/LayoutTests/accessibility/description-calc-inputs.html

Issue 2492083002: Implement aria-placeholder (Closed)
Patch Set: Rebaseline android placeholder test Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/accessibility/description-calc-inputs.html
diff --git a/third_party/WebKit/LayoutTests/accessibility/description-calc-inputs.html b/third_party/WebKit/LayoutTests/accessibility/description-calc-inputs.html
index 44c70e28f2cfe6935f2aad5108643afa8b3bdb0c..ee144b5b8cecec3ec014dc0f1822c11839936233 100644
--- a/third_party/WebKit/LayoutTests/accessibility/description-calc-inputs.html
+++ b/third_party/WebKit/LayoutTests/accessibility/description-calc-inputs.html
@@ -23,6 +23,34 @@ test(function(t) {
</script>
<div class="container">
+ <input id="text1a" type="text" aria-placeholder="ARIA Placeholder">
+</div>
+
+<script>
+test(function(t) {
+ var axTextInput1a = accessibilityController.accessibleElementById("text1a");
+ assert_equals(axTextInput1a.name, "ARIA Placeholder");
+ assert_equals(axTextInput1a.nameFrom, "placeholder");
+ assert_equals(axTextInput1a.description, "");
+ assert_equals(axTextInput1a.descriptionFrom, "");
+}, "Text input uses ARIA placeholder as accessible name if that's the only accessible text.");
+</script>
+
+<div class="container">
+ <input id="text1b" type="text" aria-placeholder="ARIA Placeholder" placeholder="Placeholder">
+</div>
+
+<script>
+test(function(t) {
+ var axTextInput1b = accessibilityController.accessibleElementById("text1b");
+ assert_equals(axTextInput1b.name, "Placeholder");
+ assert_equals(axTextInput1b.nameFrom, "placeholder");
+ assert_equals(axTextInput1b.description, "");
+ assert_equals(axTextInput1b.descriptionFrom, "");
+}, "Text input uses placeholder in preference to ARIA placeholder for accessible name.");
+</script>
+
+<div class="container">
<input id="text2" type="text" aria-label="Label" placeholder="Placeholder">
</div>
@@ -31,9 +59,40 @@ test(function(t) {
var axTextInput2 = accessibilityController.accessibleElementById("text2");
assert_equals(axTextInput2.name, "Label");
assert_equals(axTextInput2.nameFrom, "attribute");
- assert_equals(axTextInput2.description, "Placeholder");
- assert_equals(axTextInput2.descriptionFrom, "placeholder");
-}, "Text input uses placeholder as accessible description if it wasn't used as the accessible name.");
+ assert_equals(axTextInput2.description, "");
+ assert_equals(axTextInput2.descriptionFrom, "");
+ assert_equals(axTextInput2.placeholder, "Placeholder");
+}, "Text input uses placeholder as accessible placeholder (not description) if it wasn't used as the accessible name.");
+</script>
+
+<div class="container">
+ <input id="text2a" type="text" aria-label="Label" aria-placeholder="ARIA Placeholder">
+</div>
+
+<script>
+test(function(t) {
+ var axTextInput2a = accessibilityController.accessibleElementById("text2a");
+ assert_equals(axTextInput2a.name, "Label");
+ assert_equals(axTextInput2a.nameFrom, "attribute");
+ assert_equals(axTextInput2a.description, "");
+ assert_equals(axTextInput2a.descriptionFrom, "");
+ assert_equals(axTextInput2a.placeholder, "ARIA Placeholder");
+}, "Text input uses aria-placeholder as accessible placeholder if it wasn't used as the accessible name.");
+</script>
+
+<div class="container">
+ <input id="text2b" type="text" aria-label="Label" aria-placeholder="ARIA Placeholder" placeholder="Placeholder">
+</div>
+
+<script>
+test(function(t) {
+ var axTextInput2b = accessibilityController.accessibleElementById("text2b");
+ assert_equals(axTextInput2b.name, "Label");
+ assert_equals(axTextInput2b.nameFrom, "attribute");
+ assert_equals(axTextInput2b.description, "");
+ assert_equals(axTextInput2b.descriptionFrom, "");
+ assert_equals(axTextInput2b.placeholder, "Placeholder");
+}, "Text input uses placeholder in preference to ARIA placeholder for accessible placeholder.");
</script>
<div class="container">
@@ -48,7 +107,8 @@ test(function(t) {
assert_equals(axTextInput3.nameFrom, "attribute");
assert_equals(axTextInput3.description, "DescribedBy");
assert_equals(axTextInput3.descriptionFrom, "relatedElement");
-}, "aria-describedby overrides placeholder as the accessible description.");
+ assert_equals(axTextInput3.placeholder, "Placeholder");
+}, "aria-describedby is used as the accessible description, placeholder is used as placeholder.");
</script>
<div class="container">
@@ -95,22 +155,8 @@ test(function(t) {
</script>
<div class="container">
- <input id="text7" type="text" aria-label="Label" title="Title" placeholder="Placeholder">
-</div>
-
-<script>
-test(function(t) {
- var axTextInput7 = accessibilityController.accessibleElementById("text7");
- assert_equals(axTextInput7.name, "Label");
- assert_equals(axTextInput7.nameFrom, "attribute");
- assert_equals(axTextInput7.description, "Placeholder");
- assert_equals(axTextInput7.descriptionFrom, "placeholder");
-}, "placeholder overrides title as the accessible description.");
-</script>
-
-<div class="container">
- <input id="text8" type="text" aria-describedby="describedby8">
- <p id="describedby8">
+ <input id="text7" type="text" aria-describedby="describedby7">
+ <p id="describedby7">
Described
<br>
By
@@ -119,11 +165,11 @@ test(function(t) {
<script>
test(function(t) {
- var axTextInput8 = accessibilityController.accessibleElementById("text8");
- assert_equals(axTextInput8.name, "");
- assert_equals(axTextInput8.nameFrom, "");
- assert_equals(axTextInput8.description, "Described By");
- assert_equals(axTextInput8.descriptionFrom, "relatedElement");
+ var axTextInput7 = accessibilityController.accessibleElementById("text7");
+ assert_equals(axTextInput7.name, "");
+ assert_equals(axTextInput7.nameFrom, "");
+ assert_equals(axTextInput7.description, "Described By");
+ assert_equals(axTextInput7.descriptionFrom, "relatedElement");
}, "aria-describedby does not include newlines.");
</script>

Powered by Google App Engine
This is Rietveld 408576698