1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:17:35 +00:00

LibWeb: Account for negative margins when calculating float intrusion

If a box has a negative margin-left, it may have a negative effective
offset within its parent BFC root coordinate system.

We can account for this when calculating the amount of left-side float
intrusion by flooring the X offset at 0.
This commit is contained in:
Andreas Kling 2023-06-04 12:55:55 +02:00
parent 0e5ec8c0ab
commit 89ba00304c
4 changed files with 28 additions and 2 deletions

View file

@ -0,0 +1,15 @@
<!doctype html><style>
* { border: 1px solid black; }
html { background: white; }
body {
position: relative;
left: 100px;
background: pink;
width: 300px;
}
div {
margin-left: -50px;
background: orange;
width: 200px;
}
</style><body><div>there are no floats intruding on this div