Closed Bug 2041658 Opened 6 months ago Closed 6 months ago

[wpt-sync] Sync PR 60100 - text-fit: Ignore fragmentation when measuring scaling factor

Categories

(Core :: Layout: Text and Fonts, task, P4)

task

Tracking

()

RESOLVED FIXED
153 Branch
Tracking Status
firefox153 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 60100 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/60100
Details from upstream follow.

Kent Tamura <tkent@chromium.org> wrote:

text-fit: Ignore fragmentation when measuring scaling factor

When "text-fit: [shrink|grow] consistent" is used inside a
block-fragmented container (e.g., multicolumn), the measurement pass
used to calculate the scaling factor should ignore fragmentation.

Previously, the measurement layout (cloned_algorithm) inherited the
fragmentation context, which could lead to incorrect scaling factors
because it only accounted for content within the current fragment rather
than the entire block.

This patch updates BlockLayoutAlgorithm to:

  • Create a ConstraintSpace without fragmentation for the measurement
    pass.
  • Ensure fragmentation-specific inputs (break tokens, early breaks, and
    spanner paths) are cleared in the cloned layout parameters.

This ensures the scaling factor is calculated based on the full content
height/width before any fragmentation occurs.

Bug: 417306102, 515046056
Change-Id: Ie532ee1c7816781aecd05b7a0e34681d66b09399
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7867041
Reviewed-by: Morten Stenshorne \<mstensho@chromium.org>
Commit-Queue: Kent Tamura \<tkent@chromium.org>
Auto-Submit: Kent Tamura \<tkent@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1634732}

Component: web-platform-tests → Layout: Text and Fonts
Product: Testing → Core

CI Results

Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 24 tests

Status Summary

Firefox

OK : 4
PASS: 1[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 3[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 5[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL: 1[GitHub] 7[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 24[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]

Chrome

FAIL: 1

Safari

FAIL: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Status: NEW → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 153 Branch
You need to log in before you can comment on or make changes to this bug.