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

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

Issue 665333004: Support the placeholder attribute on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/input-text-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 a0a5baf83e75fbb490479f76b263bb378e7062e7..61ecb22bf6cc0bbd9128c9b55672473a7912e133 100644
--- a/content/browser/accessibility/browser_accessibility_android.cc
+++ b/content/browser/accessibility/browser_accessibility_android.cc
@@ -307,6 +307,8 @@ base::string16 BrowserAccessibilityAndroid::GetText() const {
// 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);
+ base::string16 placeholder;
+ GetHtmlAttribute("placeholder", &placeholder);
int title_elem_id = GetIntAttribute(
ui::AX_ATTR_TITLE_UI_ELEMENT);
base::string16 text;
@@ -318,6 +320,8 @@ base::string16 BrowserAccessibilityAndroid::GetText() const {
text = help;
else if (!name().empty())
text = base::UTF8ToUTF16(name());
+ else if (GetRole() == ui::AX_ROLE_TEXT_FIELD && !placeholder.empty())
+ text = placeholder;
else if (!value().empty())
text = base::UTF8ToUTF16(value());
« no previous file with comments | « no previous file | content/test/data/accessibility/input-text-name-calc-expected-android.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698