Index: Source/modules/accessibility/AXNodeObject.cpp |
diff --git a/Source/modules/accessibility/AXNodeObject.cpp b/Source/modules/accessibility/AXNodeObject.cpp |
index d0b033a36e26e356bb0b60c266aab2918a3498f5..bd262bfd24e02e428502035830bb3a1a5633e826 100644 |
--- a/Source/modules/accessibility/AXNodeObject.cpp |
+++ b/Source/modules/accessibility/AXNodeObject.cpp |
@@ -261,9 +261,17 @@ const AXObject* AXNodeObject::inheritsPresentationalRoleFrom() const |
HTMLElement* element = nullptr; |
if (node() && node()->isHTMLElement()) |
element = toHTMLElement(node()); |
- if (!parent->hasInheritedPresentationalRole() |
- && !isPresentationalInTable(parent, element)) |
- return 0; |
+ if (!parent->hasInheritedPresentationalRole()) { |
+ if (!layoutObject() || !layoutObject()->isBoxModelObject()) |
+ return 0; |
+ |
+ LayoutBoxModelObject* cssBox = toLayoutBoxModelObject(layoutObject()); |
+ if (!cssBox->isTableCell() && !cssBox->isTableRow()) |
+ return 0; |
+ |
+ if (!isPresentationalInTable(parent, element)) |
+ return 0; |
+ } |
// ARIA spec says that when a parent object is presentational and this object |
// is a required owned element of that parent, then this object is also presentational. |
if (isRequiredOwnedElement(parent, roleValue(), element)) |