Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Plumb a reference of PlatformViewsController and AccessibilityBridge to each other #8208

Merged
merged 5 commits into from
Mar 19, 2019

Conversation

amirh
Copy link
Contributor

@amirh amirh commented Mar 19, 2019

This is in preparation for implementing platform views a11y on Android.

And e2e working prototype is available here: https://github.com/amirh/engine/tree/a11y_hacks

flutter/flutter#19418

@amirh amirh requested a review from goderbauer March 19, 2019 01:19
);
platformViewsController.attachAccessibilityBridge(accessibilityBridge);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to detach this ever?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to keep the same lifespan as the AccessibilityBridge reference, should accessibilityBridge be unset in the new FlutterView like in the current one?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthew-carroll May have more context to answer that question.

@matthew-carroll matthew-carroll self-requested a review March 19, 2019 18:19
@matthew-carroll
Copy link
Contributor

@amirh can you avoid the new FlutterView and just make this change to the old FlutterView for now?

Also, I don't think we should have cyclical dependencies like this between AccessibilityBridge and PlatformViewsController. This indicates a deeper problem to me. One can use the other, but if they both require each other to exist all the time, then I think that's an indication of a likely object decomposition problem.

Copy link
Contributor

@matthew-carroll matthew-carroll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some comments to be addressed.

@amirh
Copy link
Contributor Author

amirh commented Mar 19, 2019

@matthew-carroll sure I'll remove it from the in progress FlutterView, I'm leaving a TODO for you to do the plumbing there.

I agree this cyclic dependency is smelly, but I'm not sure there's much we can do other than merge the whole thing into a single object: as we are proxying a 2-way communication channel between the Android a11y framework and the view.
Note that they do not "require each other to exist all the time", the platform views controller can live without a reference to the a11y bridge and in this case will just not propagate a11y events out of the virtual display.

@matthew-carroll
Copy link
Contributor

I'm confused as to what the relationship is. I don't see any usages of either artifact by the other, just references held. I think we need to see what the actual behavior is if we're going to evaluate the necessity of this relationship. I could imagine a few alternatives, but they depend entirely on the specific interactions.

@amirh
Copy link
Contributor Author

amirh commented Mar 19, 2019

You can check the (hacky) prototype to get an idea of the interactions, that change is going to be hard to review at once so I'm leading incremental pieces, with this being the first step.

@amirh amirh requested a review from matthew-carroll March 19, 2019 19:09
@matthew-carroll
Copy link
Contributor

I think it's pretty important that we review the actual behaviors before giving an LGTM to the fundamental relationship. Can you describe why it will be difficult to review at one time? If you'd like, I can come by and we can chat in person if that would make it easier. But I'm really not comfortable with this dependency in the absence of the supporting purpose for its existence.

@amirh
Copy link
Contributor Author

amirh commented Mar 19, 2019

@goderbauer PTAL

* Facilitates interaction between the accessibility bridge and embedded platform views.
*/
public interface PlatformViewsAccessibilityDelegate {
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a TODO in here to fill this with ... stuff (I am wondering what that would be?)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a TODO

@matthew-carroll
Copy link
Contributor

Amir and I spoke about the relationship between AccessibilityBridge and the platform views system. We agreed on an approach in which AccessibilityBridge will hang a dependency on what Amir has called the PlatformViewsDelegate, and that delegate will offer an interface capable of returning a View to AccessibilityBridge. The AccessibilityBridge will then be updated to extract accessibility information out of that View and send it to Android, as well as forward accessibility events to the given View.

LGTM

@amirh amirh merged commit 45f69ac into flutter:master Mar 19, 2019
@amirh amirh deleted the a11y_plumbing branch March 19, 2019 22:48
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 20, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 20, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 20, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Mar 20, 2019
flutter/engine@96ad0c8...a1dcb2e

git log 96ad0c8..a1dcb2e --no-merges --oneline
a1dcb2e [ios] Set contentsScale before we commit CATransaction (flutter/engine#8218)
fa1931f Send macOS keyboard data to the engine (flutter/engine#8219)
45f69ac Plumb a reference of PlatformViewsController and AccessibilityBridge to each other (flutter/engine#8208)
7cbbdb4 libtxt: more accurate tracking of run positioning and width for justified text (flutter/engine#8214)
1728103 Add a build dependencies script for Linux desktop (flutter/engine#8160)
d764b69 Add docs for helpful commands to fix format (flutter/engine#8171)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff ([email protected]), and stop
the roller if necessary.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 20, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 20, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Mar 20, 2019
flutter/engine@96ad0c8...6a8a45f

git log 96ad0c8..6a8a45f --no-merges --oneline
6a8a45f Have the AccessibilityBridge attach/detach itself to the (flutter/engine#8229)
45b19e4 Roll src/third_party/skia ba91f65f2070..7e2c0614a2fd (13 commits) (flutter/engine#8228)
1dbd204 Moved io.flutter.embedding.engine.android package to io.flutter.embedding.android (flutter/engine#8221)
bb35436 Roll src/third_party/dart 70e3e67dd7..5e9df35a57 (45 commits)
3b19a4d Removed dart_plugin_tag from DEPS
d9b6629 Roll src/third_party/skia 4273a150f84d..ba91f65f2070 (6 commits) (flutter/engine#8225)
e88573a Roll src/third_party/skia d7d93001ead2..4273a150f84d (1 commits) (flutter/engine#8224)
be9067c Roll src/third_party/skia 37a9294d2eb9..d7d93001ead2 (2 commits) (flutter/engine#8223)
ee4abba Roll src/third_party/skia 2894d13a0d9b..37a9294d2eb9 (1 commits) (flutter/engine#8222)
3496156 Roll src/third_party/skia dd0544078d05..2894d13a0d9b (33 commits) (flutter/engine#8220)
a1dcb2e [ios] Set contentsScale before we commit CATransaction (flutter/engine#8218)
fa1931f Send macOS keyboard data to the engine (flutter/engine#8219)
45f69ac Plumb a reference of PlatformViewsController and AccessibilityBridge to each other (flutter/engine#8208)
7cbbdb4 libtxt: more accurate tracking of run positioning and width for justified text (flutter/engine#8214)
1728103 Add a build dependencies script for Linux desktop (flutter/engine#8160)
d764b69 Add docs for helpful commands to fix format (flutter/engine#8171)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff ([email protected]), and stop
the roller if necessary.
RBogie pushed a commit to RBogie/flutter-engine that referenced this pull request Apr 8, 2019
…to each other (flutter#8208)

This is in preparation for implementing platform views a11y on Android.

And e2e working prototype is available here: https://github.com/amirh/engine/tree/a11y_hacks

flutter/flutter#19418
RBogie added a commit to RBogie/flutter-engine that referenced this pull request Apr 8, 2019
RBogie added a commit to RBogie/flutter-engine that referenced this pull request Apr 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants