New issue
Advanced search Search tips

Issue 648391 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Oct 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug
Team-Accessibility



Sign in to add a comment

Android: WebView shouldn't send accessibility focus events unless focus is already inside

Project Member Reported by dmazz...@chromium.org, Sep 19 2016

Issue description

In Chrome, we send accessibility focus events whenever focus changes in a web page. That makes sense because the web page is what the user wants to interact with.

A WebView is often only part of a page. We shouldn't move focus to a WebView unless focus was already there, then we can move it within the WebView within reason.

We have some code that avoids sending a focus when the page loads, but that isn't sufficient, as there are other scenarios when a focus can be triggered even without explicitly calling focus().

See b/31257033 for one example of this causing a substandard user experience.



 
Here's an example web page that moves focus every 5 seconds.

The desired behavior is that TalkBack follows and announces the focus changes when you're inside the page, but if you tap on something outside the page (like the Chrome address bar), those announcements should stop and it should stop "stealing" focus away from what you're trying to do.

<style>
button {
  font-size: 24px;
  padding: 20px 30px;
}
</style>
<button id="b1">1</button>
<button id="b2">2</button>
<button id="b3">3</button>
<script>
var i = 1;
setInterval(function() {
  document.getElementById('b' + i).focus();
  i++;
  if (i == 4)
    i = 1;
}, 5000);
</script>

Project Member

Comment 2 by bugdroid1@chromium.org, Oct 23 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ad960c92315b64c662491152381b53b22c81a9c8

commit ad960c92315b64c662491152381b53b22c81a9c8
Author: dmazzoni <dmazzoni@chromium.org>
Date: Sun Oct 23 13:35:12 2016

Android shouldn't fire focus events when the WebView itself isn't focused

BUG= 648391 

Review-Url: https://chromiumcodereview.appspot.com/2416293002
Cr-Commit-Position: refs/heads/master@{#426993}

[modify] https://crrev.com/ad960c92315b64c662491152381b53b22c81a9c8/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java

Status: Fixed (was: Assigned)
Status: Verified (was: Fixed)
Verified on Nexus 7 (MOB31 L) with Webview version : 56.0.2900.3 
Project Member

Comment 5 by bugdroid1@chromium.org, Dec 2 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c2607397665f0a0a8e3b16198dbeaae2a9e1e0bb

commit c2607397665f0a0a8e3b16198dbeaae2a9e1e0bb
Author: dmazzoni <dmazzoni@chromium.org>
Date: Fri Dec 02 17:29:25 2016

Revert "Android shouldn't fire focus events when the WebView itself isn't focused"

Caused  http://crbug.com/667559  - when clicking on a <select> pop-up and
then returning to the page, focus was being reset to the whole page rather
than back to the select element.

Original changelist: https://chromiumcodereview.appspot.com/2416293002

BUG= 648391 , 667559 
TBR=dtseng@chromium.org

Review-Url: https://codereview.chromium.org/2547903002
Cr-Commit-Position: refs/heads/master@{#435964}

[modify] https://crrev.com/c2607397665f0a0a8e3b16198dbeaae2a9e1e0bb/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java

Project Member

Comment 6 by bugdroid1@chromium.org, Dec 2 2016

Labels: merge-merged-2924
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7fa77424b02d63b38bb1262471cc4af8e3f54fc0

commit 7fa77424b02d63b38bb1262471cc4af8e3f54fc0
Author: Dominic Mazzoni <dmazzoni@chromium.org>
Date: Fri Dec 02 20:05:14 2016

Merge to M56: Revert "Android shouldn't fire focus events when the WebView itself isn't focused"

Caused  http://crbug.com/667559  - when clicking on a <select> pop-up and
then returning to the page, focus was being reset to the whole page rather
than back to the select element.

Original changelist: https://chromiumcodereview.appspot.com/2416293002

BUG= 648391 , 667559 
TBR=dtseng@chromium.org

Review-Url: https://codereview.chromium.org/2547903002
Cr-Commit-Position: refs/heads/master@{#435964}
(cherry picked from commit c2607397665f0a0a8e3b16198dbeaae2a9e1e0bb)

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

Cr-Commit-Position: refs/branch-heads/2924@{#296}
Cr-Branched-From: 3a87aecc31cd1ffe751dd72c04e5a96a1fc8108a-refs/heads/master@{#433059}

[modify] https://crrev.com/7fa77424b02d63b38bb1262471cc4af8e3f54fc0/content/public/android/java/src/org/chromium/content/browser/accessibility/BrowserAccessibilityManager.java

Sign in to add a comment