Changeset 293291 in webkit
- Timestamp:
- Apr 23, 2022, 9:30:25 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/accessibility/aria-expanded-supported-roles.html (modified) (2 diffs)
-
LayoutTests/accessibility/mac/heading-clickpoint-expected.txt (modified) (1 diff)
-
LayoutTests/accessibility/mac/heading-clickpoint.html (modified) (1 diff)
-
LayoutTests/platform/glib/accessibility/aria-expanded-supported-roles-expected.txt (modified) (2 diffs)
-
LayoutTests/platform/mac/accessibility/aria-expanded-supported-roles-expected.txt (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/accessibility/AXObjectCache.cpp (modified) (2 diffs)
-
Source/WebCore/accessibility/AccessibilityARIAGridRow.cpp (modified) (1 diff)
-
Source/WebCore/accessibility/AccessibilityObject.cpp (modified) (1 diff)
-
Source/WebCore/accessibility/AccessibilityObject.h (modified) (1 diff)
-
Source/WebCore/accessibility/AccessibilityRenderObject.cpp (modified) (1 diff)
-
Source/WebCore/accessibility/AccessibilityRenderObject.h (modified) (1 diff)
-
Source/WebCore/accessibility/AccessibilityTableCell.cpp (modified) (1 diff)
-
Source/WebCore/accessibility/AccessibilityTableCell.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r293289 r293291 1 2022-04-23 Andres Gonzalez <andresg_22@apple.com> 2 3 AX ITM: Table row objects should return a non-null unignored parent even when a table object is not found in its ancestry. 4 https://bugs.webkit.org/show_bug.cgi?id=239606 5 <rdar://problem/92094205> 6 7 Reviewed by Chris Fleizach. 8 9 * accessibility/aria-expanded-supported-roles.html: 10 * accessibility/mac/heading-clickpoint-expected.txt: 11 * accessibility/mac/heading-clickpoint.html: 12 * platform/mac/accessibility/aria-expanded-supported-roles-expected.txt: 13 1 14 2022-04-23 Carlos Garcia Campos <cgarcia@igalia.com> 2 15 -
trunk/LayoutTests/accessibility/aria-expanded-supported-roles.html
r283078 r293291 1 1 <!DOCTYPE HTML> 2 2 <html> 3 <head> 4 <script src="../resources/js-test.js"></script> 5 </head> 3 6 <body> 4 <script src="../resources/js-test-pre.js"></script> 7 5 8 <div id="content"> 6 9 <div id="alert" role="alert" aria-expanded="true"></div> … … 88 91 <div id="treeitem" role="treeitem" aria-expanded="true"></div> 89 92 </div> 90 <p id="description"></p> 91 <div id="console"></div> 93 92 94 <script> 93 description("Verify which roles support aria-expanded."); 94 if (window.accessibilityController) { 95 Array.from(document.getElementById("content").children).forEach(element => { 96 var axElement = accessibilityController.accessibleElementById(element.id); 97 if (axElement && axElement.isExpanded) 98 debug(axElement.role + " is expanded"); 99 }); 100 document.getElementById("content").style.visibility = "hidden"; 101 } 95 if (window.accessibilityController) { 96 let output = "Verify which roles support aria-expanded.\n"; 97 98 Array.from(document.getElementById("content").children).forEach((element) => { 99 let axElement = accessibilityController.accessibleElementById(element.id); 100 if (axElement && axElement.isExpanded) 101 output += `${axElement.role} is expanded\n`; 102 }); 103 104 debug(output); 105 document.getElementById("content").style.visibility = "hidden"; 106 } 102 107 </script> 103 <script src="../resources/js-test-post.js"></script>104 108 </body> 105 109 </html> -
trunk/LayoutTests/accessibility/mac/heading-clickpoint-expected.txt
r187799 r293291 1 Small heading 1 This tests that the click points for headings should use the only child's clickpoint instead of taking the mid point (which may be on nothing). 2 PASS: heading1.clickPointX === heading1.childAtIndex(0).clickPointX 3 PASS: heading1.clickPointY === heading1.childAtIndex(0).clickPointY 4 PASS: heading2.clickPointX === heading2.childAtIndex(0).clickPointX 5 PASS: heading2.clickPointY === heading2.childAtIndex(0).clickPointY 6 PASS: heading3.clickPointX == heading3.childAtIndex(0).clickPointX === false 2 7 3 A heading that is just a little bit wider4 5 Small heading Small heading6 7 This tests that the click points for headings should use the only child's clickpoint instead of taking the mid point (which may be on nothing).8 9 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".10 11 12 PASS heading1.clickPointX is heading1.childAtIndex(0).clickPointX13 PASS heading1.clickPointY is heading1.childAtIndex(0).clickPointY14 PASS heading2.clickPointX is heading2.childAtIndex(0).clickPointX15 PASS heading2.clickPointY is heading2.childAtIndex(0).clickPointY16 PASS heading3.clickPointX == heading3.childAtIndex(0).clickPointX is false17 8 PASS successfullyParsed is true 18 9 19 10 TEST COMPLETE 20 11 12 13 -
trunk/LayoutTests/accessibility/mac/heading-clickpoint.html
r187799 r293291 2 2 <html> 3 3 <head> 4 <script src="../../resources/js-test-pre.js"></script> 4 <script src="../../resources/js-test.js"></script> 5 <script src="../../resources/accessibility-helper.js"></script> 5 6 </head> 6 <body id="body">7 <body> 7 8 8 <h1 tabindex="0" id="heading1">Small heading</h1> 9 <h1 tabindex="0" id="heading2"><a href="#">A heading that is just a little bit wider</a></h1> 9 <div id="content"> 10 <h1 id="heading1">Small heading</h1> 11 <h1 id="heading2"><a href="#">A heading that is just a little bit wider</a></h1> 10 12 11 <h1 tabindex="0" id="heading3"><a href="#">Small heading</a> <a href="#">Small heading</a></h1> 12 13 <p id="description"></p> 14 <div id="console"></div> 13 <h1 id="heading3"><a href="#">Small heading</a> <a href="#">Small heading</a></h1> 14 </div> 15 15 16 16 <script> 17 if (window.accessibilityController) { 18 let output = "This tests that the click points for headings should use the only child's clickpoint instead of taking the mid point (which may be on nothing).\n"; 17 19 18 description("This tests that the click points for headings should use the only child's clickpoint instead of taking the mid point (which may be on nothing)."); 20 var heading1 = accessibilityController.accessibleElementById("heading1"); 21 // Verify that the click point is the same as the child. 22 output += expect("heading1.clickPointX", "heading1.childAtIndex(0).clickPointX"); 23 output += expect("heading1.clickPointY", "heading1.childAtIndex(0).clickPointY"); 19 24 20 if (window.accessibilityController) { 25 var heading2 = accessibilityController.accessibleElementById("heading2"); 26 output += expect("heading2.clickPointX", "heading2.childAtIndex(0).clickPointX"); 27 output += expect("heading2.clickPointY", "heading2.childAtIndex(0).clickPointY"); 21 28 22 document.getElementById("heading1").focus(); 23 var heading1 = accessibilityController.focusedElement; 29 var heading3 = accessibilityController.accessibleElementById("heading3"); 30 // If there is more than one child, the click point should be the middle again, which means X point will be different. 31 output += expect("heading3.clickPointX == heading3.childAtIndex(0).clickPointX", "false"); 24 32 25 // Verify that the click point is the same as the child. 26 shouldBe("heading1.clickPointX", "heading1.childAtIndex(0).clickPointX"); 27 shouldBe("heading1.clickPointY", "heading1.childAtIndex(0).clickPointY"); 28 29 document.getElementById("heading2").focus(); 30 var heading2 = accessibilityController.focusedElement; 31 32 shouldBe("heading2.clickPointX", "heading2.childAtIndex(0).clickPointX"); 33 shouldBe("heading2.clickPointY", "heading2.childAtIndex(0).clickPointY"); 34 35 document.getElementById("heading3").focus(); 36 var heading3 = accessibilityController.focusedElement; 37 38 // If there is more than one child, the click point should be the middle again, which means X point will be different. 39 shouldBeFalse("heading3.clickPointX == heading3.childAtIndex(0).clickPointX"); 40 33 debug(output); 34 document.getElementById("content").style.visibility = "hidden"; 41 35 } 42 43 36 </script> 44 45 <script src="../../resources/js-test-post.js"></script>46 37 </body> 47 38 </html> -
trunk/LayoutTests/platform/glib/accessibility/aria-expanded-supported-roles-expected.txt
r283078 r293291 1 1 Verify which roles support aria-expanded. 2 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".4 5 6 2 AXRole: AXEmbedded is expanded 7 3 AXRole: AXButton is expanded … … 18 14 AXRole: AXToggleButton is expanded 19 15 AXRole: AXTab is expanded 16 20 17 PASS successfullyParsed is true 21 18 -
trunk/LayoutTests/platform/mac/accessibility/aria-expanded-supported-roles-expected.txt
r283078 r293291 1 1 Verify which roles support aria-expanded. 2 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".4 5 6 2 AXRole: AXGroup is expanded 7 3 AXRole: AXButton is expanded … … 18 14 AXRole: AXCheckBox is expanded 19 15 AXRole: AXRadioButton is expanded 16 20 17 PASS successfullyParsed is true 21 18 -
trunk/Source/WebCore/ChangeLog
r293290 r293291 1 2022-04-23 Andres Gonzalez <andresg_22@apple.com> 2 3 AX ITM: Table row objects should return a non-null unignored parent even when a table object is not found in its ancestry. 4 https://bugs.webkit.org/show_bug.cgi?id=239606 5 <rdar://problem/92094205> 6 7 Reviewed by Chris Fleizach. 8 9 Test: accessibility/aria-expanded-supported-roles.html. 10 In addition, fixed test accessibility/mac/heading-clickpoint.html. 11 12 AccessibilityARIAGridRow::parentObjectUnignored was returning nullptr 13 if there was no table ancestor. This caused problems in isolated tree 14 mode where only the root object should have a null parent. With this 15 patch this method will return the table ancestor if one exists, its 16 parent in the AX tree otherwise. 17 Changed all classes in the AXObject hierarchy to return an AXObject for 18 the parentObjectUnignored method instead of an AXCoreObject. 19 20 * accessibility/AXObjectCache.cpp: 21 (WebCore::AXObjectCache::focusedObjectForPage): 22 Removed unnecessary downcast. 23 * accessibility/AccessibilityARIAGridRow.cpp: 24 (WebCore::AccessibilityARIAGridRow::parentObjectUnignored const): 25 (WebCore::AccessibilityARIAGridRow::parentTable const): 26 Rewrote this method using Accessibility::findAncestor. 27 * accessibility/AccessibilityObject.cpp: 28 (WebCore::AccessibilityObject::parentObjectUnignored const): 29 * accessibility/AccessibilityObject.h: 30 * accessibility/AccessibilityRenderObject.cpp: 31 (WebCore::AccessibilityRenderObject::parentObjectUnignored const): 32 * accessibility/AccessibilityRenderObject.h: 33 * accessibility/AccessibilityTableCell.cpp: 34 (WebCore::AccessibilityTableCell::parentObjectUnignored const): 35 * accessibility/AccessibilityTableCell.h: 36 1 37 2022-04-23 Devin Rousso <drousso@apple.com> 2 38 -
trunk/Source/WebCore/accessibility/AXObjectCache.cpp
r293186 r293291 439 439 // the HTML element, for example, is focusable but has an AX object that is ignored 440 440 if (focus->accessibilityIsIgnored()) 441 focus = downcast<AccessibilityObject>(focus->parentObjectUnignored());441 focus = focus->parentObjectUnignored(); 442 442 443 443 return focus; … … 1530 1530 // ATSPI doesn't expose text nodes, so we need the parent 1531 1531 // object which is the one implementing the text interface. 1532 auto* parent = object->parentObjectUnignored(); 1533 if (is<AccessibilityObject>(parent)) 1534 object = downcast<AccessibilityObject>(parent); 1532 object = object->parentObjectUnignored(); 1535 1533 #endif 1536 1534 } -
trunk/Source/WebCore/accessibility/AccessibilityARIAGridRow.cpp
r257589 r293291 114 114 return nullptr; 115 115 } 116 116 117 117 AccessibilityObject* AccessibilityARIAGridRow::parentObjectUnignored() const 118 118 { 119 return parentTable(); 119 if (auto* table = parentTable()) 120 return table; 121 return AccessibilityTableRow::parentObjectUnignored(); 120 122 } 121 123 122 124 AccessibilityTable* AccessibilityARIAGridRow::parentTable() const 123 125 { 124 126 // The parent table might not be the direct ancestor of the row unfortunately. ARIA states that role="grid" should 125 127 // only have "row" elements, but if not, we still should handle it gracefully by finding the right table. 126 for (AccessibilityObject* parent = parentObject(); parent; parent = parent->parentObject()) {128 return downcast<AccessibilityTable>(Accessibility::findAncestor<AccessibilityObject>(*this, false, [this] (const auto& ancestor) { 127 129 // The parent table for an ARIA grid row should be an ARIA table. 128 130 // Unless the row is a native tr element. 129 if (is<AccessibilityTable>(*parent)) { 130 AccessibilityTable& tableParent = downcast<AccessibilityTable>(*parent); 131 if (tableParent.isExposable() && (tableParent.isAriaTable() || node()->hasTagName(HTMLNames::trTag))) 132 return &tableParent; 131 if (is<AccessibilityTable>(ancestor)) { 132 auto& ancestorTable = downcast<AccessibilityTable>(ancestor); 133 return ancestorTable.isExposable() && (ancestorTable.isAriaTable() || node()->hasTagName(HTMLNames::trTag)); 133 134 } 134 } 135 136 return nullptr;135 136 return false; 137 })); 137 138 } 138 139 -
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
r292963 r293291 442 442 } 443 443 444 A XCoreObject* AccessibilityObject::parentObjectUnignored() const444 AccessibilityObject* AccessibilityObject::parentObjectUnignored() const 445 445 { 446 446 return Accessibility::findAncestor<AccessibilityObject>(*this, false, [] (const AccessibilityObject& object) { -
trunk/Source/WebCore/accessibility/AccessibilityObject.h
r292774 r293291 371 371 AccessibilityObject* parentObject() const override { return nullptr; } 372 372 AccessibilityObject* displayContentsParent() const; 373 A XCoreObject* parentObjectUnignored() const override;373 AccessibilityObject* parentObjectUnignored() const override; 374 374 AccessibilityObject* parentObjectIfExists() const override { return nullptr; } 375 375 static AccessibilityObject* firstAccessibleObjectFromNode(const Node*); -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r293212 r293291 536 536 } 537 537 538 A XCoreObject* AccessibilityRenderObject::parentObjectUnignored() const538 AccessibilityObject* AccessibilityRenderObject::parentObjectUnignored() const 539 539 { 540 540 #if USE(ATSPI) -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h
r293006 r293291 90 90 AccessibilityObject* parentObject() const override; 91 91 AccessibilityObject* parentObjectIfExists() const override; 92 A XCoreObject* parentObjectUnignored() const override;92 AccessibilityObject* parentObjectUnignored() const override; 93 93 AccessibilityObject* observableObject() const override; 94 94 void linkedUIElements(AccessibilityChildrenVector&) const override; -
trunk/Source/WebCore/accessibility/AccessibilityTableCell.cpp
r291863 r293291 305 305 } 306 306 307 A XCoreObject* AccessibilityTableCell::parentObjectUnignored() const307 AccessibilityObject* AccessibilityTableCell::parentObjectUnignored() const 308 308 { 309 309 if (auto ownerParent = ariaOwnedByParent()) -
trunk/Source/WebCore/accessibility/AccessibilityTableCell.h
r273715 r293291 66 66 virtual AccessibilityTable* parentTable() const; 67 67 AccessibilityRole determineAccessibilityRole() final; 68 A XCoreObject* parentObjectUnignored() const override;68 AccessibilityObject* parentObjectUnignored() const override; 69 69 70 70 int m_rowIndex;
Note:
See TracChangeset
for help on using the changeset viewer.