mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
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:
parent
cd5570670c
commit
f470657d57
Notes:
sideshowbarker
2024-07-19 02:43:14 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f470657d576
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user