Skip to content

[web] Accept the capped letter spacing line shift in kitchensink - #196148

Merged
auto-submit[bot] merged 3 commits into
flutter:masterfrom
Rusino:canvaskit-letter-spacing-shift
Nov 10, 2026
Merged

auto-submit[bot] merged 3 commits into
flutter:masterfrom
Rusino:canvaskit-letter-spacing-shift

Conversation

@Rusino

@Rusino Rusino commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

The SkParagraph kitchensink test in canvaskit_api_test.dart pins
LineMetrics.left to 2.5. Its line starts with letterSpacing 5 and ends
with an unspaced "!", and Skia shifted the whole line right by half the
first spacing, so the "!" ended 2.5 px past the line width. A Skia change
for #184815 caps the shift by
the half spacing of the visually last cluster, which is 0 here, and it
broke the Skia roll (#196144).

Accept both 2.5 and 0 so the Skia change can reland. A follow-up after
the roll expects 0 only.

Assisted-by: Claude Opus 5.5 (Medium)

The SkParagraph kitchensink test in canvaskit_api_test.dart pins
LineMetrics.left to 2.5. Its line starts with letterSpacing 5 and ends
with an unspaced "!", and Skia shifted the whole line right by half the
first spacing, so the "!" ended 2.5 px past the line width. A Skia change
for flutter#184815 caps the shift by
the half spacing of the visually last cluster, which is 0 here, and it
broke the Skia roll (flutter#196144).

Accept both 2.5 and 0 so the Skia change can reland. A follow-up after
the roll expects 0 only.

Assisted-by: Claude Opus 5.5 (Medium)
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Nov 7, 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 updates a CanvasKit API test assertion for lineMetrics.left to accept either a value within 0.025 of 2.5 or exactly 0.0, accommodating an upcoming Skia change. The review feedback suggests using a tolerance matcher instead of comparing the floating-point value exactly to 0.0 to avoid potential test flakiness across different browsers or architectures.

@github-actions github-actions Bot added engine flutter/engine related. See also e: labels. platform-web Web applications specifically team-web Owned by Web platform team labels Nov 7, 2026
@Rusino Rusino self-assigned this Nov 7, 2026
@Rusino
Rusino requested a review from mdebbar November 7, 2026 22:12
mdebbar
mdebbar previously approved these changes Nov 9, 2026
Assisted-by: Gemini 4 Carbon (High)
@Rusino
Rusino requested a review from mdebbar November 9, 2026 20:51
@Rusino Rusino added CICD Run CI/CD and removed CICD Run CI/CD labels Nov 10, 2026
@mdebbar mdebbar added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 10, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Nov 10, 2026
Merged via the queue into flutter:master with commit 7ce4746 Nov 10, 2026
26 of 28 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 10, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Nov 10, 2026
flutter/flutter@d463821...fffd8c2

2026-11-10 [email protected] Roll Fuchsia Test Scripts from 8QcsP_SmbsT09VgUs... to PXc5D7S_q6sIYpfFJ... (flutter/flutter#196273)
2026-11-10 [email protected] [web] Accept the capped letter spacing line shift in kitchensink (flutter/flutter#196148)
2026-11-10 [email protected] Fix Vulkan MSAA diagonal seam in FramebufferBlend (flutter/flutter#196197)
2026-11-10 [email protected] Read back images on the raster thread on OpenGLES (flutter/flutter#195927)
2026-11-10 [email protected] [web] Unify ui.Paint across CanvasKit and Skwasm (flutter/flutter#196071)
2026-11-10 [email protected] Roll Fuchsia Test Scripts from p3N3B-Kchh1bthB6n... to 8QcsP_SmbsT09VgUs... (flutter/flutter#196249)
2026-11-09 [email protected] [Impeller] Reland clipped BackdropFilter square corners fix (flutter/flutter#195716)
2026-11-09 [email protected] [web] Recreate canvas and context on CkOffscreenSurface resize to fix WebGL clipping (flutter/flutter#192769)
2026-11-09 [email protected] Roll Dart SDK from ee0f66fa0ad2 to a2baae273bb2 (1 revision) (flutter/flutter#196245)
2026-11-09 [email protected] Add Mac web_tool_tests_1_2 and _2_2 in bringup (flutter/flutter#196241)
2026-11-09 [email protected] Roll pub packages (flutter/flutter#196246)
2026-11-09 [email protected] Increase number of 'Windows tool_integration_tests' subshards (flutter/flutter#196243)
2026-11-09 [email protected] Roll Fuchsia Test Scripts from Jo-ZgQSNDuPsjlZ4s... to p3N3B-Kchh1bthB6n... (flutter/flutter#196238)
2026-11-09 [email protected] Skip UIScene pre-migration test cases on Xcode 27 (flutter/flutter#194755)
2026-11-09 [email protected] [flutter_tools] Share Analytics.isBot and make isRunningOnBot sync (flutter/flutter#194744)
2026-11-09 [email protected] [flutter_tools] Retry chromedriver startup when its port is taken (flutter/flutter#196150)
2026-11-09 [email protected] Remove unused vulkan_provider.cc (flutter/flutter#195513)
2026-11-09 [email protected] Roll Dart SDK from 3b174b7217fe to ee0f66fa0ad2 (13 revisions) (flutter/flutter#196217)
2026-11-09 [email protected] Goma is dead, long live RBE! (Take 2) (flutter/flutter#196212)
2026-11-09 [email protected] Split DevTools customer tests into its own customer_testing_devtools shard (flutter/flutter#195871)
2026-11-09 [email protected] Split mac_host_{debug,profile,release}_arm64_tests into one step per type (flutter/flutter#196031)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode 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.

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
hubot pushed a commit to google/skia that referenced this pull request Nov 10, 2026
This is a reland of commit 9628428

The original change broke the Flutter roll: the SkParagraph kitchensink
test in the web engine CanvasKit suite pinned LineMetrics.left to 2.5 on
a line that starts with letter spacing 5 and ends with an unspaced "!",
where the capped shift is 0. That test now accepts both values
(flutter/flutter#196148). The code is the same
as in the original change.

Original change's description:
> [skparagraph] Cap letter spacing line shift
>
> TextLine shifts the whole line right by half the letter spacing of its
> first cluster, so glyphs look centered in their spaced cells as Flutter
> expects. Cluster widths keep the whole spacing after the glyph, and line
> widths do not count the shift. When a line starts with letter spaced
> text and ends with plain text, negative spacing, or a cursive script
> (which gets no spacing), the last glyphs and their boxes end up to half
> the spacing past the line width. Flutter clips text at the max intrinsic
> width when maxLines is reached, so the last characters disappear.
>
> Now the shift is at most the half spacing of the visually rightmost
> text cluster of the line, and never negative. Glyphs of right to left
> runs are laid out left to right as well, each with its spacing on the
> right, so for such a run that cluster is its logical start. Lines with
> the same spacing at both visual ends keep the old shift, so uniform
> letter spacing and right to left lines that start letter spaced do not
> change. Trailing placeholders keep the shift, as the inline placeholder
> tests expect.
>
> Bug: flutter/flutter#184815
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1418376
> Reviewed-by: Florin Malita <[email protected]>

Without the fix, SkParagraph_LetterSpacingStaysInsideLineWidth fails 16
asserts, e.g. glyphs end at 348.80 while the max intrinsic width is
333.80.

Tested:
- Skia dm unit tests, SkParagraph (Linux x86_64, Debug and Release, Clang
  22.1.0, FreeType + Fontconfig + HarfBuzz, ICU, extra_fonts): 235/235 pass
  in both builds (234/234 before, plus the new test).
- Flutter engine text tests (Linux x86_64 host_debug_unopt, ICU), Flutter
  7ce4746c92ea with this change vs the parent Skia: 2413/2413 pass on both
  sides (103 txt/ui C++ unit tests, 2310 Dart framework and engine tests).
- Flutter web CanvasKit suite (chrome-dart2js-canvaskit-canvaskit, wasm
  release rebuilt with each Skia): 362 passed, 1 skipped, 0 failed on both
  sides, including the SkParagraph kitchensink test.
- google3 SkParagraph clients (1151 test targets): no regressions (one
  golden test is flaky with and without this change).
- Flutter txt_benchmarks (Linux x86_64, 20 interleaved rounds on one
  core): ShortLayout, LongLayout, JustifyLayout and TextBigO/1024 are
  within 2% of the parent Skia.
- Skia trybots pass:
  Test-Ubuntu24.04-Clang-GCE-CPU-AVX2-x86_64-Debug-All-NativeFonts_FreeType_ASAN_Upload
  Test-Mac14-Clang-MacMini8.1-CPU-AVX2-x86_64-Debug-All-NativeFonts_Fontations
Not tested: Windows, Android, iOS.

Bug: flutter/flutter#184815
Assisted-by: Claude Opus 5.5 (Medium)
Change-Id: Id0e890c4aeaa64f0ed54554ae0cca341987a4d35
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1422517
Commit-Queue: Julia Lavrova <[email protected]>
Reviewed-by: Florin Malita <[email protected]>
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.

2 participants