From 7230b7aad7f47925d3b82dc8151662356b3a4e49 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 22 Jul 2020 01:46:35 +0200 Subject: [PATCH] LibWeb: Replaced elements had backwards application of intrinsic ratio If we know the width, but not the height, we have to *divide* with the intrinsic ratio to get the height (not multiply.) :^) This makes things like work right. --- Libraries/LibWeb/Layout/LayoutReplaced.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibWeb/Layout/LayoutReplaced.cpp b/Libraries/LibWeb/Layout/LayoutReplaced.cpp index 7fccb6e8e4..f671546dbb 100644 --- a/Libraries/LibWeb/Layout/LayoutReplaced.cpp +++ b/Libraries/LibWeb/Layout/LayoutReplaced.cpp @@ -108,7 +108,7 @@ float LayoutReplaced::calculate_height() const if (specified_width.is_auto() && specified_height.is_auto() && has_intrinsic_height()) used_height = intrinsic_height(); else if (specified_height.is_auto() && has_intrinsic_ratio()) - used_height = calculate_width() * intrinsic_ratio(); + used_height = calculate_width() / intrinsic_ratio(); else if (specified_height.is_auto() && has_intrinsic_height()) used_height = intrinsic_height(); else if (specified_height.is_auto())