This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[ios] Refactors accessibilityElementAtIndex #15303
Closed
Closed
Conversation
This file contains 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
Adds signposts (Test background queue commented out)
- Update expected json file (remove pretty-print for filesize reasons - consider compression)
julianrex
added
iOS
Mapbox Maps SDK for iOS
⚠️ DO NOT MERGE
Work in progress, proof of concept, or on hold
accessibility
Integration with screen readers and other assistive technology
needs changelog
Indicates PR needs a changelog entry prior to merging.
labels
Aug 2, 2019
I tested #14832 with |
Closing, since the relevant parts need to be ported to |
This was referenced Jun 15, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
accessibility
Integration with screen readers and other assistive technology
⚠️ DO NOT MERGE
Work in progress, proof of concept, or on hold
iOS
Mapbox Maps SDK for iOS
needs changelog
Indicates PR needs a changelog entry prior to merging.
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.
Fixes #14324 (and should address some reported associated out-of-bounds crashes)
This PR requires
The main issue behind #14324 was that the same work was being repeatedly performed; if you look through the call stacks you can see that
-accessibilityElementCount
is called first, then-accessibilityElementAtIndex:
that many times.Instead, this PR generates the accessibility elements once (if it has been requested). This can still be a lengthly process, though we should be able to handle some of this on a background queue eventually (in a follow-on PR). This PR is about getting rid of the hang, crashes and generally improving performance.
The "places" listed in the accessibility value are now the closest towns to the center/user location - as opposed to what has been returned from queryRenderedFeatures.
Considering performance: looking at
accessibilityElementForRoadFeature:
(which takes up the bulk of the time of the new-generateAccessibilityElementsIfNeeded
) we seethat
UIAccessibilityConvertPathFunction
takes the bulk of the time, and this is out of our control. We may be able to call this a background thread, but given it is UI related I am skeptical.Once
queryRenderedFeatures
is asynchronous, then we should revisit this to try to background as much as we can (and post the accessibility notifications when done).However, I think we need to revisit accessibility in general, as it doesn't give a good user-experience - and we're currently doing too much work for little benefit.
@friedbunny would you mind walking me through #14832 - as I have not tested that yet.