From 9a69b9112bcc1f6a497b6c3506d5a044b45b04b4 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Tue, 4 May 2021 10:14:58 -0400 Subject: LibWeb: Compute intrinsic height of absolute replaced elements Previously, the method for computing the height of absolutely positioned replaced elements only invoked the method for non-replaced elements. That method is now implemented fully enough that it sometimes computed a height of 0 for replaced elements. This implements section 10.6.5 rule 1 of the CSS spec to avoid that behavior. --- Userland/Libraries/LibWeb/Layout/FormattingContext.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Userland') diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp index 9595141599..e701e0d692 100644 --- a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp @@ -619,8 +619,9 @@ void FormattingContext::layout_absolutely_positioned_element(Box& box) void FormattingContext::compute_height_for_absolutely_positioned_replaced_element(ReplacedBox& box) { - // FIXME: Implement this. - return compute_height_for_absolutely_positioned_non_replaced_element(box); + // 10.6.5 Absolutely positioned, replaced elements + // The used value of 'height' is determined as for inline replaced elements. + box.set_height(compute_height_for_replaced_element(box)); } } -- cgit v1.2.3