4 <script src="../fast/js/resources/js-test-pre.js"></script>
6 <div id="myContainer" tabindex="-1">
8 <button>Button</button>
10 <input type="checkbox">
13 <select><option>1<option>2</select>
14 <span tabindex="0" role="button">ARIA button</span>
15 <span tabindex="0" role="link">ARIA link</span>
18 <canvas id="myCanvas" width="300" height="300" tabindex="-1">
20 <button>Button</button>
22 <input type="checkbox">
25 <select><option>1<option>2</select>
26 <span tabindex="0" role="button">ARIA button</span>
27 <span tabindex="0" role="link">ARIA link</span>
30 <div id="console"></div>
32 description("This test makes sure that AccessibilityNodeObjects are created for elements in a canvas subtree.");
34 if (window.layoutTestController && window.accessibilityController) {
35 window.layoutTestController.dumpAsText();
37 function appendFocusableDescendants(axObject, axFocusableList) {
38 for (var i = 0; i < axObject.childrenCount; i++) {
39 var axChild = axObject.childAtIndex(i);
40 if (axChild.isFocusable)
41 axFocusableList.push(axChild);
42 appendFocusableDescendants(axChild, axFocusableList);
46 var container = document.getElementById("myContainer");
48 var axContainer = accessibilityController.focusedElement;
50 var canvas = document.getElementById("myCanvas");
52 var axCanvas = accessibilityController.focusedElement;
54 var axRenderObjects = [];
55 var axNodeObjects = [];
57 appendFocusableDescendants(axContainer, axRenderObjects);
58 appendFocusableDescendants(axCanvas, axNodeObjects);
60 shouldBe("axRenderObjects.length", "axNodeObjects.length");
62 for (var i = 0; i < axRenderObjects.length; i++) {
63 var axRenderObject = axRenderObjects[i];
64 var axNodeObject = axNodeObjects[i];
65 shouldBe("i == " + i + "; axRenderObject.role == axNodeObject.role", "true");
71 <script src="../fast/js/resources/js-test-post.js"></script>