-
Notifications
You must be signed in to change notification settings - Fork 28.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add set semantics enabled API and wire iOS a11y bridge #161265
base: master
Are you sure you want to change the base?
Conversation
53c5a6a
to
c601cac
Compare
80990ed
to
1b9b5f1
Compare
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.
@chunhtai can you add a PR description with the rationale for the change, related bug(s), etc.?
sorry, forgot to add description. Done |
4123a4c
to
fb23357
Compare
e4daa91
to
ffd43a5
Compare
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 for dart:ui (after doc nits are resolved)
/// Informs the engine whether the framework is generating a semantics tree. | ||
/// | ||
/// Only framework knows when semantics tree should be generated. It uses this | ||
/// method to notify the engine such event. |
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.
Maybe better:
/// method to notify the engine such event. | |
/// method to notify the engine whether the framework will generate a semantics tree. |
0346c47
to
4428901
Compare
@chunhtai heads up there are failures here if you hadn't seen. |
b3d00a8
to
0fee10f
Compare
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.
Just a few small nits then good to go!
engine/src/flutter/shell/platform/darwin/ios/platform_view_ios_test.mm
Outdated
Show resolved
Hide resolved
0fee10f
to
8ca0563
Compare
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.
autosubmit label was removed for flutter/flutter/161265, because - The status or check suite Mac_arm64 module_test_ios has failed. Please fix the issues identified (or deflake) before re-applying this label. |
autosubmit label was removed for flutter/flutter/161265, because - The status or check suite Mac_arm64 module_test_ios has failed. Please fix the issues identified (or deflake) before re-applying this label. |
8ca0563
to
9d447eb
Compare
autosubmit label was removed for flutter/flutter/161265, because - The status or check suite Mac_arm64 module_test_ios has failed. Please fix the issues identified (or deflake) before re-applying this label. |
0a93430
to
7a9372d
Compare
autosubmit label was removed for flutter/flutter/161265, because - The status or check suite Mac mac_ios_engine has failed. Please fix the issues identified (or deflake) before re-applying this label. |
autosubmit label was removed for flutter/flutter/161265, because - The status or check suite Mac_arm64 module_test_ios has failed. Please fix the issues identified (or deflake) before re-applying this label. |
autosubmit label was removed for flutter/flutter/161265, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label. |
346a981
to
04eff48
Compare
autosubmit label was removed for flutter/flutter/161265, because - The status or check suite Linux linux_unopt has failed. Please fix the issues identified (or deflake) before re-applying this label. |
04eff48
to
5fab358
Compare
5fab358
to
eaf2937
Compare
fixes #158399
old pr flutter/engine#56691
previously the only correct way to enable semantics is that ios embedding receive signal from native OS, it call SetSemanticsEnabled to shell and then to dart to enable semantics tree generation.
If for some reason framework decide to enable semantics first, e.g. through SemanticsBinding.instance.ensureSemantics(typically due to integration test or ci that wants to test semantics), the update will be dropped in shell. Even if it later on receive signal from native OS to turn on semantics, it can't construct the complete accessibility tree in embedding because the updatesemantics sends diff update and previous updates are gone forever. It will end up in a broken state.
This pr changes so that the only source of truth will be in the framework side. When framework starts generating the the semantics tree, it will call SetSemanticsTreeEnabled through dart:ui, and the embedding needs to prepare itself to accept semantics update after receiving the message.
This however require some refactoring on iOS embedding because it will only create a11y bridge when receiving OS notification when assitive technologies turns on.
This requires three phase transition
add an empty dart:ui API setSemanticsTreeEnabled
makes framework calls the empty API.
merge this pr with actual implementation of setSemanticsTreeEnabled
I will do the android part in a separate pr
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.