.grid) [8,8 100x500] overflow: [8,8 500x500]
+ ImagePaintable (ImageBox
![]()
) [8,8 500x500]
diff --git a/Tests/LibWeb/Layout/input/grid/replaced-item-1.html b/Tests/LibWeb/Layout/input/grid/replaced-item-1.html
new file mode 100644
index 0000000000..986b282d3d
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/grid/replaced-item-1.html
@@ -0,0 +1,10 @@
+
\ No newline at end of file
diff --git a/Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp
index 6ee6105ad1..9003c925d0 100644
--- a/Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/GridFormattingContext.cpp
@@ -8,6 +8,7 @@
#include
#include
#include
+#include
namespace Web::Layout {
@@ -1845,6 +1846,12 @@ void GridFormattingContext::run(Box const& box, LayoutMode, AvailableSpace const
box_state.set_indefinite_content_width();
if (!computed_values.height().is_length())
box_state.set_indefinite_content_height();
+
+ if (item.box->is_replaced_box()) {
+ auto& replaced_box = static_cast(*item.box);
+ // FIXME: This const_cast is gross.
+ const_cast(replaced_box).prepare_for_replaced_layout();
+ }
}
// Do the first pass of resolving grid items box metrics to compute values that are independent of a track width