Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(792)

Unified Diff: content/browser/accessibility/browser_accessibility_android.cc

Issue 2120523002: The children of non-editable combo boxes, search boxes and text fields should not be hidden (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Windows browser test. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 dd96eaa9bd0392460c324ef1eb6411f895ce537b..dbbca9fd50a77ab60533c154c89db61cba0d42f8 100644
--- a/content/browser/accessibility/browser_accessibility_android.cc
+++ b/content/browser/accessibility/browser_accessibility_android.cc
@@ -125,7 +125,7 @@ bool BrowserAccessibilityAndroid::PlatformIsLeaf() const {
return true;
// Nodes with only static text as children can drop their children.
- if (HasOnlyStaticTextChildren())
+ if (HasOnlyTextChildren())
return true;
}
@@ -359,7 +359,7 @@ base::string16 BrowserAccessibilityAndroid::GetText() const {
GetIntAttribute(ui::AX_ATTR_NAME_FROM) == ui::AX_NAME_FROM_CONTENTS) {
// This is an approximation of "PlatformChildCount() > 0" because we can't
// call PlatformChildCount from here.
- if (InternalChildCount() > 0 && !HasOnlyStaticTextChildren())
+ if (InternalChildCount() > 0 && !HasOnlyTextChildren())
return base::string16();
}
@@ -406,9 +406,8 @@ base::string16 BrowserAccessibilityAndroid::GetText() const {
// This is called from PlatformIsLeaf, so don't call PlatformChildCount
// from within this!
- if (text.empty() &&
- (HasOnlyStaticTextChildren() ||
- (IsFocusable() && HasOnlyTextAndImageChildren()))) {
+ if (text.empty() && (HasOnlyTextChildren() ||
+ (IsFocusable() && HasOnlyTextAndImageChildren()))) {
for (uint32_t i = 0; i < InternalChildCount(); i++) {
BrowserAccessibility* child = InternalGetChild(i);
text += static_cast<BrowserAccessibilityAndroid*>(child)->GetText();
@@ -1336,12 +1335,12 @@ bool BrowserAccessibilityAndroid::HasFocusableChild() const {
return false;
}
-bool BrowserAccessibilityAndroid::HasOnlyStaticTextChildren() const {
+bool BrowserAccessibilityAndroid::HasOnlyTextChildren() const {
// This is called from PlatformIsLeaf, so don't call PlatformChildCount
// from within this!
for (uint32_t i = 0; i < InternalChildCount(); i++) {
BrowserAccessibility* child = InternalGetChild(i);
- if (child->GetRole() != ui::AX_ROLE_STATIC_TEXT)
+ if (!child->IsTextOnlyObject())
return false;
}
return true;

Powered by Google App Engine
This is Rietveld 408576698