diff --git a/Tests/LibWeb/Layout/expected/block-and-inline/abspos-with-percentage-height-resolved-against-padding-box-of-containing-block.txt b/Tests/LibWeb/Layout/expected/block-and-inline/abspos-with-percentage-height-resolved-against-padding-box-of-containing-block.txt
new file mode 100644
index 0000000000..ca6919072c
--- /dev/null
+++ b/Tests/LibWeb/Layout/expected/block-and-inline/abspos-with-percentage-height-resolved-against-padding-box-of-containing-block.txt
@@ -0,0 +1,4 @@
+Viewport <#document> at (0,0) content-size 800x600 children: not-inline
+ BlockContainer at (0,0) content-size 800x256 [BFC] children: not-inline
+ BlockContainer
at (8,248) content-size 784x0 positioned children: not-inline
+ BlockContainer at (8,8) content-size 784x240 positioned [BFC] children: not-inline
diff --git a/Tests/LibWeb/Layout/input/block-and-inline/abspos-with-percentage-height-resolved-against-padding-box-of-containing-block.html b/Tests/LibWeb/Layout/input/block-and-inline/abspos-with-percentage-height-resolved-against-padding-box-of-containing-block.html
new file mode 100644
index 0000000000..6ae632143d
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/block-and-inline/abspos-with-percentage-height-resolved-against-padding-box-of-containing-block.html
@@ -0,0 +1,14 @@
+
\ No newline at end of file
diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp
index 45efa15fd9..b78238d22d 100644
--- a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp
@@ -1390,9 +1390,9 @@ CSS::Length FormattingContext::calculate_inner_width(Layout::Box const& box, Ava
return width.resolved(box, width_of_containing_block_as_length_for_resolve);
}
-CSS::Length FormattingContext::calculate_inner_height(Layout::Box const& box, AvailableSize const&, CSS::Size const& height) const
+CSS::Length FormattingContext::calculate_inner_height(Layout::Box const& box, AvailableSize const& available_height, CSS::Size const& height) const
{
- auto height_of_containing_block = m_state.get(*box.non_anonymous_containing_block()).content_height();
+ auto height_of_containing_block = available_height.to_px();
auto height_of_containing_block_as_length_for_resolve = CSS::Length::make_px(height_of_containing_block);
if (height.is_auto()) {
return height.resolved(box, height_of_containing_block_as_length_for_resolve);