mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-13 10:26:37 +02:00
BlockFormattingContext::greatest_child_width() tried to decide whether a line overlapped a float by comparing a line-relative baseline against float edges stored in containing-block coordinates. That also used `||`, so later lines could keep inheriting float width even after the float had ended. Measure overlap using each line box's top and bottom edges in the same coordinate space as the float margins instead. This fixes shrink-to-fit and max-content sizing for inline children after short floats. Add left and right tests where a later forced-break line is longer than the line next to the float.
21 lines
316 B
HTML
21 lines
316 B
HTML
<!DOCTYPE html>
|
|
<style>
|
|
body {
|
|
font: 16px/20px monospace;
|
|
margin: 0;
|
|
}
|
|
|
|
.outer {
|
|
border: 1px solid black;
|
|
float: left;
|
|
}
|
|
|
|
.inner-float {
|
|
background: red;
|
|
float: left;
|
|
height: 20px;
|
|
width: 100px;
|
|
}
|
|
</style>
|
|
<div class="outer"><div class="inner-float"></div>x<br>abcdefghijklmnop</div>
|