Changeset 267477 in webkit
- Timestamp:
- Sep 23, 2020, 8:53:01 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/accessibility/aria-combobox-control-owns-elements-expected.txt (modified) (1 diff)
-
LayoutTests/accessibility/aria-combobox-control-owns-elements.html (modified) (3 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/accessibility/AXObjectCache.cpp (modified) (2 diffs)
-
Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r267476 r267477 1 2020-09-23 Andres Gonzalez <andresg_22@apple.com> 2 3 Fix for accessibility/aria-combobox-control-owns-elements.html in isolated tree mode. 4 https://bugs.webkit.org/show_bug.cgi?id=216878 5 6 Reviewed by Chris Fleizach. 7 8 Use Promises to make this test work reliably for both single and multithreaded accessibility modes. 9 10 * accessibility/aria-combobox-control-owns-elements-expected.txt: 11 * accessibility/aria-combobox-control-owns-elements.html: 12 1 13 2020-09-23 Darin Adler <darin@apple.com> 2 14 -
trunk/LayoutTests/accessibility/aria-combobox-control-owns-elements-expected.txt
r227144 r267477 16 16 17 17 PASS list.selectedChildrenCount is 0 18 PASS list.selectedChildrenCount is 119 PASS list.selectedChildAtIndex(0).isEqual(listitem1) is true20 PASS listbox.selectedChildrenCount is 021 PASS listbox.selectedChildrenCount is 122 PASS listbox.selectedChildAtIndex(0).isEqual(option2_1) is true23 PASS grid.selectedChildrenCount is 024 PASS grid.selectedChildrenCount is 125 PASS grid.selectedChildAtIndex(0).isEqual(row3_1) is true26 PASS tree.selectedChildrenCount is 027 PASS tree.selectedChildrenCount is 128 PASS tree.selectedChildAtIndex(0).isEqual(treeitem4_1) is true29 18 Received AXSelectedChildrenChanged for List1 19 list has 1 selected children 20 PASS list.selectedChildAtIndex(0) is listitem1 21 listbox has 0 selected children 30 22 Received AXSelectedChildrenChanged for Listbox2 23 listbox has 1 selected children 24 PASS listbox.selectedChildAtIndex(0) is option2_1 25 grid has 0 selected children 31 26 Received AXSelectedRowsChanged for Grid3 27 grid has 1 selected children 28 PASS grid.selectedChildAtIndex(0) is row3_1 29 tree has 0 selected children 32 30 Received AXSelectedRowsChanged for Tree4 31 tree has 1 selected children 32 PASS tree.selectedChildAtIndex(0) is treeitem4_1 33 33 PASS successfullyParsed is true 34 34 -
trunk/LayoutTests/accessibility/aria-combobox-control-owns-elements.html
r227144 r267477 40 40 41 41 <script> 42 43 42 description("This tests variations of the comboboxes and elements it can control and own. Then verifies the active-descendant is reflected correctly."); 44 43 … … 52 51 var targetString = platformValueForW3CName(target); 53 52 debug("Received " + notification + " for " + targetString); 54 if (selectedChildrenChangeCount == 4) {55 accessibilityController.removeNotificationListener();56 finishJSTest();57 }58 53 } 59 54 }); … … 66 61 document.getElementById("combobox1").setAttribute("aria-activedescendant", "item1_1"); 67 62 var listitem1 = accessibilityController.accessibleElementById("item1_1"); 68 shouldBe("list.selectedChildrenCount", "1"); 69 shouldBeTrue("list.selectedChildAtIndex(0).isEqual(listitem1)"); 63 setTimeout(async function() { 64 debug("list has " + list.selectedChildrenCount + " selected children"); 65 debug(list.selectedChildAtIndex(0).isEqual(listitem1) 66 ? "PASS list.selectedChildAtIndex(0) is listitem1" 67 : "FAIL list.selectedChildAtIndex(0) is not listitem1"); 70 68 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)"); 69 // Example 2: aria-owns a listbox. 70 document.getElementById("combobox2").focus(); 71 var listbox = accessibilityController.accessibleElementById("listbox2"); 72 debug("listbox has " + listbox.selectedChildrenCount + " selected children"); 73 // Set active-descendant, verify notification is sent and that list has correct selected children. 74 document.getElementById("combobox2").setAttribute("aria-activedescendant", "option2_1"); 75 var option2_1 = accessibilityController.accessibleElementById("option2_1"); 76 await waitFor(() => { 77 return selectedChildrenChangeCount == 2 && listbox.selectedChildrenCount; 78 }); 79 debug("listbox has " + listbox.selectedChildrenCount + " selected children"); 80 debug(listbox.selectedChildAtIndex(0).isEqual(option2_1) 81 ? "PASS listbox.selectedChildAtIndex(0) is option2_1" 82 : "FAIL listbox.selectedChildAtIndex(0) is not option2_1"); 80 83 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)"); 84 // Example 3: aria-owns a grid. 85 document.getElementById("combobox3").focus(); 86 var grid = accessibilityController.accessibleElementById("grid3"); 87 debug("grid has " + grid.selectedChildrenCount + " selected children"); 88 // Set active-descendant, verify notification is sent and that list has correct selected children. 89 document.getElementById("combobox3").setAttribute("aria-activedescendant", "row3_1"); 90 var row3_1 = accessibilityController.accessibleElementById("row3_1"); 91 await waitFor(() => { 92 return selectedChildrenChangeCount == 3 && grid.selectedChildrenCount; 93 }); 94 debug("grid has " + grid.selectedChildrenCount + " selected children"); 95 debug(grid.selectedChildAtIndex(0).isEqual(row3_1) 96 ? "PASS grid.selectedChildAtIndex(0) is row3_1" 97 : "FAIL grid.selectedChildAtIndex(0) is not row3_1"); 90 98 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)"); 99 // Example 4: aria-owns a tree. 100 document.getElementById("combobox4").focus(); 101 var tree = accessibilityController.accessibleElementById("tree4"); 102 debug("tree has " + tree.selectedChildrenCount + " selected children"); 103 // Set active-descendant, verify notification is sent and that list has correct selected children. 104 document.getElementById("combobox4").setAttribute("aria-activedescendant", "treeitem4_1"); 105 var treeitem4_1 = accessibilityController.accessibleElementById("treeitem4_1"); 106 await waitFor(() => { 107 return selectedChildrenChangeCount == 4 && tree.selectedChildrenCount; 108 }); 109 debug("tree has " + tree.selectedChildrenCount + " selected children"); 110 debug(tree.selectedChildAtIndex(0).isEqual(treeitem4_1) 111 ? "PASS tree.selectedChildAtIndex(0) is treeitem4_1" 112 : "FAIL tree.selectedChildAtIndex(0) is not treeitem4_1"); 113 114 accessibilityController.removeNotificationListener(); 115 finishJSTest(); 116 }, 0); 100 117 } 101 102 118 </script> 103 104 119 <script src="../resources/js-test-post.js"></script> 105 120 </body> 106 121 </html> 107 -
trunk/Source/WebCore/ChangeLog
r267474 r267477 1 2020-09-23 Andres Gonzalez <andresg_22@apple.com> 2 3 Fix for accessibility/aria-combobox-control-owns-elements.html in isolated tree mode. 4 https://bugs.webkit.org/show_bug.cgi?id=216878 5 6 Reviewed by Chris Fleizach. 7 8 Test: accessibility/aria-combobox-control-owns-elements.html. 9 10 * accessibility/AXObjectCache.cpp: 11 (WebCore::AXObjectCache::updateIsolatedTree): Update the isolated tree 12 node for ActiveDescendant and SelectedChildren notifications. 13 * accessibility/isolatedtree/AXIsolatedObject.cpp: 14 (WebCore::AXIsolatedObject::initializeAttributeData): Only cache 15 selectedChildren for those AXObjects that canHaveSelectedChildren. 16 1 17 2020-09-23 Philippe Normand <pnormand@igalia.com> 2 18 -
trunk/Source/WebCore/accessibility/AXObjectCache.cpp
r267363 r267477 3183 3183 tree->updateNodeCheckedState(object); 3184 3184 break; 3185 case AXActiveDescendantChanged: 3186 case AXSelectedChildrenChanged: 3185 3187 case AXSelectedTextChanged: 3186 3188 case AXValueChanged: … … 3245 3247 tree->updateNodeCheckedState(*notification.first); 3246 3248 break; 3249 case AXActiveDescendantChanged: 3250 case AXSelectedChildrenChanged: 3247 3251 case AXSelectedTextChanged: 3248 3252 case AXValueChanged: { -
trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp
r267320 r267477 285 285 setProperty(AXPropertyName::TextLength, object.textLength()); 286 286 287 AccessibilityChildrenVector selectedChildren; 288 object.selectedChildren(selectedChildren); 289 setObjectVectorProperty(AXPropertyName::SelectedChildren, selectedChildren); 287 if (object.canHaveSelectedChildren()) { 288 AccessibilityChildrenVector selectedChildren; 289 object.selectedChildren(selectedChildren); 290 setObjectVectorProperty(AXPropertyName::SelectedChildren, selectedChildren); 291 } 290 292 291 293 AccessibilityChildrenVector visibleChildren;
Note:
See TracChangeset
for help on using the changeset viewer.