This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Fix text range logic for a11y #16496
Merged
Merged
Conversation
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
gaaclarke
reviewed
Feb 7, 2020
| } | ||
|
|
||
| TEST(StringRangeSanitizationTest, HandlesEndOfRange) { | ||
| EXPECT_EQ(fml::RangeForCharacterAtIndex(@"1234", 4).location, 4UL); |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add assert for the NSRange.length too
Contributor
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
gaaclarke
approved these changes
Feb 7, 2020
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Feb 7, 2020
cbracken
reviewed
Feb 7, 2020
Member
cbracken
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Feb 8, 2020
dnfield
pushed a commit
to flutter/flutter
that referenced
this pull request
Feb 8, 2020
* c932214 Ensure fields of Rect and OffsetBase classes are optimized as non-null. (flutter/engine#16465) * 5c70356 Simplify task queues locking mechanism (flutter/engine#16477) * d589dde Fix text range logic for a11y (flutter/engine#16496) * 1a4f4e3 Fix unused import in Android embedder (flutter/engine#16494) * 964ae10 Disable ShellTest.WaitForFirstFrameTimeout on Fuchsia (flutter/engine#16495) * 6158f03 Roll src/third_party/skia 87e3bef6f82f..9f3eef796f63 (7 commits) (flutter/engine#16493)
NoamDev
pushed a commit
to NoamDev/engine
that referenced
this pull request
Feb 27, 2020
Make sure that a text range at the end of the string is still valid.
NoamDev
added a commit
to NoamDev/engine
that referenced
this pull request
Feb 27, 2020
This reverts commit 7866595.
8 tasks
9 tasks
github-merge-queue bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Jan 27, 2025
[Previously approved](flutter/engine#55909) in /engine before monorepo shift. Reverts an unnecessary assertion introduced by [#16496](flutter/engine#16496) that crashes upon valid user text field interactions. Follow-on work can resolve the underlying discrepancy between iOS and Flutter range finding (see #160100). For crash reports, see issue [#138464](#138464). ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md Co-authored-by: Chris Bracken <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
see also: #8747
The linked PR unintentionally introduced a bug in text range handling where we treated a text range with a location at the end of the string as invalid. This should not be the case.
This resulted in a crash in a11y on iOS when you entered text, the cursor is at the end of the field, and you tap.
This app can reproduce the issue with VoiceOver on:
Fortunately, the FML change doesn't break any of the original tests - I think it was just an oversight at the time, the other FML method handles cases like this correctly.
/cc @jkurtw @mehmetf @chingjun - this fixes b/149077991