Closed Bug 2042078 Opened 6 months ago Closed 6 months ago

[wpt-sync] Sync PR 60141 - text-fit: Use LineInfo::TextFitScale for consistent line height scaling

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 60141 into mozilla-central (this bug is closed when the sync is complete).

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

Kent Tamura <tkent@chromium.org> wrote:

text-fit: Use LineInfo::TextFitScale for consistent line height scaling

FindTextScale() determined scaling factors by scanning text items. This
approach failed for blank lines, causing inconsistent line heights when
using text-fit: [grow|shrink] consistent.

This patch improves scaling consistency by:

  1. Updating LineFitter to calculate and store the final scaling factor
    (including paint-time scaling and min/max limits) in LineInfo.

  2. Modifying OnBeginPlaceItems() to use LineInfo::TextFitScale() as the
    source of truth during item placement, replacing the unreliable
    FindTextScale() logic.

  3. Ensuring should_scale_line_height is always set when applying
    paragraph-level scaling in InlineLayoutAlgorithm, so that blank
    lines are scaled correctly.

Bug: 417306102
Change-Id: Iac05dcd64a746199910b7066a99fa5eaae883141
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7867096
Reviewed-by: Koji Ishii \<kojii@chromium.org>
Commit-Queue: Koji Ishii \<kojii@chromium.org>
Auto-Submit: Kent Tamura \<tkent@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1635615}

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 25 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] 25[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.