Manage Autofill session lifetime
During an Autofill session, distinct sets of views (also called partitions) can trigger individual fill requests. However, there is a configurable limit on the maximum number of partitions, which in the case of stock Android is set to 10. Since Chrome never finishes an Autofill session and every page load with a form adds a partition, this means that Autofill fills stop triggering after a short time. This can be mitigated by cancelling the session when user actions indicate that there is no longer any Autofill-related state to preserve in the current tab: * When the user switches away from a tab. By cancelling the session before the tab contents become hidden, we additionally prevent Autofill from initiating a save flow as all virtual views become invisible. * When top-level navigation occurs that has not been initiated by the renderer. Renderer-initiated navigation, such as tapping a submit button in a form, may trigger Autofill's save functionality and must therefore not cancel the session. * When the domain part of the current URL changes. This behavior is part of the Android Autofill service's compatibility mode, but was partially broken on Android Q+ due to http://crbug.com/1103555 and completely broken by the workaround for that bug. The current change restored this behavior. These changes apply to Android P+ only as this is the first Android version with compatibility Autofill support for Chrome. The remaining scenarios in which the maximal partition count can be reached and Autofill stops triggering include: * A single document with more than ten separate forms. This should be rare and would equally be a problem in a native app. * Single-page apps or those consisting of multiple linked pages with a high total number of fillable forms. If the user does not switch tabs, Autofill may stop working after some time. Further improvements might be possible here, but have to avoid cancelling Autofill in a possible save scenario. Bug: 1150732 Change-Id: I1005cbd349f3ba3ea25a9edafe80d82a21876bce Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2546900Reviewed-by:Ted Choc <tedchoc@chromium.org> Reviewed-by:
Michael Bai <michaelbai@chromium.org> Reviewed-by:
Andrew Grieve <agrieve@chromium.org> Commit-Queue: Fabian Henneke <fabian.henneke@gmail.com> Cr-Commit-Position: refs/heads/master@{#831987}
Showing
Please register or sign in to comment