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

Issue 2881723002: Fix TalkBack feedback for password fields in Android O (Closed)

Created:
3 years, 7 months ago by dmazzoni
Modified:
3 years, 7 months ago
CC:
chromium-reviews, szager+layoutwatch_chromium.org, jchaffraix+rendering, zoltan1, aboxhall+watch_chromium.org, nektar+watch_chromium.org, blink-reviews-layout_chromium.org, pdr+renderingwatchlist_chromium.org, jam, leviw+renderwatch, yuzo+watch_chromium.org, dougt+watch_chromium.org, darin-cc_chromium.org, dmazzoni+watch_chromium.org, dtseng+watch_chromium.org, agrieve+watch_chromium.org, blink-reviews, je_julie, eae+blinkwatch
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix TalkBack feedback for password fields in Android O Prior to O, we were supposed to expose either the value of a password field, or just dots, depending on a value of a system setting, and independent of what's shown visually. In O, we're now supposed to expose what's visually shown, whether that's characters or dots. HOWEVER, if a character is replaced with a dot we have to update our internal state, but not fire an Android event with that character change, to keep it silent. This fix reverts the change to LayoutText landed by Paul Miller in r468393 (and merged back to M58) because it was suppressing changes to the internal accessibility state when a character was replaced with a dot. Instead now we keep the internal state updated but suppress that particular event from being fired on Android. As a minor improvement, this change implements setTextSelection on AccessibilityNodeInfo, which enables TalkBack to announce when the cursor reaches the beginning or end of a text field the same way as it does with native fields. BUG=721663, 716212 TBR=wangxianzhu NOTRY=true Review-Url: https://codereview.chromium.org/2881723002 Cr-Commit-Position: refs/heads/master@{#471383} Committed: https://chromium.googlesource.com/chromium/src/+/4e36c746c6c51486f9e57e47a946ee35918fd9f0

Patch Set 1 #

Total comments: 5

Patch Set 2 : Address feedback #

Messages

Total messages: 23 (12 generated)
dmazzoni
https://codereview.chromium.org/2881723002/diff/1/third_party/WebKit/Source/core/layout/LayoutText.cpp File third_party/WebKit/Source/core/layout/LayoutText.cpp (right): https://codereview.chromium.org/2881723002/diff/1/third_party/WebKit/Source/core/layout/LayoutText.cpp#newcode1721 third_party/WebKit/Source/core/layout/LayoutText.cpp:1721: if (!force && Equal(text_.Impl(), text.Get())) Note that the changes ...
3 years, 7 months ago (2017-05-12 06:46:16 UTC) #5
aboxhall
lgtm https://codereview.chromium.org/2881723002/diff/1/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java File content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java (right): https://codereview.chromium.org/2881723002/diff/1/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java#newcode1201 content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java:1201: return (Settings.System.getInt(mContentViewCore.getContext().getContentResolver(), Suggestion: pull this out into a ...
3 years, 7 months ago (2017-05-12 07:09:34 UTC) #6
dmazzoni
https://codereview.chromium.org/2881723002/diff/1/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java File content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java (right): https://codereview.chromium.org/2881723002/diff/1/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java#newcode1201 content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java:1201: return (Settings.System.getInt(mContentViewCore.getContext().getContentResolver(), On 2017/05/12 07:09:34, aboxhall wrote: > Suggestion: ...
3 years, 7 months ago (2017-05-12 07:43:09 UTC) #8
dmazzoni
Landing change now because this is potentially urgent for Android, and it'd be great to ...
3 years, 7 months ago (2017-05-12 07:44:57 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2881723002/20001
3 years, 7 months ago (2017-05-12 07:45:42 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/382916)
3 years, 7 months ago (2017-05-12 08:43:57 UTC) #14
Xianzhu
core/ lgtm.
3 years, 7 months ago (2017-05-12 15:34:49 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2881723002/20001
3 years, 7 months ago (2017-05-12 18:03:46 UTC) #18
paulmiller
revert lgtm I don't fully understand what's going on here, though. Your description implies the ...
3 years, 7 months ago (2017-05-12 18:15:07 UTC) #19
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/chromium/src/+/4e36c746c6c51486f9e57e47a946ee35918fd9f0
3 years, 7 months ago (2017-05-12 18:43:49 UTC) #22
dmazzoni
3 years, 7 months ago (2017-05-12 18:47:16 UTC) #23
Message was sent while issue was closed.
On 2017/05/12 18:15:07, paulmiller wrote:
> revert lgtm
> 
> I don't fully understand what's going on here, though. Your description
implies
> the text in the layout tree does actually change when the character is
visually
> hidden. That was not my conclusion when I was debugging this, and my initial
fix
> depends on the fact that the new and old texts are equal. I assumed there was
> some other mechanism which was changing what was displayed, separate from what
> text was actually in the layout tree, but I never found what that mechanism
was.
> Your description also implies my initial fix was getting the AX tree out of
> sync, but I thought I'd avoided that by only suppressing the no-op events. Was
I
> wrong about that?

Great question. What's confusing here is that the accessibility tree contains
information from both the DOM tree (which has the typed password text,
unobscured), and the layout tree (which has what's shown visually). The
accessibility tree ends up looking something like this:

AX role=textfield value="password" - for DOM node <input type=password>
    AX role=div - for root of shadow dom tree
        AX role=staticText name="•••••••d" - for LayoutText object

Previously, we only exposed the full password (the top node in the tree) to
Android, or else we manually obscured it. Your fix worked fine, it got rid of
a spurious notification on the LayoutText object.

Now in O we want to expose the layout tree, so we expose whatever's
rendered. Your change suppressed the notification fired when the layout
text changed from "•••••••d" to ""••••••••", which we now need.

What my patch does, to match TextView, is to expose the contents of
the LayoutText, but only fire a notification when the DOM element changes.

Powered by Google App Engine
This is Rietveld 408576698