Skip to content

[web] Changes to WebParagraph configuration#187188

Merged
auto-submit[bot] merged 18 commits into
flutter:masterfrom
mdebbar:webparagraph_flag
Jun 15, 2026
Merged

[web] Changes to WebParagraph configuration#187188
auto-submit[bot] merged 18 commits into
flutter:masterfrom
mdebbar:webparagraph_flag

Conversation

@mdebbar

@mdebbar mdebbar commented May 27, 2026

Copy link
Copy Markdown
Contributor

Changes:

  • Drop experimental from the path and config flags.
  • Reason: Other experimental modes don't use the word "experimental" (e.g. skwasm_heavy, wimp), and I don't want it to be a breaking change to graduate out of the "experimental" phase.

  • Instead of having WebParagraph be a third CK variant, make it a global enableWebParagraph flag.
  • Reason: In the future, we will support Skwasm and Wimp, so it doesn't make sense to limit the flag to CanvasKit.

  • Feature-detect Chrome's Text Cluster API and fallback to another CK variant if it's not supported.
  • Reason: To allow for a smoother adoption path. Without this, all users will have to do their own feature detection to adopt WebParagraph.

  • Throw a clear message when Dart code is in WebParagraph mode but the downloaded CK variant doesn't support WebParagraph.
  • Reason: I was bit by this multiple times. It shouldn't happen anymore, but if it does, I want the error message to be clear instead of some random failure.

Fixes #186215
Part of #172561

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label May 27, 2026
@flutter-dashboard

Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions Bot added engine flutter/engine related. See also e: labels. platform-web Web applications specifically labels May 27, 2026

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

Copy link
Copy Markdown
Contributor

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 transitions the WebParagraph implementation from a standalone CanvasKit variant to a feature flag (enableWebParagraph) built on top of the Chromium variant, renaming references from "experimentalWebParagraph" to "webparagraph" across configuration, build, and loader files. It also introduces browser feature detection for the TextCluster API. A critical issue was identified in canvaskit_loader.js where browserEnvironment.hasTextCluster is referenced as a property instead of being invoked as a function, which would bypass the feature detection check and cause runtime crashes.

Comment thread engine/src/flutter/lib/web_ui/flutter_js/src/canvaskit_loader.js Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@github-actions github-actions Bot removed the CICD Run CI/CD label May 27, 2026
@mdebbar mdebbar added the CICD Run CI/CD label May 27, 2026
@mdebbar mdebbar added CICD Run CI/CD and removed CICD Run CI/CD labels May 28, 2026
@mdebbar mdebbar added CICD Run CI/CD and removed CICD Run CI/CD labels May 28, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label May 29, 2026
@mdebbar mdebbar added the CICD Run CI/CD label May 29, 2026
@kevmoo

kevmoo commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Could we add fixes https://github.com/flutter/flutter/issues/186215 to this PR comment? (if it does)

@mdebbar mdebbar requested a review from harryterkelsen June 3, 2026 15:43

@harryterkelsen harryterkelsen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have a comment about what we do when we fall back to a non-WebParagraph build

Comment thread engine/src/flutter/lib/web_ui/lib/src/engine/canvaskit/renderer.dart Outdated
@github-actions github-actions Bot added team-web Owned by Web platform team CICD Run CI/CD and removed CICD Run CI/CD labels Jun 4, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 4, 2026
@mdebbar mdebbar added the CICD Run CI/CD label Jun 4, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 5, 2026
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 5, 2026

@harryterkelsen harryterkelsen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@mdebbar mdebbar removed the CICD Run CI/CD label Jun 10, 2026
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 10, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 15, 2026
@mdebbar mdebbar added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels Jun 15, 2026

@harryterkelsen harryterkelsen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@auto-submit auto-submit Bot added this pull request to the merge queue Jun 15, 2026
Merged via the queue into flutter:master with commit c28687d Jun 15, 2026
204 of 205 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 15, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Jun 16, 2026
flutter/flutter@5827d5f...3a0420c

2026-06-16 Rusino@users.noreply.github.com Implement font fallback (flutter/flutter#187520)
2026-06-16 amhurtado@protonmail.com Add FlatBuffers Verifier checks to Impeller asset loading (flutter/flutter#187878)
2026-06-16 engine-flutter-autoroll@skia.org Roll Packages from aa964a3 to 8286d39 (1 revision) (flutter/flutter#188067)
2026-06-16 engine-flutter-autoroll@skia.org Roll Skia from 9c2b83788409 to d7196b0b4939 (1 revision) (flutter/flutter#188066)
2026-06-16 engine-flutter-autoroll@skia.org Roll Skia from ef17057bb776 to 9c2b83788409 (1 revision) (flutter/flutter#188061)
2026-06-16 engine-flutter-autoroll@skia.org Roll Skia from 500025456bb5 to ef17057bb776 (1 revision) (flutter/flutter#188058)
2026-06-16 engine-flutter-autoroll@skia.org Roll Skia from cb1035ff14bf to 500025456bb5 (5 revisions) (flutter/flutter#188057)
2026-06-16 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from TbB86Po_HDe1dvXvT... to VeLhhlDcod09NR4Hb... (flutter/flutter#188055)
2026-06-16 engine-flutter-autoroll@skia.org Roll Skia from 70acf6a5e7c9 to cb1035ff14bf (3 revisions) (flutter/flutter#188054)
2026-06-16 41930132+hellohuanlin@users.noreply.github.com [pv]skip non-tappable web view workaround on ios 26.4 (flutter/flutter#185424)
2026-06-16 mdebbar@google.com [web] RenderParagraph needs paint after a DPR change (flutter/flutter#186968)
2026-06-16 30870216+gaaclarke@users.noreply.github.com Adds gamma correction to windows text. (flutter/flutter#187871)
2026-06-15 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Add a platform view test to android_hardware_smoke_test (#187913)" (flutter/flutter#188051)
2026-06-15 awolff@google.com Add a platform view test to android_hardware_smoke_test (flutter/flutter#187913)
2026-06-15 codefu@google.com feat: linux_analyze in a workflow (flutter/flutter#187889)
2026-06-15 mdebbar@google.com [web] Changes to WebParagraph configuration (flutter/flutter#187188)
2026-06-15 matt.boetger@gmail.com Fail gracefully on Android AVD lock errors during startup (flutter/flutter#187200)
2026-06-15 bkonyi@google.com [flutter_tools] Fix flakiness in widget_preview_detection_test (flutter/flutter#187938)
2026-06-15 jason-simmons@users.noreply.github.com Exclude fuchsia-sdk/sdk/.build-id from the builder cache archive (flutter/flutter#187826)
2026-06-15 engine-flutter-autoroll@skia.org Roll Skia from c8d9f80f13e4 to 70acf6a5e7c9 (4 revisions) (flutter/flutter#188020)
2026-06-15 engine-flutter-autoroll@skia.org Roll Packages from b78ad83 to aa964a3 (7 revisions) (flutter/flutter#188021)

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 bmparr@google.com,stuartmorgan@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://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
@mdebbar mdebbar deleted the webparagraph_flag branch June 16, 2026 18:22
via-guy pushed a commit to via-guy/flutter that referenced this pull request Jun 26, 2026
Changes:

- Drop `experimental` from the path and config flags.
- **Reason**: Other experimental modes don't use the word "experimental"
(e.g. skwasm_heavy, wimp), and I don't want it to be a breaking change
to graduate out of the "experimental" phase.
<hr>

- Instead of having WebParagraph be a third CK variant, make it a global
`enableWebParagraph` flag.
- **Reason**: In the future, we will support Skwasm and Wimp, so it
doesn't make sense to limit the flag to CanvasKit.
<hr>

- Feature-detect Chrome's Text Cluster API and fallback to another CK
variant if it's not supported.
- **Reason**: To allow for a smoother adoption path. Without this, all
users will have to do their own feature detection to adopt WebParagraph.
<hr>

- Throw a clear message when Dart code is in WebParagraph mode but the
downloaded CK variant doesn't support WebParagraph.
- **Reason**: I was bit by this multiple times. It shouldn't happen
anymore, but if it does, I want the error message to be clear instead of
some random failure.

<hr>

Fixes flutter#186215
Part of flutter#172561

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD engine flutter/engine related. See also e: labels. platform-web Web applications specifically team-web Owned by Web platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[web] Add feature detection for WebParagraph

3 participants