New issue
Advanced search Search tips

Issue 828167 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Apr 2018
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: ----



Sign in to add a comment

Chrome should map placeholder to hintText on Android O or higher

Project Member Reported by felipeal@google.com, Apr 2 2018

Issue description

We added a AccessibilityNodeInfo.setHintText() method on Android O (https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.html#setHintText(java.lang.CharSequence)), which should be filled with a TextView's hint, which in turn is defined (on View.java) as: "Sets the text to be displayed when the text of the TextView is empty, from a resource."

So, mapping that concept to Web, it would make sense to fill this field with the value of the "placeholder" tag, when present. For example, the Twitter login page (https://twitter.com/login?lang=en) defines:
 
<input
      type="text"
      class="text-input email-input js-signin-email"
      name="session[username_or_email]"
      autocomplete="username"
      placeholder="Phone, email, or username"
    />

<input type="password" class="text-input" name="session[password]" placeholder="Password" autocomplete="current-password">

Right now, Chrome is mapping placeholder tag to the AccessibilityNodeInfo.setText(), which affects Android Autofill on P: we're adding a compatibility mode that converts the AccessibilityNodeInfo into a ViewNode, but we sanitize the node's text property before sending it to the autofill service (A.K.A Password Manager), as it could contain PII.

(this is the same as b/77336622)


 

Comment 1 by felipeal@google.com, Apr 18 2018

Status: Verified (was: Unconfirmed)
Verified on latest canary (versionCode=339600852 versionName=67.0.3396.8), thanks for the quick fix!

Sign in to add a comment