| Index: content/browser/accessibility/browser_accessibility_android.cc
|
| diff --git a/content/browser/accessibility/browser_accessibility_android.cc b/content/browser/accessibility/browser_accessibility_android.cc
|
| index 61ecb22bf6cc0bbd9128c9b55672473a7912e133..caea3beab892e101df3d221e8a682f66c6652e58 100644
|
| --- a/content/browser/accessibility/browser_accessibility_android.cc
|
| +++ b/content/browser/accessibility/browser_accessibility_android.cc
|
| @@ -327,14 +327,16 @@ base::string16 BrowserAccessibilityAndroid::GetText() const {
|
|
|
| // This is called from PlatformIsLeaf, so don't call PlatformChildCount
|
| // from within this!
|
| - if (text.empty() && HasOnlyStaticTextChildren()) {
|
| + if (text.empty() &&
|
| + (HasOnlyStaticTextChildren() ||
|
| + (IsFocusable() && HasOnlyTextAndImageChildren()))) {
|
| for (uint32 i = 0; i < InternalChildCount(); i++) {
|
| BrowserAccessibility* child = InternalGetChild(i);
|
| text += static_cast<BrowserAccessibilityAndroid*>(child)->GetText();
|
| }
|
| }
|
|
|
| - if (text.empty() && IsLink()) {
|
| + if (text.empty() && (IsLink() || GetRole() == ui::AX_ROLE_IMAGE)) {
|
| base::string16 url = GetString16Attribute(ui::AX_ATTR_URL);
|
| // Given a url like http://foo.com/bar/baz.png, just return the
|
| // base name, e.g., "baz".
|
| @@ -621,6 +623,19 @@ bool BrowserAccessibilityAndroid::HasOnlyStaticTextChildren() const {
|
| return true;
|
| }
|
|
|
| +bool BrowserAccessibilityAndroid::HasOnlyTextAndImageChildren() const {
|
| + // This is called from PlatformIsLeaf, so don't call PlatformChildCount
|
| + // from within this!
|
| + for (uint32 i = 0; i < InternalChildCount(); i++) {
|
| + BrowserAccessibility* child = InternalGetChild(i);
|
| + if (child->GetRole() != ui::AX_ROLE_STATIC_TEXT &&
|
| + child->GetRole() != ui::AX_ROLE_IMAGE) {
|
| + return false;
|
| + }
|
| + }
|
| + return true;
|
| +}
|
| +
|
| bool BrowserAccessibilityAndroid::IsIframe() const {
|
| base::string16 html_tag = GetString16Attribute(
|
| ui::AX_ATTR_HTML_TAG);
|
|
|