ladybird/Tests/LibWeb/Layout/input/block-and-inline/float-inside-margin-auto-container.html
Jelle Raaijmakers 99df80f81e LibWeb: Only apply box offset if the box is not already the ancestor
When determining the content/margin box rects within their ancestor's
coordinate space, we were returning early if the passed in values
already belonged to the requested ancestor. Unfortunately, we had
already applied the used values' offset to the rect, which is the offset
to the ancestor's ancestor.

This simplifies the logic to always apply the rect offset after checking
if we've reached the ancestor. Fixes determining float intrusions inside
block elements with `margin: auto` set.

Fixes #4083.
2025-04-04 15:35:26 +02:00

23 lines
306 B
HTML

<!DOCTYPE html>
<style>
.a {
margin: auto;
overflow: auto;
width: 200px;
}
.b {
height: 150px;
float: left;
width: 150px;
}
.g {
background-color: green;
}
.r {
background-color: red;
}
</style>
<div class="a">
<div class="b g"></div>
<div class="b r"></div>
</div>