-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[web] Don't crash on const HtmlElementView()
#128965
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
Conversation
ditman
left a comment
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, minor comment about skipping the new test when kIsWeb.
| // This file runs on non-web platforms, so we expect `HtmlElementView` to | ||
| // fail. |
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.
Instead of this, why not skip: kIsWeb on the test? That way we know for sure this is a non-web test only?
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.
The entire file is not supposed to run on web (it has @TestOn('!chrome')). I bet all tests will fail, including the new one, if we accidentally run this file on web.
The comment is just to clarify for anyone who jumps directly to this test without looking at the entire file.
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.
Ah, if there's a @TestOn('!chrome'), ship it (!browser would be better, though, this test would attempt to run in firefox if I'm understanding this right)
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.
Oh interesting. Yeah we definitely need to fix that. I'll create an issue so we don't forget.
flutter/flutter@b0188cd...fc8856e 2023-06-16 [email protected] [web] Don't crash on `const HtmlElementView()` (flutter/flutter#128965) 2023-06-16 [email protected] Roll Packages from 0507297 to f9314a3 (3 revisions) (flutter/flutter#128878) 2023-06-16 [email protected] Update getProperties to handle Diagnosticable as input. (flutter/flutter#128897) 2023-06-15 [email protected] Roll Flutter Engine from 48e0b4e66422 to fb5fed432e59 (1 revision) (flutter/flutter#128967) 2023-06-15 [email protected] Fix dart pub cache clean command on pub.dart (flutter/flutter#128171) 2023-06-15 [email protected] [flutter_tools] Migrate more integration tests to process result matcher (flutter/flutter#128737) 2023-06-15 [email protected] [flutter_tools] refactor license collector (flutter/flutter#128748) 2023-06-15 [email protected] Set Semantics.button to true for date widget (flutter/flutter#128824) 2023-06-15 [email protected] Update golden tests (flutter/flutter#128914) 2023-06-15 [email protected] Roll Flutter Engine from 9934c0de738c to 48e0b4e66422 (26 revisions) (flutter/flutter#128959) 2023-06-15 [email protected] flutter update-packages --cherry-pick-package (flutter/flutter#128917) 2023-06-15 [email protected] add .pub-cache back to .gitignore (flutter/flutter#128894) 2023-06-15 [email protected] Roll Flutter Engine from 2d8d5ecfe4a8 to 9934c0de738c (2 revisions) (flutter/flutter#128849) 2023-06-15 [email protected] flutter update-packages --force-upgrade (flutter/flutter#128908) 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 [email protected],[email protected],[email protected] 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
Previously, when the code contained
const HtmlElementView()it would break even if it's guarded byif (kIsWeb).This PR makes it such that
const HtmlElementView()is allowed but it still throws if it gets inserted into the widget tree by mistake on non-web platforms.One improvement we can make in the future is to have a conditional import:
_html_element_view_web.dartthat contains the realHtmlElementViewthat can only be instantiated on web._html_element_view_io.dartthat contains a stub with an unimplementedbuild()method.Fixes #43532