LibWeb: Fix layout of replaced with width:auto + no intrinsic ratio

We can't compute width based on the intrinsic ratio if we have no
intrinsic ratio! The comment was correct, the code was not.
This commit is contained in:
Andreas Kling 2020-09-12 18:15:51 +02:00
parent cd5570670c
commit f470657d57
Notes: sideshowbarker 2024-07-19 02:43:14 +09:00

View File

@ -77,7 +77,7 @@ float LayoutReplaced::calculate_width() const
// 'height' has some other computed value, and the element does have an intrinsic ratio; then the used value of 'width' is:
//
// (used height) * (intrinsic ratio)
else if ((specified_height.is_auto() && specified_width.is_auto() && !has_intrinsic_width() && has_intrinsic_height() && has_intrinsic_ratio()) || computed_width.is_auto()) {
else if ((specified_height.is_auto() && specified_width.is_auto() && !has_intrinsic_width() && has_intrinsic_height() && has_intrinsic_ratio()) || (computed_width.is_auto() && has_intrinsic_ratio())) {
used_width = calculate_height() * intrinsic_ratio();
}