diff --git a/Tests/LibWeb/Layout/expected/abspos-box-with-replaced-element.txt b/Tests/LibWeb/Layout/expected/abspos-box-with-replaced-element.txt
new file mode 100644
index 0000000000..56daa46912
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/abspos-box-with-replaced-element.txt
@@ -0,0 +1,7 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer at (1,1) content-size 798x0 [BFC] children: not-inline
+ BlockContainer
at (10,10) content-size 500x100 positioned [BFC] children: not-inline
+ BlockContainer at (261,11) content-size 248x28.4836 positioned [BFC] children: inline
+ line 0 width: 250, height: 28.4836, bottom: 28.4836, baseline: 28.4836
+ frag 0 from ImageBox start: 0, length: 0, rect: [262,12 248x26.4836]
+ ImageBox
at (262,12) content-size 248x26.4836 children: not-inline
diff --git a/Tests/LibWeb/Layout/input/abspos-box-with-replaced-element.html b/Tests/LibWeb/Layout/input/abspos-box-with-replaced-element.html
new file mode 100644
index 0000000000..77694c05b9
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/abspos-box-with-replaced-element.html
@@ -0,0 +1,22 @@
+
\ No newline at end of file
diff --git a/Tests/LibWeb/Layout/input/img.webp b/Tests/LibWeb/Layout/input/img.webp
new file mode 100644
index 0000000000..146144e76a
Binary files /dev/null and b/Tests/LibWeb/Layout/input/img.webp differ
diff --git a/Userland/Libraries/LibWeb/Layout/LayoutState.cpp b/Userland/Libraries/LibWeb/Layout/LayoutState.cpp
index dfa8738469..df2f6a24ee 100644
--- a/Userland/Libraries/LibWeb/Layout/LayoutState.cpp
+++ b/Userland/Libraries/LibWeb/Layout/LayoutState.cpp
@@ -215,6 +215,7 @@ void LayoutState::UsedValues::set_node(NodeWithStyleAndBoxModelMetrics& node, Us
// NOTE: The width of a non-flex-item block is considered definite if it's auto and the containing block has definite width.
if (width
&& !node.is_floating()
+ && !node.is_absolutely_positioned()
&& node.display().is_block_outside()
&& node.parent()
&& !node.parent()->is_floating()