overflow-wrap may interfere with text-wrap:balance reflow
Categories
(Core :: Layout: Text and Fonts, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox124 | --- | fixed |
People
(Reporter: jfkthame, Assigned: jfkthame)
References
Details
Attachments
(1 file)
From bug 1872929 comment 8:
Chrome and Safari Technical Preview balance correctly with overflow-wrap: break-word or anywhere. However, in Firefox Nightly 124.0a1 (2024-02-05) and the same overflow styles, text-wrap: balance has no effect on page load. I noticed that it does appear to work after resizing the browser horizontally after each load. It occurs when resizing wider and narrower - sounds like triggered by a reflow?
Here's a new reproduction Codepen with the container expanded to test for balancing of the second word: https://codepen.io/evelynhathaway/pen/jOJKvMX
Here's a comparison between Chrome, Firefox Dev 123.0b2 (original bug where letters are orphaned), and Firefox Nightly 124.0a1 (new related bug, before resizing)
https://bugzilla.mozilla.org/attachment.cgi?id=9378439
So the patch landed in bug 1872929 prevents us using overflow-wrap breaks during balancing, as intended, but in this example it looks like the presence of overflow-wrap is also interfering with the initial reflow of the block, which should be able to "balance" even without breaking within words.
| Assignee | ||
Comment 1•1 year ago
|
||
Oh, I see... we're hitting an edge-case when the last line of the "initial" reflow of the text -- before any attempt to balance -- contains just a single word ("build" in the example here). So if we change "build" to "bu ld" in the example, the problem no longer occurs.
It looks like what happens is that during the initial reflow of that last line, we incorrectly think overflow-wrap got used (because we didn't find an inter-word break position), and that suppresses balancing.
| Assignee | ||
Comment 2•1 year ago
|
||
Updated•1 year ago
|
Comment 5•1 year ago
|
||
Backed out changeset 07c6057bdf29 (bug 1878865) for causing lint failure at text-wrap-balance-overflow-002-ref.html
Backout: https://hg.mozilla.org/integration/autoland/rev/c77ece737455b3997085f8bde73fcebf26f080bc
Failure log: https://treeherder.mozilla.org/logviewer?job_id=446206152&repo=autoland&lineNumber=59
| Assignee | ||
Updated•1 year ago
|
Description
•