Index: Source/core/accessibility/AXNodeObject.cpp |
diff --git a/Source/core/accessibility/AXNodeObject.cpp b/Source/core/accessibility/AXNodeObject.cpp |
index 917f64a04c8d02f4d37d2d1937f2474c6f17f19c..3ff828f7b4515ae0a62ce1f3e52bd097e375ecbf 100644 |
--- a/Source/core/accessibility/AXNodeObject.cpp |
+++ b/Source/core/accessibility/AXNodeObject.cpp |
@@ -1181,6 +1181,16 @@ String AXNodeObject::textUnderElement() const |
return builder.toString(); |
} |
+AXObject* AXNodeObject::searchAXObjectFromChild(const HTMLQualifiedName& node) const |
dmazzoni
2014/11/12 06:03:03
The argument name should be tagName instead of nod
je_julie(Not used)
2014/11/12 13:07:04
You're right. I updated the parameter name.
|
+{ |
+ for (AXObject* child = firstChild(); child; child = child->nextSibling()) { |
+ Node* childNode = child->node(); |
+ if (childNode && childNode->hasTagName(node)) |
+ return child; |
+ } |
+ return 0; |
+} |
+ |
String AXNodeObject::accessibilityDescription() const |
{ |
// Static text should not have a description, it should only have a stringValue. |
@@ -1206,6 +1216,12 @@ String AXNodeObject::accessibilityDescription() const |
if (title().isEmpty()) |
return getAttribute(titleAttr); |
+ if (roleValue() == FigureRole) { |
+ AXObject* figcaption = searchAXObjectFromChild(figcaptionTag); |
+ if (figcaption) |
+ return figcaption->accessibilityDescription(); |
+ } |
+ |
return String(); |
} |
@@ -1251,6 +1267,11 @@ String AXNodeObject::title() const |
// SVGRoots should not use the text under itself as a title. That could include the text of objects like <text>. |
case SVGRootRole: |
return String(); |
+ case FigureRole: { |
+ AXObject* figcaption = searchAXObjectFromChild(figcaptionTag); |
+ if (figcaption) |
+ return figcaption->textUnderElement(); |
+ } |
default: |
break; |
} |