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> |