Skip to content

[web] New HtmlElementView.fromTagName constructor - #130513

Merged
auto-submit[bot] merged 12 commits into
flutter:masterfrom
mdebbar:built_in_factory
Aug 7, 2023
Merged

[web] New HtmlElementView.fromTagName constructor#130513
auto-submit[bot] merged 12 commits into
flutter:masterfrom
mdebbar:built_in_factory

Conversation

@mdebbar

@mdebbarmdebbar commented Jul 13, 2023

Copy link
Copy Markdown
Contributor

This wraps up the platform view improvements discussed in #127030.

  • Splits HtmlElementView into 2 files that are conditionally imported.
  • The non-web version can be instantiated but it throws if it ends up being built in a widget tree.
  • Out-of-the-box view factories that create visible & invisible DOM elements given a tagName parameter.
  • New HtmlElementView.fromTagName() constructor that uses the default factories to create DOM elements.
  • Tests covering the new API.

Depends on flutter-team-archive/engine#43828

Fixes#127030

@mdebbar
mdebbar requested a review from ditmanJuly 13, 2023 19:16
@github-actionsgithub-actionsBot added the framework flutter/packages/flutter repository. See also f: labels. label Jul 13, 2023

@ditmanditman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Small comment: would defining the default factories in the engine simplify the framework code?

Comment threadpackages/flutter/lib/src/widgets/_html_element_view_web.dart Outdated
Comment threadpackages/flutter/lib/src/widgets/platform_view.dart Outdated
Comment threadpackages/flutter/lib/src/widgets/platform_view.dart

@ditmanditman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this one is ready to go. Only one comment about attempting to make the new extension private so it doesn't show in docs.flutter.dev.

Comment threadpackages/flutter/lib/src/widgets/_html_element_view_io.dart Outdated
Comment threadpackages/flutter/lib/src/widgets/platform_view.dart
Comment threadpackages/flutter/lib/src/widgets/_html_element_view_io.dart
@mdebbarmdebbar changed the title [web] New HtmlElementView.domElement constructor[web] New HtmlElementView.fromTagName constructorJul 25, 2023
ditman

This comment was marked as outdated.

auto-submitBot pushed a commit to flutter-team-archive/engine that referenced this pull request Jul 26, 2023
Convenient default factories for creating DOM element from a given tag name.
Required by flutter/flutter#130513
Part of flutter/flutter#127030

@ditmanditman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I still like this after the latest changes. LGTM!

@mdebbarmdebbar added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 7, 2023
@auto-submit
auto-submitBot merged commit 55fe41b into flutter:masterAug 7, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 8, 2023
auto-submitBot pushed a commit to flutter/packages that referenced this pull request Aug 8, 2023
flutter/flutter@ad0aa8d...436df69
2023-08-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from 9c83d90b01bd to 146c4c9487fc (6 revisions) (flutter/flutter#132112)
2023-08-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from c27109291e22 to 9c83d90b01bd (5 revisions) (flutter/flutter#132108)
2023-08-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from be085f6699b6 to c27109291e22 (3 revisions) (flutter/flutter#132086)
2023-08-08 jesus_sguerrero@hotmail.com Revert "Replace TextField.canRequestFocus with TextField.focusNode.canRequestFocus" (flutter/flutter#132104)
2023-08-08 jonahwilliams@google.com [Impeller] add drawVertices and drawAtlas benchmarks. (flutter/flutter#132080)
2023-08-07 47866232+chunhtai@users.noreply.github.com Adds more documentations around ignoreSemantics deprecations. (flutter/flutter#131287)
2023-08-07 mdebbar@google.com [web] New HtmlElementView.fromTagName constructor (flutter/flutter#130513)
2023-08-07 katelovett@google.com Move mock canvas to flutter_test (flutter/flutter#131631)
2023-08-07 matej.knopp@gmail.com Add static_path_tessellation macrobenchmark (flutter/flutter#131837)
2023-08-07 mdebbar@google.com [web] Remove usage of `ui.webOnlyInitializePlatform()` (flutter/flutter#131344)
2023-08-07 engine-flutter-autoroll@skia.org Roll Flutter Engine from 39a575f65d50 to be085f6699b6 (1 revision) (flutter/flutter#132069)
2023-08-07 jmccandless@google.com Android context menu theming and visual update (flutter/flutter#131816)
2023-08-07 engine-flutter-autoroll@skia.org Roll Flutter Engine from 39ce1c097bce to 39a575f65d50 (2 revisions) (flutter/flutter#132064)
2023-08-07 xhzq233@qq.com CupertinoContextMenu improvement (flutter/flutter#131030)
2023-08-07 engine-flutter-autoroll@skia.org Roll Flutter Engine from 5b47c0577060 to 39ce1c097bce (3 revisions) (flutter/flutter#132057)
2023-08-07 xming@google.com Slider should check `mounted` before start interaction (flutter/flutter#132010)
2023-08-07 engine-flutter-autoroll@skia.org Roll Packages from ce53da1 to d7ee75a (7 revisions) (flutter/flutter#132058)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC rmistry@google.com,stuartmorgan@google.com,tarrinneal@google.com on the revert to ensure that a human
is aware of the problem.
To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose
To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
@mdebbar
mdebbar deleted the built_in_factory branch August 9, 2023 18:29
gaaclarke pushed a commit to gaaclarke/engine that referenced this pull request Aug 30, 2023
…r-team-archive#43828)
Convenient default factories for creating DOM element from a given tag name.
Required by flutter/flutter#130513
Part of flutter/flutter#127030
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 15, 2023
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
flutter/flutter@ad0aa8d...436df69
2023-08-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from 9c83d90b01bd to 146c4c9487fc (6 revisions) (flutter/flutter#132112)
2023-08-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from c27109291e22 to 9c83d90b01bd (5 revisions) (flutter/flutter#132108)
2023-08-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from be085f6699b6 to c27109291e22 (3 revisions) (flutter/flutter#132086)
2023-08-08 jesus_sguerrero@hotmail.com Revert "Replace TextField.canRequestFocus with TextField.focusNode.canRequestFocus" (flutter/flutter#132104)
2023-08-08 jonahwilliams@google.com [Impeller] add drawVertices and drawAtlas benchmarks. (flutter/flutter#132080)
2023-08-07 47866232+chunhtai@users.noreply.github.com Adds more documentations around ignoreSemantics deprecations. (flutter/flutter#131287)
2023-08-07 mdebbar@google.com [web] New HtmlElementView.fromTagName constructor (flutter/flutter#130513)
2023-08-07 katelovett@google.com Move mock canvas to flutter_test (flutter/flutter#131631)
2023-08-07 matej.knopp@gmail.com Add static_path_tessellation macrobenchmark (flutter/flutter#131837)
2023-08-07 mdebbar@google.com [web] Remove usage of `ui.webOnlyInitializePlatform()` (flutter/flutter#131344)
2023-08-07 engine-flutter-autoroll@skia.org Roll Flutter Engine from 39a575f65d50 to be085f6699b6 (1 revision) (flutter/flutter#132069)
2023-08-07 jmccandless@google.com Android context menu theming and visual update (flutter/flutter#131816)
2023-08-07 engine-flutter-autoroll@skia.org Roll Flutter Engine from 39ce1c097bce to 39a575f65d50 (2 revisions) (flutter/flutter#132064)
2023-08-07 xhzq233@qq.com CupertinoContextMenu improvement (flutter/flutter#131030)
2023-08-07 engine-flutter-autoroll@skia.org Roll Flutter Engine from 5b47c0577060 to 39ce1c097bce (3 revisions) (flutter/flutter#132057)
2023-08-07 xming@google.com Slider should check `mounted` before start interaction (flutter/flutter#132010)
2023-08-07 engine-flutter-autoroll@skia.org Roll Packages from ce53da1 to d7ee75a (7 revisions) (flutter/flutter#132058)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC rmistry@google.com,stuartmorgan@google.com,tarrinneal@google.com on the revert to ensure that a human
is aware of the problem.
To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose
To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
flutter/flutter@ad0aa8d...436df69
2023-08-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from 9c83d90b01bd to 146c4c9487fc (6 revisions) (flutter/flutter#132112)
2023-08-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from c27109291e22 to 9c83d90b01bd (5 revisions) (flutter/flutter#132108)
2023-08-08 engine-flutter-autoroll@skia.org Roll Flutter Engine from be085f6699b6 to c27109291e22 (3 revisions) (flutter/flutter#132086)
2023-08-08 jesus_sguerrero@hotmail.com Revert "Replace TextField.canRequestFocus with TextField.focusNode.canRequestFocus" (flutter/flutter#132104)
2023-08-08 jonahwilliams@google.com [Impeller] add drawVertices and drawAtlas benchmarks. (flutter/flutter#132080)
2023-08-07 47866232+chunhtai@users.noreply.github.com Adds more documentations around ignoreSemantics deprecations. (flutter/flutter#131287)
2023-08-07 mdebbar@google.com [web] New HtmlElementView.fromTagName constructor (flutter/flutter#130513)
2023-08-07 katelovett@google.com Move mock canvas to flutter_test (flutter/flutter#131631)
2023-08-07 matej.knopp@gmail.com Add static_path_tessellation macrobenchmark (flutter/flutter#131837)
2023-08-07 mdebbar@google.com [web] Remove usage of `ui.webOnlyInitializePlatform()` (flutter/flutter#131344)
2023-08-07 engine-flutter-autoroll@skia.org Roll Flutter Engine from 39a575f65d50 to be085f6699b6 (1 revision) (flutter/flutter#132069)
2023-08-07 jmccandless@google.com Android context menu theming and visual update (flutter/flutter#131816)
2023-08-07 engine-flutter-autoroll@skia.org Roll Flutter Engine from 39ce1c097bce to 39a575f65d50 (2 revisions) (flutter/flutter#132064)
2023-08-07 xhzq233@qq.com CupertinoContextMenu improvement (flutter/flutter#131030)
2023-08-07 engine-flutter-autoroll@skia.org Roll Flutter Engine from 5b47c0577060 to 39ce1c097bce (3 revisions) (flutter/flutter#132057)
2023-08-07 xming@google.com Slider should check `mounted` before start interaction (flutter/flutter#132010)
2023-08-07 engine-flutter-autoroll@skia.org Roll Packages from 747c466 to be5db8f (7 revisions) (flutter/flutter#132058)
If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC rmistry@google.com,stuartmorgan@google.com,tarrinneal@google.com on the revert to ensure that a human
is aware of the problem.
To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose
To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug
Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmitMerge PR when tree becomes green via auto submit Appframeworkflutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[web] HtmlElementView improvements

2 participants

@mdebbar@ditman