-
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: Missing nullptr check for parentObjectUnignored in AccessibilityO…
…bject::isSelected() https://bugs.webkit.org/show_bug.cgi?id=268509 rdar://121945437 Reviewed by Chris Fleizach and Andres Gonzalez. parentObjectUnignored() can return nullptr, we need to check it before deferencing to avoid a crash. * LayoutTests/accessibility-isolated-tree/TestExpectations: Skip new test, as it exposes a bug that affects ITM. * LayoutTests/accessibility/menuitem-is-selected-crash-expected.txt: Added. * LayoutTests/accessibility/menuitem-is-selected-crash.html: Added. * LayoutTests/platform/glib/TestExpectations: Skip new test. * Source/WebCore/accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::computeAccessibilityIsIgnored const): * Source/WebCore/accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isSelected const): * Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::processQueuedNodeUpdates): Drive-by fix to remove unnecessary HashMap::contains check, HashMap::ensure inherently does this so the contains check was wasted work. Canonical link: https://commits.webkit.org/273971@main
- Loading branch information
Showing
8 changed files
with
60 additions
and
7 deletions.
There are no files selected for viewing
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
14 changes: 14 additions & 0 deletions
14
LayoutTests/accessibility/menuitem-is-selected-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,14 @@ | ||
This test ensures that calling isSelected on a menuitem within an unrendered container doesn't cause a crash. | ||
|
||
|
||
{AXRole: AXWebArea} | ||
|
||
{AXRole: AXGroup} | ||
|
||
{#group AXRole: AXGroup} | ||
PASS: accessibilityController.accessibleElementById('group').ariaLabelledByElementAtIndex(0).isSelected === false | ||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
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 @@ | ||
<!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> | ||
|
||
<div role="application"> | ||
<ul role="menu" style="display:none"> | ||
<li style="list-style: none" tabindex="-2" aria-posinset="1" aria-setsize="2" role="menuitem" id="menu-item-one">Menuitem one</li> | ||
<li style="list-style: none" tabindex="-2" aria-posinset="2" aria-setsize="2" role="menuitem">Menuitem two</li> | ||
</ul> | ||
<div role="group" id="group" aria-labelledby="menu-item-one"></div> | ||
</div> | ||
|
||
<script> | ||
var output = "This test ensures that calling isSelected on a menuitem within an unrendered container doesn't cause a crash.\n\n"; | ||
|
||
if (window.accessibilityController) { | ||
output += dumpAXSearchTraversal(accessibilityController.rootElement, { excludeRoles: "scrollbar" }); | ||
// Accessing isSelected() should not cause a crash. | ||
output += expect("accessibilityController.accessibleElementById('group').ariaLabelledByElementAtIndex(0).isSelected", "false"); | ||
debug(output); | ||
} | ||
</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