#D) [9,41 687.5x16]
+ PaintableWithLines (BlockContainer(anonymous)) [9,57 687.5x0]
diff --git a/Tests/LibWeb/Layout/input/block-and-inline/inline-float-clear.html b/Tests/LibWeb/Layout/input/block-and-inline/inline-float-clear.html
new file mode 100644
index 0000000000..eeb49553ff
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/block-and-inline/inline-float-clear.html
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp
index 2fcc4153d7..b4c25743ec 100644
--- a/Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/InlineFormattingContext.cpp
@@ -314,9 +314,11 @@ void InlineFormattingContext::generate_line_boxes()
case InlineLevelIterator::Item::Type::FloatingElement:
if (is
(*item.node)) {
- auto introduce_clearance = parent().clear_floating_boxes(*item.node, *this);
- if (introduce_clearance == BlockFormattingContext::DidIntroduceClearance::Yes)
- parent().reset_margin_state();
+ [[maybe_unused]] auto introduce_clearance = parent().clear_floating_boxes(*item.node, *this);
+ // Even if this introduces clearance, we do NOT reset
+ // the margin state, because that is clearance between
+ // floats and does not contribute to the height of the
+ // Inline Formatting Context.
parent().layout_floating_box(static_cast(*item.node), containing_block(), *m_available_space, 0, &line_builder);
}
break;