1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:57:43 +00:00

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 <img width=300 src=image.png> work right.
This commit is contained in:
Andreas Kling 2020-07-22 01:46:35 +02:00
parent f43590f534
commit 7230b7aad7

View file

@ -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())