Fix keyboard accessibility feedback
commit296c8ad0ae130bcb25ac71e45c5353d4c6b1ac6a
authorpaulmiller <paulmiller@chromium.org>
Tue, 14 Jul 2015 23:42:25 +0000 (14 16:42 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 14 Jul 2015 23:44:07 +0000 (14 23:44 +0000)
tree9c54d88d5924b87a8e88fefb290ccb25b66cdfe6
parentb8788460cebd0e84919246968166c54f900471b2
Fix keyboard accessibility feedback

Say we get an AccessibilityEvent of TYPE_VIEW_TEXT_CHANGED for a change
from "a" to "aa". The old implementations of GetTextChangeAddedCount
and GetTextChangeRemovedCount would match "a" to the first half of "aa"
from the left, then match "a" to the second half of "aa" from the right,
over-counting the number of matching letters. PopulateAccessibilityEvent
would then write the bogus added/removed letter counts to the event. On
Android, TalkBack would then ignore the malformed event, and the user
would miss audio feedback for that keystroke.

Now, we remove any matching letters on the left before matching on the
right, to avoid over-counting.

internal bug 20923568

BUG=510222

Review URL: https://codereview.chromium.org/1225113004

Cr-Commit-Position: refs/heads/master@{#338771}
content/browser/accessibility/browser_accessibility_android.cc
content/browser/accessibility/browser_accessibility_android.h