Index: Source/modules/accessibility/AXObject.cpp |
diff --git a/Source/modules/accessibility/AXObject.cpp b/Source/modules/accessibility/AXObject.cpp |
index d451350c269b3c73125e32f061c7b31bacc2fce0..7264084d6244957d2b491cb92e1da4e7182f268f 100644 |
--- a/Source/modules/accessibility/AXObject.cpp |
+++ b/Source/modules/accessibility/AXObject.cpp |
@@ -431,9 +431,11 @@ bool AXObject::isDescendantOfBarrenParent() const |
bool AXObject::computeIsDescendantOfBarrenParent() const |
{ |
- for (AXObject* object = parentObject(); object; object = object->parentObject()) { |
- if (!object->canHaveChildren()) |
+ if (AXObject* parent = parentObject()) { |
+ if (!parent->canHaveChildren()) |
return true; |
+ |
+ return parent->isDescendantOfBarrenParent(); |
} |
return false; |