Index: Source/core/accessibility/AXRenderObject.cpp |
diff --git a/Source/core/accessibility/AXRenderObject.cpp b/Source/core/accessibility/AXRenderObject.cpp |
index 1f88247c3da8f881ef2a9dd149fb8e29bd4fd832..7ebc8c92d5a745f3bb463ff1ba0dddefff1db25e 100644 |
--- a/Source/core/accessibility/AXRenderObject.cpp |
+++ b/Source/core/accessibility/AXRenderObject.cpp |
@@ -314,12 +314,12 @@ AccessibilityRole AXRenderObject::determineAccessibilityRole() |
HTMLInputElement& input = toHTMLInputElement(*node); |
const AtomicString& type = input.type(); |
if (type == InputTypeNames::button) { |
- if (node->parentElement() && isHTMLMenuElement(node->parentElement())) |
+ if ((node->parentNode() && isHTMLMenuElement(node->parentNode())) || (parentObject() && parentObject()->roleValue() == MenuRole)) |
return MenuItemRole; |
return buttonRoleType(); |
} |
if (type == InputTypeNames::checkbox) { |
- if (node->parentElement() && isHTMLMenuElement(node->parentElement())) |
+ if ((node->parentNode() && isHTMLMenuElement(node->parentNode())) || (parentObject() && parentObject()->roleValue() == MenuRole)) |
return CheckBoxMenuItemRole; |
return CheckBoxRole; |
} |