[Web GPU] GPURenderPassEncoder updates: setBlendColor, setViewport, setScissorRect
[WebKit-https.git] / LayoutTests / accessibility / aria-combobox-control-owns-elements.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../resources/js-test-pre.js"></script>
5 <script src="../resources/accessibility-helper.js"></script>
6 </head>
7 <body id="body">
8
9 <!-- Example 1: controls a list -->
10 <input type="text" role="combobox" id="combobox1" aria-controls="list1" aria-label="Combobox1">
11 <div role="list" id="list1" aria-label="List1">
12 <div role="listitem" id="item1_1">item1</div>
13 <div role="listitem" id="item1_2">item2</div>
14 </div>
15
16 <!-- Example 2: owns a listbox -->
17 <input type="text" role="combobox" id="combobox2" aria-owns="listbox2" aria-label="Combobox2">
18 <div role="listbox" id="listbox2" aria-label="Listbox2">
19 <div role="option" id="option2_1">item1</div>
20 <div role="option" id="option2_2">item2</div>
21 </div>
22
23 <!-- Example 3: owns a grid -->
24 <input type="text" role="combobox" id="combobox3" aria-owns="grid3" aria-label="Combobox3">
25 <div role="grid" id="grid3" aria-label="Grid3">
26 <div role="row" id="row3_1">
27 <div role="gridcell" id="gridcell3_1">cell1</div>
28 </div>
29 </div>
30
31 <!-- Example 3: owns a tree -->
32 <input type="text" role="combobox" id="combobox4" aria-owns="tree4" aria-label="Combobox4">
33 <div role="tree" id="tree4" aria-label="Tree4">
34 <div role="treeitem" id="treeitem4_1">treeitem1</div>
35 <div role="treeitem" id="treeitem4_2">treeitem2</div>
36 </div>
37
38 <p id="description"></p>
39 <div id="console"></div>
40
41 <script>
42
43     description("This tests variations of the comboboxes and elements it can control and own. Then verifies the active-descendant is reflected correctly.");
44
45     if (window.accessibilityController) {
46         window.jsTestIsAsync = true;
47         var selectedChildrenChangeCount = 0;
48
49         window.accessibilityController.addNotificationListener(function (target, notification) {
50             if (notification == "AXSelectedChildrenChanged" || notification == "AXSelectedRowsChanged") {
51                 selectedChildrenChangeCount++;
52                 var targetString = platformValueForW3CName(target);
53                 debug("Received " + notification + " for " + targetString);
54                 if (selectedChildrenChangeCount == 4) {
55                     accessibilityController.removeNotificationListener();
56                     finishJSTest(); 
57                 }
58             }
59         });
60
61         // Example 1: aria-controls a list.
62         document.getElementById("combobox1").focus();
63         var list = accessibilityController.accessibleElementById("list1");
64         shouldBe("list.selectedChildrenCount", "0");
65         // Set active-descendant, verify notification is sent and that list has correct selected children.
66         document.getElementById("combobox1").setAttribute("aria-activedescendant", "item1_1");
67         var listitem1 = accessibilityController.accessibleElementById("item1_1");
68         shouldBe("list.selectedChildrenCount", "1");
69         shouldBeTrue("list.selectedChildAtIndex(0).isEqual(listitem1)");
70
71         // Example 2: aria-owns a listbox.
72         document.getElementById("combobox2").focus();
73         var listbox = accessibilityController.accessibleElementById("listbox2");
74         shouldBe("listbox.selectedChildrenCount", "0");
75         // Set active-descendant, verify notification is sent and that list has correct selected children.
76         document.getElementById("combobox2").setAttribute("aria-activedescendant", "option2_1");
77         var option2_1 = accessibilityController.accessibleElementById("option2_1");
78         shouldBe("listbox.selectedChildrenCount", "1");
79         shouldBeTrue("listbox.selectedChildAtIndex(0).isEqual(option2_1)");
80
81         // Example 3: aria-owns a grid.
82         document.getElementById("combobox3").focus();
83         var grid = accessibilityController.accessibleElementById("grid3");
84         shouldBe("grid.selectedChildrenCount", "0");
85         // Set active-descendant, verify notification is sent and that list has correct selected children.
86         document.getElementById("combobox3").setAttribute("aria-activedescendant", "row3_1");
87         var row3_1 = accessibilityController.accessibleElementById("row3_1");
88         shouldBe("grid.selectedChildrenCount", "1");
89         shouldBeTrue("grid.selectedChildAtIndex(0).isEqual(row3_1)");
90
91         // Example 4: aria-owns a tree.
92         document.getElementById("combobox4").focus();
93         var tree = accessibilityController.accessibleElementById("tree4");
94         shouldBe("tree.selectedChildrenCount", "0");
95         // Set active-descendant, verify notification is sent and that list has correct selected children.
96         document.getElementById("combobox4").setAttribute("aria-activedescendant", "treeitem4_1");
97         var treeitem4_1 = accessibilityController.accessibleElementById("treeitem4_1");
98         shouldBe("tree.selectedChildrenCount", "1");
99         shouldBeTrue("tree.selectedChildAtIndex(0).isEqual(treeitem4_1)");
100     }
101
102 </script>
103
104 <script src="../resources/js-test-post.js"></script>
105 </body>
106 </html>
107