Skip to content
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

Merged
merged 7 commits into from
Oct 20, 2023

Conversation

mdebbar
Copy link
Contributor

@mdebbar mdebbar commented Oct 13, 2023

  • 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%.

Part of flutter/flutter#137287

@mdebbar mdebbar requested a review from ditman October 13, 2023 17:27
@github-actions github-actions bot added the platform-web Code specifically for the web engine label Oct 13, 2023
@mdebbar mdebbar requested a review from ditman October 13, 2023 19:34
/// 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');
Copy link
Member

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)

Copy link
Contributor Author

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 :)

Copy link
Member

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)?

@mdebbar mdebbar requested a review from ditman October 19, 2023 16:51
///
/// 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(
Copy link
Member

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!

Copy link
Contributor Author

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.

Copy link
Member

@ditman ditman left a 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.

Copy link
Member

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

Copy link
Contributor Author

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.

lib/web_ui/lib/src/engine/util.dart Show resolved Hide resolved
@mdebbar mdebbar added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 20, 2023
@auto-submit auto-submit bot merged commit 471fbc5 into flutter:main Oct 20, 2023
23 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 20, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Oct 20, 2023
…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
harryterkelsen pushed a commit that referenced this pull request Oct 23, 2023
- 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%`.
@mdebbar mdebbar deleted the pv_view_id branch December 11, 2023 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App platform-web Code specifically for the web engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants