mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 09:52:31 +00:00
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.
23 lines
306 B
HTML
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>
|