-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AX: AXPropertyName::{ColumnIndexRange, RowIndexRange} properties are …
…never updated https://bugs.webkit.org/show_bug.cgi?id=270496 rdar://problem/124046227 Reviewed by Chris Fleizach. This can cause ATs to miss table content if they use the rowIndexRange and columnIndexRange APIs as inputs to the cellForColumnAndRow API. Fix this by posting a notification when table cells modify their row / column index. This patch also adds a new postNotification overload to avoid unnecessary null-checking and verbosity of passing a hardcoded `nullptr Document*` argument to postNotification(AccessibilityObject*, Document*, AXNotification, PostTarget = PostTarget::Element). Existing notifications AXColumnIndexChanged and AXRowIndexChanged are repurposed to report this dynamic change, and two new notifications (AXARIAColumnIndexChanged and AXARIARowIndexChanged) are added to support what the former two notifications used to do (as they were only fired when aria-colindex and aria-rowindex changed). * LayoutTests/accessibility/dynamic-aria-hidden-cell-expected.txt: Added. * LayoutTests/accessibility/dynamic-aria-hidden-cell.html: Added. * Source/WebCore/accessibility/AXLogger.cpp: (WebCore::operator<<): * Source/WebCore/accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::valueChanged): (WebCore::AXObjectCache::columnIndexChanged): (WebCore::AXObjectCache::rowIndexChanged): (WebCore::AXObjectCache::postNotification): (WebCore::AXObjectCache::onTextSecurityChanged): (WebCore::AXObjectCache::onTitleChange): (WebCore::AXObjectCache::onValidityChange): (WebCore::AXObjectCache::handleRoleChanged): Take a reference rather than a pointer as all callsites have access to a reference. (WebCore::AXObjectCache::handleAttributeChange): (WebCore::AXObjectCache::updateIsolatedTree): (WebCore::AXObjectCache::selectedTextRangeTimerFired): (WebCore::AXObjectCache::onWidgetVisibilityChanged): * Source/WebCore/accessibility/AXObjectCache.h: * Source/WebCore/accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::updateRole): * Source/WebCore/accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation): * Source/WebCore/accessibility/AccessibilityTable.cpp: (WebCore::AccessibilityTable::recomputeIsExposable): (WebCore::AccessibilityTable::columnCount): * Source/WebCore/accessibility/AccessibilityTableCell.cpp: (WebCore::AccessibilityTableCell::setRowIndex): (WebCore::AccessibilityTableCell::setColumnIndex): * Source/WebCore/accessibility/AccessibilityTableCell.h: (WebCore::AccessibilityTableCell::setRowIndex): Deleted. (WebCore::AccessibilityTableCell::setColumnIndex): Deleted. Canonical link: https://commits.webkit.org/275710@main
- Loading branch information
Showing
10 changed files
with
198 additions
and
24 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
LayoutTests/accessibility/dynamic-aria-hidden-cell-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
This test ensures we report the right information for tables with presentational cells. | ||
|
||
PASS: table.rowCount === 2 | ||
PASS: table.columnCount === 2 | ||
PASS: accessibilityController.accessibleElementById('th0-1').rowIndexRange() === '{0, 1}' | ||
PASS: accessibilityController.accessibleElementById('th0-1').columnIndexRange() === '{0, 1}' | ||
PASS: accessibilityController.accessibleElementById('th0-2').rowIndexRange() === '{0, 1}' | ||
PASS: accessibilityController.accessibleElementById('th0-2').columnIndexRange() === '{1, 1}' | ||
PASS: accessibilityController.accessibleElementById('td1-1').rowIndexRange() === '{1, 1}' | ||
PASS: accessibilityController.accessibleElementById('td1-1').columnIndexRange() === '{0, 1}' | ||
PASS: accessibilityController.accessibleElementById('td1-2').rowIndexRange() === '{1, 1}' | ||
PASS: accessibilityController.accessibleElementById('td1-2').columnIndexRange() === '{1, 1}' | ||
PASS: table.columnCount === 3 | ||
PASS: accessibilityController.accessibleElementById('th0-0-hidden').rowIndexRange() === '{0, 1}' | ||
PASS: accessibilityController.accessibleElementById('th0-0-hidden').columnIndexRange() === '{0, 1}' | ||
PASS: accessibilityController.accessibleElementById('th0-1').rowIndexRange() === '{0, 1}' | ||
PASS: accessibilityController.accessibleElementById('th0-1').columnIndexRange() === '{1, 1}' | ||
PASS: accessibilityController.accessibleElementById('td1-0-hidden').rowIndexRange() === '{1, 1}' | ||
PASS: accessibilityController.accessibleElementById('td1-0-hidden').columnIndexRange() === '{0, 1}' | ||
PASS: accessibilityController.accessibleElementById('td1-1').rowIndexRange() === '{1, 1}' | ||
PASS: accessibilityController.accessibleElementById('td1-1').columnIndexRange() === '{1, 1}' | ||
PASS: accessibilityController.accessibleElementById('td1-2').rowIndexRange() === '{1, 1}' | ||
PASS: accessibilityController.accessibleElementById('td1-2').columnIndexRange() === '{2, 1}' | ||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
Header one Header two Header three | ||
A B C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../resources/accessibility-helper.js"></script> | ||
<script src="../resources/js-test.js"></script> | ||
</head> | ||
<body> | ||
|
||
<table id="table" tabindex="0"> | ||
<thead id="thead"> | ||
<tr id="tr0"> | ||
<th id="th0-0-hidden" aria-hidden="true">Header one</th> | ||
<th id="th0-1" tabindex="0" aria-colindex="1"><strong>Header two</strong></th> | ||
<th id="th0-2" tabindex="0" aria-colindex="2"><strong>Header three</strong></th> | ||
</tr> | ||
</thead> | ||
<tbody id="tbody"> | ||
<tr id="tr1"> | ||
<td id="td1-0-hidden" aria-hidden="true">A</td> | ||
<td id="td1-1" tabindex="0" aria-colindex="1">B</td> | ||
<td id="td1-2" tabindex="0" aria-colindex="2">C</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<script> | ||
var output = "This test ensures we report the right information for tables with presentational cells.\n\n"; | ||
|
||
if (window.accessibilityController) { | ||
window.jsTestIsAsync = true; | ||
|
||
var table = accessibilityController.accessibleElementById("table"); | ||
output += expect("table.rowCount", "2"); | ||
output += expect("table.columnCount", "2"); | ||
|
||
output += expect("accessibilityController.accessibleElementById('th0-1').rowIndexRange()", "'{0, 1}'"); | ||
output += expect("accessibilityController.accessibleElementById('th0-1').columnIndexRange()", "'{0, 1}'"); | ||
|
||
output += expect("accessibilityController.accessibleElementById('th0-2').rowIndexRange()", "'{0, 1}'"); | ||
output += expect("accessibilityController.accessibleElementById('th0-2').columnIndexRange()", "'{1, 1}'"); | ||
|
||
output += expect("accessibilityController.accessibleElementById('td1-1').rowIndexRange()", "'{1, 1}'"); | ||
output += expect("accessibilityController.accessibleElementById('td1-1').columnIndexRange()", "'{0, 1}'"); | ||
|
||
output += expect("accessibilityController.accessibleElementById('td1-2').rowIndexRange()", "'{1, 1}'"); | ||
output += expect("accessibilityController.accessibleElementById('td1-2').columnIndexRange()", "'{1, 1}'"); | ||
|
||
document.getElementById("th0-0-hidden").removeAttribute("aria-hidden"); | ||
document.getElementById("td1-0-hidden").removeAttribute("aria-hidden"); | ||
setTimeout(async function() { | ||
output += await expectAsync("table.columnCount", "3"); | ||
|
||
output += await expectAsync("accessibilityController.accessibleElementById('th0-0-hidden').rowIndexRange()", "'{0, 1}'"); | ||
output += await expectAsync("accessibilityController.accessibleElementById('th0-0-hidden').columnIndexRange()", "'{0, 1}'"); | ||
|
||
output += await expectAsync("accessibilityController.accessibleElementById('th0-1').rowIndexRange()", "'{0, 1}'"); | ||
output += await expectAsync("accessibilityController.accessibleElementById('th0-1').columnIndexRange()", "'{1, 1}'"); | ||
|
||
output += await expectAsync("accessibilityController.accessibleElementById('td1-0-hidden').rowIndexRange()", "'{1, 1}'"); | ||
output += await expectAsync("accessibilityController.accessibleElementById('td1-0-hidden').columnIndexRange()", "'{0, 1}'"); | ||
|
||
output += expect("accessibilityController.accessibleElementById('td1-1').rowIndexRange()", "'{1, 1}'"); | ||
output += expect("accessibilityController.accessibleElementById('td1-1').columnIndexRange()", "'{1, 1}'"); | ||
|
||
output += expect("accessibilityController.accessibleElementById('td1-2').rowIndexRange()", "'{1, 1}'"); | ||
output += expect("accessibilityController.accessibleElementById('td1-2').columnIndexRange()", "'{2, 1}'"); | ||
|
||
debug(output); | ||
finishJSTest(); | ||
}, 0); | ||
} | ||
</script> | ||
</body> | ||
</html> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters