Skip to content
Permalink
Browse files
Layout issue on IMDB page for Robbie Coltrane
https://bugs.webkit.org/show_bug.cgi?id=247293
<rdar://101193884>

Reviewed by Simon Fraser.

Floating boxes overlap with their margin boxes.

* LayoutTests/fast/block/float/float-with-margin-bottom-incorrect-expected.html: Added.
* LayoutTests/fast/block/float/float-with-margin-bottom-incorrect.html: Added.
* Source/WebCore/layout/floats/FloatingState.h:
(WebCore::Layout::FloatingState::FloatItem::bottom const):

Canonical link: https://commits.webkit.org/256183@main
  • Loading branch information
alanbaradlay committed Nov 1, 2022
1 parent 7e44837 commit 76cfbdc3f398cc47439da0794977f83e52ca210b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
@@ -0,0 +1,15 @@
<style>
div {
width: 300px;
height: 50px;
background-color: blue;
}
.right {
position: absolute;
top: 8px;
left: 458px;
width: 50px;
height: 200px;
}
</style>
<div style="margin-bottom: 100px;"></div><div></div><div class=right></div>
@@ -0,0 +1,27 @@
<style>
.container {
width: 500px;
font-family: Ahem;
font-size: 20px;
color: transparent;
}
.float_right {
float: right;
background-color: blue;
width: 50px;
height: 200px;
}

.float_left {
float: left;
width: 300px;
height: 50px;
background-color: blue;
}
</style>
<div class=container>
<div class=float_right></div>
<div style="margin-bottom: 100px;" class=float_left></div>
<div class=float_left></div>
XXXX
</div>
@@ -64,7 +64,7 @@ class FloatingState : public RefCounted<FloatingState> {

Rect rectWithMargin() const { return BoxGeometry::marginBoxRect(m_absoluteBoxGeometry); }
BoxGeometry::HorizontalMargin horizontalMargin() const { return m_absoluteBoxGeometry.horizontalMargin(); }
PositionInContextRoot bottom() const { return { BoxGeometry::borderBoxRect(m_absoluteBoxGeometry).bottom() }; }
PositionInContextRoot bottom() const { return { rectWithMargin().bottom() }; }

#if ASSERT_ENABLED
const Box* floatBox() const { return m_layoutBox.get(); }

0 comments on commit 76cfbdc

Please sign in to comment.