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•3 months 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•3 months ago
|
||
Updated•3 months ago
|
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/07c6057bdf29 Only record that breakPriority indicated use of overflow-wrap if we actually needed to break the text. r=layout-reviewers,emilio
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/44423 for changes under testing/web-platform/tests
Comment 5•3 months 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
Upstream PR was closed without merging
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ffcccf20cd2f Only record that breakPriority indicated use of overflow-wrap if we actually needed to break the text. r=layout-reviewers,emilio
Assignee | ||
Updated•3 months ago
|
Upstream PR merged by moz-wptsync-bot
Description
•