ladybird/Tests/LibWeb/Layout/input/block-and-inline/float-with-negative-margin-containing-block.html
Jelle Raaijmakers ab3e9799d5 LibWeb: Allow negative margins to influence inline offset after float
In 89ba00304c, the box' X position was
capped at 0 to prevent negative X positions to act as if there were
intruding floats on the left side. Instead, we need to check whether the
left side float intrusion we are going to calculate matters at all -
because if there's no matching float box, the intrusion is always going
to be 0 and we don't need to take the box' X position into account.

Fixes the floating publication images on https://lexfridman.com/.
2025-07-28 12:11:56 +02:00

15 lines
272 B
HTML

<!DOCTYPE html>
<html>
<style>
#a {
margin-left: -100px;
}
#b {
background-color: red;
float: left;
height: 200px;
width: 200px;
}
</style>
<!-- The text should be positioned to the right of the red square -->
<div id="a"><div id="b"></div>foo bar baz