Repository navigation
Fix AutoScroll accessibility hit-test latency and reliability - #1350
Merged
Merged
Conversation
Avoid unnecessary native AX queries and replace nearby-point sampling with a bounded same-position retry for browser uncertainty and recoverable accessibility errors. Co-authored-by: Gilang Gunawan <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cannotCompleteandnotImplemented).Background
PR #1340 first identified that
AutoScrollAccessibilityActivationClassifierperformed nearby-point resampling for every non-pressable hit. Because Auto Scroll
normally starts on non-pressable areas, native views such as Finder could perform up
to nine additional synchronous AX hit tests before showing the Auto Scroll indicator.
#1340 addressed the latency by restricting nearby sampling to web content and stopping
ancestor traversal at list containers. This PR supersedes that approach with a more
targeted implementation:
semantics.
controls.
once.
Chromium documents that its first synchronous accessibility hit test can be an
approximate bounding-box result while the renderer resolves the precise result
asynchronously. Its regression test likewise expects the first cached hit test to miss
and the second hit test at the same point to succeed.
https://chromium.googlesource.com/chromium/src/+/main/docs/accessibility/browser/how_a11y_works_3.md#Hit-testing
https://chromium.googlesource.com/chromium/src/+/HEAD/content/browser/accessibility/hit_testing_browsertest.cc#710
Safari was also observed returning a transient
kAXErrorNotImplementedduring a coldweb accessibility hit test. The retry is therefore limited to browser signals and
recoverable AX errors. Permanent errors such as
invalidUIElementretain theirdiagnostics and return immediately.
The
activateOverPressableElementsoption proposed by #1340 is intentionally notincluded. The press-and-drag workflow from #1339 has since been addressed separately
by #1348 using long-press activation, without restoring a native middle-click override.
Thanks to @gilang-gunawan for identifying the unconditional AX resampling bottleneck,
providing measurements, and proposing the original fix in #1340.
Testing
AXLinkafter retrying the same position.hitTest.notImplementedto anAXLinkafter retrying the same position.
cannotCompleteandnotImplementedretry.Closes #1340