-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[web] Support flutterViewId
in platform view messages
#46891
Conversation
lib/web_ui/lib/src/engine/util.dart
Outdated
/// Returns null if the view ID is not present or if [arguments] is not a map. | ||
int? tryFlutterViewId(Object? arguments) { | ||
if (arguments is Map) { | ||
return arguments.tryInt('flutterViewId'); |
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.
I'm trying to figure out if this is going to be named 'viewId'
or something else before we land this :P (for the render
, for example)
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.
We can always change this when a global naming decision has been made :)
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.
Yeah, the change is going to be a little bit of a pain, since the string needs to be kept in sync between the engine <-> framework. I think @goderbauer mentioned he'd use viewId
for other messages. Should we rename this (and the fw version)?
/// | ||
/// This is transitional code to support the old platform view channel. As | ||
/// soon as the framework code is updated to send the `flutterViewId`, this | ||
/// soon as the framework code is updated to send the Flutter View ID, this | ||
/// method can be removed. | ||
void handleLegacyPlatformViewCall( |
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.
I totally forgot about this method. Good repurposing though!
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.
You must've been looking at an individual commit from the PR 🙂 This method is new.
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.
Thanks for taking the time to build this in a backwards-compatible way! LGTM other than minor comments.
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.
Should we make a legacy_message_handler_test.dart
copy of this file with the old tests, so handleLegacyPlatformViewCall
maintains its testing? When we delete the legacy handler, we can just delete the file.
(I understand that this is supposedly going to be deleted as soon as this lands, buuuut, it should have been deleted earlier as well and you found it :P
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.
Not sure what you mean by it should have been deleted earlier
. The handleLegacyPlatformViewCall
method is a new one that I added in this PR to manage the transition.
…136982) flutter/engine@d46933e...b27e1b3 2023-10-20 [email protected] Add link support in web accessibility (flutter/engine#46117) 2023-10-20 [email protected] [web] Support `flutterViewId` in platform view messages (flutter/engine#46891) 2023-10-20 [email protected] Fix async image loading issues in skwasm. (flutter/engine#47117) 2023-10-20 [email protected] Add option to save Impeller failure images in rendertests (flutter/engine#47142) 2023-10-20 [email protected] Roll Skia from b960e9140f56 to 9ffd5ef9a9ed (3 revisions) (flutter/engine#47167) 2023-10-20 [email protected] [macOS] Eliminate extraneous loadView calls (flutter/engine#47166) 2023-10-20 [email protected] Roll Dart SDK from ba96a157a8eb to 53fee35b299f (1 revision) (flutter/engine#47165) 2023-10-20 [email protected] [Impeller] GPU Tracer for GLES. (flutter/engine#47080) 2023-10-20 [email protected] Roll Skia from de628929015d to b960e9140f56 (2 revisions) (flutter/engine#47164) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
- Accept a new `flutterViewId` field in platform view messages. - Keep transitory support for legacy platform view messages that don't contain `flutterViewId`. - Default view factories set `width:100%` and `height:100%`.
flutterViewId
field in platform view messages.flutterViewId
.width:100%
andheight:100%
.Part of flutter/flutter#137287