From 80cffdc0a12a58d6382a6bc3ce80b8effc1e5c91 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 6 Jan 2021 19:16:40 +0100 Subject: [PATCH] LibWeb: Compute width of absolutely positioned, replaced elements Fixes #4589. --- Libraries/LibWeb/Layout/FormattingContext.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Libraries/LibWeb/Layout/FormattingContext.cpp b/Libraries/LibWeb/Layout/FormattingContext.cpp index 635491da02..e0a802e002 100644 --- a/Libraries/LibWeb/Layout/FormattingContext.cpp +++ b/Libraries/LibWeb/Layout/FormattingContext.cpp @@ -437,8 +437,10 @@ void FormattingContext::compute_width_for_absolutely_positioned_non_replaced_ele void FormattingContext::compute_width_for_absolutely_positioned_replaced_element(ReplacedBox& box) { - // FIXME: Implement this. - return compute_width_for_absolutely_positioned_non_replaced_element(box); + // 10.3.8 Absolutely positioned, replaced elements + // The used value of 'width' is determined as for inline replaced elements. + box.prepare_for_replaced_layout(); + box.set_width(compute_width_for_replaced_element(box)); } void FormattingContext::compute_height_for_absolutely_positioned_non_replaced_element(Box& box)