1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:47:34 +00:00

LibWeb: Sum horizontal margins to calculate space used by floats

This fixes the issue where max margin is used to find offset of
floating box although horizonal margins do not collapse so they need
to be summed instead.
This commit is contained in:
Aliaksandr Kalenik 2023-05-24 18:16:09 +03:00 committed by Andreas Kling
parent 90d8844c77
commit 202b24584f
5 changed files with 83 additions and 49 deletions

View file

@ -0,0 +1,20 @@
<style>
body {
width: 200px;
margin-left: 100px;
}
.row {
height: 200px;
margin-left: -50px;
background-color: blueviolet;
}
.item {
float: left;
width: 50%;
}
</style><div class="row"><div class="item" style="background-color: lightblue">
a</div>
<div class="item" style="background-color: lightgoldenrodyellow">
b</div>
</div>