ladybird/Tests/LibWeb/Layout/input/block-and-inline/float-following-trailing-whitespace.html
Jelle Raaijmakers 002e79a658 LibWeb: Exclude trailing whitespace from line width when placing floats
When generating line boxes, we place floats simultaneously with the
other items on the same line. The CSS text spec requires us to trim the
whitespace at the end of each line, but we only did so after laying out
all the line boxes.

This changes the way we calculate the current line box width for floats
by subtracting the amount of pixels that the current trailing whitespace
is using.

Fixes #4050.
2025-03-26 19:35:38 +00:00

21 lines
372 B
HTML

<!DOCTYPE html>
<style>
.a {
background-color: red;
width: 100px;
}
.b {
background-color: green;
display: inline-block;
width: 50px;
}
.c {
background-color: blue;
float: right;
width: 50px;
}
</style>
<div class="a">
<div class="b">foo</div>
<div class="c">bar</div>
</div>