Text wrapping with text-wrap: balance + float
Categories
(Core :: Layout: Text and Fonts, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox126 | --- | fixed |
People
(Reporter: leeroyjenkins176, Assigned: jfkthame)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0
Steps to reproduce:
<div class="float"></div>
<h1>Lorem, ipsum dolor <span>sit</span> amet consectetur adipisicing elit.</h1>
<style>
.float {
float: left;
width: 200px;
height: 200px;
background: #000;
}
h1 {
text-wrap: balance;
font-size: 16px;
}
</style>
Actual results:
When the container width is slightly less than the width of the .float block plus the text line, everything including the span will be wrapped below the float block.
Expected results:
Text should float around the block as long as there is enough space for it.
Assignee | ||
Comment 1•10 months ago
|
||
My results don't quite match the screenshot (exact behavior probably depends on the font involved, which affects the text measurement), but with this version I'm seeing the behavior break down once the block becomes narrow enough that the text wraps onto more than 4 lines: https://codepen.io/jfkthame/pen/jORaJrm. So definitely some edge condition isn't being handled well.
Reporter | ||
Comment 2•10 months ago
|
||
I made a video with your example (the width should be larger to reproduce the bug)
https://drive.google.com/file/d/1qdmjpxv0TGfwYVim_N11gTJ0oyAtTlT2/view?usp=drive_link
Assignee | ||
Comment 3•10 months ago
|
||
Updated•10 months ago
|
Assignee | ||
Comment 4•10 months ago
|
||
Comment 7•10 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/4fc2448de79b
https://hg.mozilla.org/mozilla-central/rev/a5f6bf060190
Description
•