Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(831)

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp

Issue 1207613004: Fix leaking AXNodeObjects when sub document detaches (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
index 655ecc97c19445a27cece1fe2d03245fc8fe279a..51ed74d1fbab891b62a926659e3aeaeecdbb7c36 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
@@ -1226,7 +1226,7 @@ bool AXLayoutObject::ariaRoleHasPresentationalChildren() const
AXObject* AXLayoutObject::ancestorForWhichThisIsAPresentationalChild() const
{
// Walk the parent chain looking for a parent that has presentational children
- AXObject* parent = parentObject();
+ AXObject* parent = parentObjectIfExists();
while (parent) {
if (parent->ariaRoleHasPresentationalChildren())
break;
@@ -1564,6 +1564,7 @@ AXObject* AXLayoutObject::elementAccessibilityHitTest(const IntPoint& point) con
AXObject* AXLayoutObject::computeParent() const
{
+ ASSERT(!isDetached());
if (!m_layoutObject)
return 0;
@@ -1677,6 +1678,7 @@ AXObject* AXLayoutObject::nextSibling() const
void AXLayoutObject::addChildren()
{
+ ASSERT(!isDetached());
// If the need to add more children in addition to existing children arises,
// childrenChanged should have been called, leaving the object with no children.
ASSERT(!m_haveChildren);

Powered by Google App Engine
This is Rietveld 408576698