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

Unified Diff: LayoutTests/accessibility/listitem-presentation-inherited.html

Issue 856473002: Inherit Presentation role only when elements without a explicit role defined. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 months 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
« no previous file with comments | « no previous file | LayoutTests/accessibility/listitem-presentation-inherited-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/accessibility/listitem-presentation-inherited.html
diff --git a/LayoutTests/accessibility/listitem-presentation-inherited.html b/LayoutTests/accessibility/listitem-presentation-inherited.html
new file mode 100644
index 0000000000000000000000000000000000000000..25c3897881ce20a15899249f74016367f02c0c86
--- /dev/null
+++ b/LayoutTests/accessibility/listitem-presentation-inherited.html
@@ -0,0 +1,51 @@
+<script src="../resources/js-test.js"></script>
+<ul role="presentation">
+<li role="listitem">Item 1</li>
dmazzoni 2015/01/15 16:05:30 nit: could you indent the <li> elements inside the
+<li role="listitem">Item 2</li>
+<li role="listitem">Item 3</li>
+</ul>
+
+<ul role="presentation">
+<li>Plain Text 1</li>
+<li>Plain Text 2</li>
+<li>Plain Text 3</li>
+</ul>
+<p>End of test</p>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description("This tests that the presentation role is inherited.");
+
+if (window.testRunner)
+ testRunner.dumpAsText();
+
+function buildAccessibilityTree(accessibilityObject, indent) {
+ var str = "";
+ for (var i = 0; i < indent; i++)
+ str += " ";
+ str += accessibilityObject.role;
+ str += " " + accessibilityObject.stringValue;
+
+ if (accessibilityObject.role == '')
+ str += accessibilityObject.allAttributes();
+
+ str += "\n";
+ document.getElementById("console").innerText += str;
+
+ if (accessibilityObject.stringValue.indexOf('End of test') >= 0)
+ return false;
+
+ var count = accessibilityObject.childrenCount;
+ for (var i = 0; i < count; ++i) {
+ if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
+ return false;
+ }
+
+ return true;
+}
+
+if (window.accessibilityController) {
+ var body = accessibilityController.focusedElement;
+ buildAccessibilityTree(body, 0);
+}
+</script>
« no previous file with comments | « no previous file | LayoutTests/accessibility/listitem-presentation-inherited-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698