[go: up one dir, main page]

Introduces a workaround for a hung that occurs when using autofill with accessibility

When Chromium automatically places an autofill suggestion in a text field, the value attribute of the text field does not update immediately.
Even though the value update should have been sent to the renderer, the accessibility tree on the browser doesn't update as soon as the autofill suggestion has been committed.
As a result, on Windows and Linux ATK, the text field's hypertext is empty, because it is retrieved directly from the text field's value.
However, the user-agent shadow DOM inside the text field contains a static text object with the autofill suggestion that has just been committed, whose hypertext is not empty.
When computing a parent equivalent position from an AXPosition after the static text object that represents the autofill suggestion, a position that is in the text field is correctly returned.
However, that position's text offset now holds a seemingly invalid value, because according to the hypertext of the text field, the field should contain no text.
This breaks all the comparison operators in AXPosition, because the above results in an infinit loop in the CompareTo method.

The proper fix is to update the hypertext of the text field in AXPlatformNodeBase to include the text of any autofill suggestion, (committed or uncommitted).
Alternatively the value attribute should be updated as soon as an autofill suggestion is committed.
However, both of this fixes are risky for M75.

A workaround has been introduced that tries to detect invalid text offsets in AXPosition::CreateParentPosition, and return a position at the start of the text node instead.

R=​aleventhal@chromium.org, frpoole@microsoft.com

(cherry picked from commit d4b62c604f890e756a1cd71b2f3ec1816f1753d2)

Bug: 973722
Change-Id: I3786ee0cf9f0e9d83efc15c14702f242a8ba7851
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1661548
Auto-Submit: Nektarios Paisios <nektar@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: Aaron Leventhal <aleventhal@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#669506}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1662710
Reviewed-by: Nektarios Paisios <nektar@chromium.org>
Cr-Commit-Position: refs/branch-heads/3770@{#1028}
Cr-Branched-From: a9eee1c7c727ef42a15d86e9fa7b77ff0e63840a-refs/heads/master@{#652427}
1 file changed