Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r176254 - AX: [ATK] Crash getting the orientation of a MenuList…
…Option after the MenuList was removed from the document https://bugs.webkit.org/show_bug.cgi?id=138727 Reviewed by Chris Fleizach. Source/WebCore: AccessibilityMenuListOption::elementRect() returns the value of the grandparent MenuList, asserting that the grandparent exists with that role. But it is possible to have an existing MenuListOption and remove the element which had been backing that MenuList from the document. Adding null checks prior to the assertions prevents our crashing if the parent or grandparent was removed. Test: platform/gtk/accessibility/combobox-descendants-orientation-crash.html * accessibility/AccessibilityMenuListOption.cpp: (WebCore::AccessibilityMenuListOption::elementRect): LayoutTests: * platform/gtk/accessibility/combobox-descendants-orientation-crash-expected.txt: Added. * platform/gtk/accessibility/combobox-descendants-orientation-crash.html: Added. Canonical link: https://commits.webkit.org/154760.218@webkitgtk/2.6 git-svn-id: https://svn.webkit.org/repository/webkit/releases/WebKitGTK/webkit-2.6@176389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
7e395f0
commit b563974
Showing
5 changed files
with
89 additions
and
0 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
18 changes: 18 additions & 0 deletions
18
LayoutTests/platform/gtk/accessibility/combobox-descendants-orientation-crash-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,18 @@ | ||
This verifies that getting the orientation of combobox descendants won't crash if the combobox is removed from the document. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
AXRole: AXComboBox has orientation: AXOrientation: AXHorizontalOrientation | ||
|
||
Before combobox removal | ||
AXRole: AXMenu has orientation: AXOrientation: AXHorizontalOrientation | ||
AXRole: AXMenuItem has orientation: AXOrientation: AXHorizontalOrientation | ||
|
||
After combobox removal | ||
AXRole: AXInvalid has orientation: AXOrientation: AXHorizontalOrientation | ||
AXRole: AXInvalid has orientation: AXOrientation: AXHorizontalOrientation | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
38 changes: 38 additions & 0 deletions
38
LayoutTests/platform/gtk/accessibility/combobox-descendants-orientation-crash.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../../../resources/js-test-pre.js"></script> | ||
</head> | ||
<body> | ||
<select id="combobox"> | ||
<option value="foo">foo</option> | ||
<option value="bar">bar</option> | ||
</select> | ||
<p id="description"></p> | ||
<div id="console"></div> | ||
<script> | ||
description("This verifies that getting the orientation of combobox descendants won't crash if the combobox is removed from the document."); | ||
|
||
if (window.testRunner && window.accessibilityController) { | ||
var combobox = document.getElementById("combobox"); | ||
combobox.focus(); | ||
|
||
var axCombobox = accessibilityController.focusedElement; | ||
var axMenu = axCombobox.childAtIndex(0); | ||
var axMenuItem = axMenu.childAtIndex(0); | ||
|
||
debug(axCombobox.role + " has orientation: " + axCombobox.orientation); | ||
|
||
debug("\nBefore combobox removal"); | ||
debug(axMenu.role + " has orientation: " + axMenu.orientation); | ||
debug(axMenuItem.role + " has orientation: " + axMenuItem.orientation); | ||
|
||
document.body.removeChild(combobox); | ||
debug("\nAfter combobox removal"); | ||
debug(axMenu.role + " has orientation: " + axMenu.orientation); | ||
debug(axMenuItem.role + " has orientation: " + axMenuItem.orientation); | ||
} | ||
</script> | ||
<script src="../../../resources/js-test-post.js"></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