Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Infinite recursion caused by call to accessibilityIsIgnored in the mi…
…dst of AccessibilityObject::ignoredFromModalPresence https://bugs.webkit.org/show_bug.cgi?id=240365 Reviewed by Chris Fleizach. Source/WebCore: We can get infinite recursion when accessibilityIsIgnored is called as part of computing AccessibilityObject::ignoredFromModalPresence. One example of such a cycle: AXObjectCache::currentModalNode() -> AccessibilityRenderObject::computeAccessibilityIsIgnored() -> AccessibilityRenderObject::parentObjectUnignored() -> AccessibilityObject::accessibilityIsIgnored() -> AccessibilityObject::ignoredFromModalPresence() -> AXObjectCache::currentModalNode() -> ...repeat... This patch fixes this by tracking when we start computing the current modal node in the AXObjectCache. Then, in AccessibilityObject::accessibilityIsIgnored(), we don't call AccessibilityObject::ignoredFromModalPresence() if this new state is true, since in this context we only need to know if the object is inherently ignored (i.e. ignored disregarding modal presence). Test: accessibility/aria-modal-with-text-crash.html * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::currentModalNode): * accessibility/AXObjectCache.h: Add m_isRetrievingCurrentModalNode. (WebCore::AXObjectCache::isRetrievingCurrentModalNode): Added. * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::accessibilityIsIgnored const): Don't call ignoredFromModalPresence if we're in the midst of computing the current modal. LayoutTests: * accessibility/aria-modal-with-text-crash-expected.txt: Added. * accessibility/aria-modal-with-text-crash.html: Added. * platform/glib/TestExpectations: Skip new test. * platform/ios/TestExpectations: Enable new test. * platform/win/TestExpectations: Skip new test. Canonical link: https://commits.webkit.org/250552@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
10 changed files
with
107 additions
and
2 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
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
@@ -0,0 +1,10 @@ | ||
This test ensures we don't crash when using search to traverse an aria-modal with text. | ||
|
||
|
||
AXRole: AXStaticText | ||
AXValue: Foo | ||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
Foo |
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
@@ -0,0 +1,37 @@ | ||
<!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 id="modal" role="dialog" aria-modal="true"> | ||
<span>Foo</span> | ||
</div> | ||
|
||
<script> | ||
var testOutput = "This test ensures we don't crash when using search to traverse an aria-modal with text.\n\n"; | ||
|
||
if (window.accessibilityController) { | ||
const modal = accessibilityController.accessibleElementById("modal"); | ||
let searchResult = null; | ||
while (true) { | ||
searchResult = modal.uiElementForSearchPredicate(searchResult, true, "AXAnyTypeSearchKey", "", false); | ||
if (!searchResult) | ||
break; | ||
const role = searchResult.role; | ||
testOutput += `\n${role}`; | ||
if (role.includes("StaticText")) { | ||
let textContent = accessibilityController.platformName === "ios" ? searchResult.description : searchResult.stringValue; | ||
testOutput += `\n${textContent}`; | ||
} | ||
testOutput += "\n"; | ||
} | ||
debug(testOutput); | ||
} | ||
</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