зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1734552 - Don't walk though the accessibility nodes on autofill. r=geckoview-reviewers,agi
When Autofill service runs with compatibility mode [*1] (such as Bitwarden), `View.onProvideAutofillStructure` walks through the accessibility nodes. Walking through it spends a lot of times. When checking Android's source code, the following walks through it. - `onProvideAutofillVirtualStructure` - `autofill` - `isVisibleToUserForAutofill` Actually, since we already add autofill's virtual nodes, it is unnecessary to walk through it. *1 https://developer.android.com/reference/android/service/autofill/AutofillService#compatibility-mode Differential Revision: https://phabricator.services.mozilla.com/D127952
This commit is contained in:
Родитель
cd949b6356
Коммит
9408d87ba5
|
@ -785,8 +785,6 @@ public class GeckoView extends FrameLayout {
|
|||
@Override
|
||||
public void onProvideAutofillVirtualStructure(final ViewStructure structure,
|
||||
final int flags) {
|
||||
super.onProvideAutofillVirtualStructure(structure, flags);
|
||||
|
||||
if (mSession == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -798,8 +796,6 @@ public class GeckoView extends FrameLayout {
|
|||
@Override
|
||||
@TargetApi(26)
|
||||
public void autofill(@NonNull final SparseArray<AutofillValue> values) {
|
||||
super.autofill(values);
|
||||
|
||||
if (mSession == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -814,6 +810,14 @@ public class GeckoView extends FrameLayout {
|
|||
mSession.autofill(strValues);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisibleToUserForAutofill(final int virtualId) {
|
||||
// If autofill service works with compatibility mode,
|
||||
// View.isVisibleToUserForAutofill walks through the accessibility nodes.
|
||||
// This override avoids it.
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Request a {@link Bitmap} of the visible portion of the web page currently being
|
||||
* rendered.
|
||||
|
|
Загрузка…
Ссылка в новой задаче