https://bugs.webkit.org/show_bug.cgi?id=144860
Reviewed by Mario Sanchez Prada.
Source/WebCore:
There were some unsafe pointer accesses in AccessibilityMenuList code that needed to be cleaned up.
Test: accessibility/menu-list-crash2.html
* accessibility/AccessibilityMenuList.cpp:
(WebCore::AccessibilityMenuList::addChildren):
LayoutTests:
* accessibility/menu-list-crash2-expected.txt: Added.
* accessibility/menu-list-crash2.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184097
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-05-11 Chris Fleizach <cfleizach@apple.com>
+
+ AX: Crash at WebCore::AccessibilityMenuList::addChildren()
+ https://bugs.webkit.org/show_bug.cgi?id=144860
+
+ Reviewed by Mario Sanchez Prada.
+
+ * accessibility/menu-list-crash2-expected.txt: Added.
+ * accessibility/menu-list-crash2.html: Added.
+
2015-05-11 Marcos ChavarrÃa Teijeiro <chavarria1991@gmail.com>
[GTK] Gardening 7th May.
--- /dev/null
+TEST
+TEST
+This tests that there's no crash if we hide menu list and then try to access accessibility information.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Role before removal: AXRole: AXPopUpButton
+Role after removal: AXRole:
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
--- /dev/null
+<html>
+<head>
+<script src="../resources/js-test-pre.js"></script>
+</head>
+<body>
+
+TEST
+<div id="content">
+
+<select id="menulist">
+ <option selected>One</option>
+ <option>Two</option>
+ <option>Three</option>
+</select>
+
+</div>
+TEST
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+function runTest() {
+ description("This tests that there's no crash if we hide menu list and then try to access accessibility information.");
+
+ if (window.accessibilityController) {
+ var menulist = document.getElementById("menulist");
+ menulist.focus();
+ menulist.selectedIndex = 1;
+
+ var accessibleMenulist = accessibilityController.focusedElement;
+ debug("Role before removal: " + accessibleMenulist.role);
+
+ menulist.style.display = "none";
+ gc();
+
+ // Don't crash!
+ debug("Role after removal: " + accessibleMenulist.role);
+ }
+}
+
+runTest();
+</script>
+
+</body>
+<script src="../resources/js-test-post.js"></script>
+</html>
+2015-05-11 Chris Fleizach <cfleizach@apple.com>
+
+ AX: Crash at WebCore::AccessibilityMenuList::addChildren()
+ https://bugs.webkit.org/show_bug.cgi?id=144860
+
+ Reviewed by Mario Sanchez Prada.
+
+ There were some unsafe pointer accesses in AccessibilityMenuList code that needed to be cleaned up.
+
+ Test: accessibility/menu-list-crash2.html
+
+ * accessibility/AccessibilityMenuList.cpp:
+ (WebCore::AccessibilityMenuList::addChildren):
+
2015-05-11 Przemyslaw Szymanski <p.szymanski3@samsung.com>
[WebGL] Unnecessary condition check in the while loop
void AccessibilityMenuList::addChildren()
{
- m_haveChildren = true;
-
- AXObjectCache* cache = m_renderer->document().axObjectCache();
-
+ if (!m_renderer)
+ return;
+
+ AXObjectCache* cache = axObjectCache();
+ if (!cache)
+ return;
+
AccessibilityObject* list = cache->getOrCreate(MenuListPopupRole);
if (!list)
return;
return;
}
+ m_haveChildren = true;
m_children.append(list);
list->addChildren();