Skip to content

[web] Fix failure on Firefox 148#182855

Merged
auto-submit[bot] merged 2 commits intoflutter:masterfrom
mdebbar:fix_firefox
Feb 25, 2026
Merged

[web] Fix failure on Firefox 148#182855
auto-submit[bot] merged 2 commits intoflutter:masterfrom
mdebbar:fix_firefox

Conversation

@mdebbar
Copy link
Contributor

@mdebbar mdebbar commented Feb 24, 2026

Prior to 148, Firefox didn't have support for TrustedTypes, so it made sense to always run the non-TrustedTypes test on Firefox.

With 148, Firefox added support for TrustedTypes, but we are still running the non-TrustedTypes tests on Firefox.

Solution: instead of skipping tests based on browser name, let's detect at runtime if the browser supports TrustedTypes or not.

Example failure: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8688958443747938497/+/u/test:_run_suite_firefox-dart2js-canvaskit-canvaskit/stdout

@github-actions github-actions bot added engine flutter/engine related. See also e: labels. platform-web Web applications specifically labels Feb 24, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly fixes a test failure on Firefox 148 by updating the condition for skipping Trusted Types-related tests. Instead of relying on browser engine detection (isBlink), the code now directly checks for the presence of the trustedTypes API on the domWindow object. This is a more robust and future-proof approach. My review includes a minor suggestion to refactor the repeated API check to improve code readability and maintainability, in line with the repository's style guide.

Comment on lines +45 to +51
}, skip: domWindow.trustedTypes == null);

group('Trusted Types API NOT supported', () {
test('createTrustedScriptUrl - returns unmodified url', () async {
expect(createTrustedScriptUrl(badUrl), badUrl);
});
}, skip: isBlink);
}, skip: domWindow.trustedTypes != null);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To improve readability and avoid duplicating the check for Trusted Types support, consider extracting domWindow.trustedTypes != null into a local variable at the start of the testMainWithTTOn function. This variable can then be reused for both test groups.

Example:

void testMainWithTTOn() {
  // ...
  final bool hasTrustedTypes = domWindow.trustedTypes != null;

  group('TrustedTypes API supported', /* ... */, skip: !hasTrustedTypes);

  group('Trusted Types API NOT supported', /* ... */, skip: hasTrustedTypes);
}
References
  1. Code should be optimized for readability, as it is read more often than it is written. (link)
  2. Avoid duplicating state to maintain a single source of truth. (link)

@mdebbar mdebbar added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 24, 2026
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Feb 24, 2026
@auto-submit
Copy link
Contributor

auto-submit bot commented Feb 24, 2026

autosubmit label was removed for flutter/flutter/182855, because - The status or check suite Linux linux_unopt has failed. Please fix the issues identified (or deflake) before re-applying this label.

@mdebbar mdebbar added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 25, 2026
@auto-submit auto-submit bot added this pull request to the merge queue Feb 25, 2026
Merged via the queue into flutter:master with commit b31548f Feb 25, 2026
182 of 183 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Feb 25, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 25, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 25, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 25, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 26, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 26, 2026
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Feb 26, 2026
Roll Flutter from dad6f9d4107a to b31548feb941 (39 revisions)

flutter/flutter@dad6f9d...b31548f

2026-02-25 [email protected] [web] Fix failure on Firefox 148 (flutter/flutter#182855)
2026-02-25 [email protected] Roll Fuchsia Linux SDK from KfPgw04T0OEADLJA5... to XI0Ax7fbtYE4XKYAQ... (flutter/flutter#182887)
2026-02-25 [email protected] Use AnimationStyle curve and reverseCurve in ModalBottomSheet animation (flutter/flutter#181403)
2026-02-25 [email protected] Roll Dart SDK from fd3dce5b6a4e to 5c57e75f1102 (9 revisions) (flutter/flutter#182801)
2026-02-25 98614782+auto-submit[bot]@users.noreply.github.com Reverts "refactor: remove material in context_menu_controller_test, icon_test, list_wheel_scroll_view_test, media_query_test, platform_menu_bar_test (#182697)" (flutter/flutter#182879)
2026-02-25 [email protected] Make sure that an AnimatedSlide doesn't crash in 0x0 environment (flutter/flutter#181535)
2026-02-24 [email protected] Reland Standardize on Test* widgets in *_tester.dart files (flutter/flutter#182632)
2026-02-24 [email protected] docs(Path): clarify that zero-length contours are excluded from computeMetrics (flutter/flutter#180165)
2026-02-24 [email protected] Fix typo in assert message (flutter/flutter#182843)
2026-02-24 [email protected] [win32] Fix overflow in TaskRunnerWindow. (flutter/flutter#182822)
2026-02-24 [email protected] feat: Add --no-uninstall flag to flutter test for integration tests (flutter/flutter#182714)
2026-02-24 [email protected] Rename noFrequencyBasedMinification to useFrequencyBasedMinification (flutter/flutter#182684)
2026-02-24 [email protected] [Impeller] Fix fail to render pixel buffer texture on Linux (flutter/flutter#181656)
2026-02-24 [email protected] Remove FlutterFramework app migration (flutter/flutter#182100)
2026-02-24 [email protected] Roll Packages from 12b43a1 to 062c8d4 (5 revisions) (flutter/flutter#182839)
2026-02-24 [email protected] [web] Run webparagraph tests in CI (flutter/flutter#182092)
2026-02-24 [email protected] Fix a race in EmbedderTest.CanSpecifyCustomUITaskRunner (flutter/flutter#182649)
2026-02-24 [email protected] flutter_tools: Use a super-parameter in several missed cases (flutter/flutter#182581)
2026-02-24 [email protected] Replace more references to `flutter/engine` with `flutter/flutter` (flutter/flutter#182654)
2026-02-24 [email protected] Carousel: Migration from Scrollable+Viewport to CustomScrollView (flutter/flutter#182475)
2026-02-24 [email protected] Refactor impellerc_main to better organize some of its logic (flutter/flutter#182783)
2026-02-24 [email protected] Remove unused `getPluginList ` (flutter/flutter#182660)
2026-02-24 [email protected] Refactor: Remove material from ticker provider test (flutter/flutter#181697)
2026-02-24 [email protected] Roll Skia from 26eebffe12bd to f44d7db68805 (3 revisions) (flutter/flutter#182821)
2026-02-24 [email protected] refactor: remove material in context_menu_controller_test, icon_test, list_wheel_scroll_view_test, media_query_test, platform_menu_bar_test (flutter/flutter#182697)
2026-02-24 [email protected] Roll Skia from 7dad66aae75a to 26eebffe12bd (5 revisions) (flutter/flutter#182810)
2026-02-24 [email protected] Update roadmap for 2026 (flutter/flutter#182798)
2026-02-24 [email protected] Marks Windows tool_tests_commands_1_2 to be unflaky (flutter/flutter#179670)
2026-02-23 [email protected] [web] scroll iOS iframe text input into view (flutter/flutter#179759)
2026-02-23 [email protected] Fix textscaler clamp assertion error (flutter/flutter#181716)
2026-02-23 [email protected] Roll Skia from 9a5a3c92c336 to 7dad66aae75a (4 revisions) (flutter/flutter#182779)
2026-02-23 [email protected] Move more getters from userMessages class to the appropriate places (flutter/flutter#182656)
2026-02-23 [email protected] Manual roll Dart SDK from f8fac50475b8 to fd3dce5b6a4e (6 revisions) (flutter/flutter#182768)
2026-02-23 [email protected] Copy Flutter framework to Add to App FlutterPluginRgistrant (flutter/flutter#182523)
2026-02-23 [email protected] Add progress indicator to artifact downloads (flutter/flutter#181808)
2026-02-23 [email protected] Clarify batch release mode requirements (flutter/flutter#182228)
2026-02-23 [email protected] [web] Remove --disable-gpu from flutter chrome tests (flutter/flutter#182618)
2026-02-23 [email protected] running-apps: update running-apps to use Duration.ago() (flutter/flutter#182172)
2026-02-23 [email protected] Refactor bin/ shell scripts for better performance and safety (flutter/flutter#182674)

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] on the revert to ensure that a human
is aware of the problem.

...
@mdebbar mdebbar added cp: beta cherry pick this pull request to beta release candidate branch cp: stable cherry pick this pull request to stable release candidate branch labels Feb 27, 2026
flutteractionsbot pushed a commit to flutteractionsbot/flutter that referenced this pull request Feb 27, 2026
Prior to 148, Firefox didn't have support for `TrustedTypes`, so it made
sense to always run the non-TrustedTypes test on Firefox.

With 148, Firefox [added
support](https://www.firefox.com/en-US/firefox/148.0/releasenotes/) for
TrustedTypes, but we are still running the non-TrustedTypes tests on
Firefox.

Solution: instead of skipping tests based on browser name, let's detect
at runtime if the browser supports TrustedTypes or not.

Example failure:
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8688958443747938497/+/u/test:_run_suite_firefox-dart2js-canvaskit-canvaskit/stdout
flutteractionsbot pushed a commit to flutteractionsbot/flutter that referenced this pull request Feb 27, 2026
Prior to 148, Firefox didn't have support for `TrustedTypes`, so it made
sense to always run the non-TrustedTypes test on Firefox.

With 148, Firefox [added
support](https://www.firefox.com/en-US/firefox/148.0/releasenotes/) for
TrustedTypes, but we are still running the non-TrustedTypes tests on
Firefox.

Solution: instead of skipping tests based on browser name, let's detect
at runtime if the browser supports TrustedTypes or not.

Example failure:
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8688958443747938497/+/u/test:_run_suite_firefox-dart2js-canvaskit-canvaskit/stdout
ahmedsameha1 pushed a commit to ahmedsameha1/flutter that referenced this pull request Feb 27, 2026
Prior to 148, Firefox didn't have support for `TrustedTypes`, so it made
sense to always run the non-TrustedTypes test on Firefox.

With 148, Firefox [added
support](https://www.firefox.com/en-US/firefox/148.0/releasenotes/) for
TrustedTypes, but we are still running the non-TrustedTypes tests on
Firefox.

Solution: instead of skipping tests based on browser name, let's detect
at runtime if the browser supports TrustedTypes or not.

Example failure:
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8688958443747938497/+/u/test:_run_suite_firefox-dart2js-canvaskit-canvaskit/stdout
@mdebbar mdebbar deleted the fix_firefox branch February 27, 2026 16:01
github-merge-queue bot pushed a commit that referenced this pull request Mar 11, 2026
Examples of previous tree closures caused by Firefox auto-updates:
- #172713
- #182855
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cp: beta cherry pick this pull request to beta release candidate branch cp: stable cherry pick this pull request to stable release candidate branch engine flutter/engine related. See also e: labels. platform-web Web applications specifically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants