Closed Bug 1881855 Opened 3 months ago Closed 3 months ago

text-wrap: balance inconsistent with child elements

Categories

(Core :: Layout: Text and Fonts, defect)

Firefox 123
defect

Tracking

()

RESOLVED FIXED
125 Branch
Tracking Status
firefox125 --- fixed

People

(Reporter: corey, Assigned: jfkthame)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0

Steps to reproduce:

Used text-wrap: balance on a block element that contained a child inline element.

https://codepen.io/coreyworrell/pen/bGZPYjR

Actual results:

Text wrapped at an incorrect location.

Expected results:

Text wrap would behave the same with or without the inline element.

Huh, that's odd. The effect seems to be inconsistent; if I reduce the max-width in your example such that the text wraps onto three lines (e.g. 320px for me, YMMV depending on fonts), both blocks wrap the same. But with two lines, there's an unexpected discrepancy. Thanks for reporting this!

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true

This was just a silly trivial error in the original implementation. We shouldn't apply
the inset value to nested spans within the line, only to the root span.

Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0a0ef18169dc
The 'inset' used during text-wrap:balance reflows should only be applied to the root span of each line. r=layout-reviewers,emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/44957 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 125 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: