Index: Source/modules/accessibility/AXRenderObject.cpp |
diff --git a/Source/modules/accessibility/AXRenderObject.cpp b/Source/modules/accessibility/AXRenderObject.cpp |
index f262d7b35daa23ee55f6fa83987a6fff6de7a295..09f7a7d1be9d3c9cbbfbef2dfe6ac0da33ed524c 100644 |
--- a/Source/modules/accessibility/AXRenderObject.cpp |
+++ b/Source/modules/accessibility/AXRenderObject.cpp |
@@ -253,6 +253,17 @@ ScrollableArea* AXRenderObject::getScrollableAreaIfScrollable() const |
return box->scrollableArea(); |
} |
+static bool isImageOrAltText(RenderBoxModelObject* box, Node* node) |
+{ |
+ if (box && box->isImage()) |
+ return true; |
+ if (isHTMLImageElement(node)) |
+ return true; |
+ if (isHTMLInputElement(node) && toHTMLInputElement(node)->hasFallbackContent()) |
+ return true; |
+ return false; |
+} |
+ |
AccessibilityRole AXRenderObject::determineAccessibilityRole() |
{ |
if (!m_renderer) |
@@ -268,7 +279,7 @@ AccessibilityRole AXRenderObject::determineAccessibilityRole() |
RenderBoxModelObject* cssBox = renderBoxModelObject(); |
if (node && node->isLink()) { |
- if (cssBox && cssBox->isImage()) |
+ if (isImageOrAltText(cssBox, node)) |
return ImageMapRole; |
return LinkRole; |
} |
@@ -289,7 +300,7 @@ AccessibilityRole AXRenderObject::determineAccessibilityRole() |
return LegendRole; |
if (m_renderer->isText()) |
return StaticTextRole; |
- if (cssBox && cssBox->isImage()) { |
+ if (isImageOrAltText(cssBox, node)) { |
if (isHTMLInputElement(node)) |
return ariaHasPopup() ? PopUpButtonRole : ButtonRole; |
if (isSVGImage()) |
@@ -776,7 +787,7 @@ bool AXRenderObject::computeAccessibilityIsIgnored() const |
return true; |
} |
- if (isNativeImage() && m_renderer->isImage()) { |
+ if (isNativeImage() && isImageOrAltText(toRenderBoxModelObject(m_renderer), node)) { |
// check for one-dimensional image |
RenderImage* image = toRenderImage(m_renderer); |
if (image->height() <= 1 || image->width() <= 1) |