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

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

Issue 304293006: Revert of Properly prioritize the sources of an accessible name on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | content/test/data/accessibility/button-name-calc-expected-android.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8a8514a0d80a84db258d2a05348513a1e9ac59fc..cec0a664cdab41d4359171680289c0390aaeb6fe 100644
--- a/content/browser/accessibility/browser_accessibility_android.cc
+++ b/content/browser/accessibility/browser_accessibility_android.cc
@@ -268,29 +268,12 @@
return base::string16();
}
- // See comment in browser_accessibility_win.cc for details.
- // The difference here is that we can only expose one accessible
- // name on Android, not 2 or 3 like on Windows or Mac.
- //
- // The basic rule is: prefer description (aria-labelledby or aria-label),
- // then help (title), then name (inner text), then value (control value).
- // However, if title_elem_id is set, that means there's a label element
- // supplying the name and then name takes precedence over help.
- // TODO(dmazzoni): clean this up by providing more granular labels in
- // Blink, making the platform-specific mapping to accessible text simpler.
base::string16 description = GetString16Attribute(ui::AX_ATTR_DESCRIPTION);
- base::string16 help = GetString16Attribute(ui::AX_ATTR_HELP);
- int title_elem_id = GetIntAttribute(
- ui::AX_ATTR_TITLE_UI_ELEMENT);
base::string16 text;
- if (!description.empty())
+ if (!name().empty())
+ text = base::UTF8ToUTF16(name());
+ else if (!description.empty())
text = description;
- else if (title_elem_id && !name().empty())
- text = base::UTF8ToUTF16(name());
- else if (!help.empty())
- text = help;
- else if (!name().empty())
- text = base::UTF8ToUTF16(name());
else if (!value().empty())
text = base::UTF8ToUTF16(value());
« no previous file with comments | « no previous file | content/test/data/accessibility/button-name-calc-expected-android.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698