mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:17:45 +00:00
LibWeb: Fix shrink-to-fit layout for position:absolute
We were following the spec incorrectly. The comment was right, but the code was wrong.
This commit is contained in:
parent
a5422a210f
commit
2a5877b02c
1 changed files with 1 additions and 1 deletions
|
@ -356,9 +356,9 @@ void BlockFormattingContext::compute_width_for_absolutely_positioned_block(Box&
|
||||||
else if (width.is_auto() && right.is_auto() && !left.is_auto()) {
|
else if (width.is_auto() && right.is_auto() && !left.is_auto()) {
|
||||||
Rule3:
|
Rule3:
|
||||||
auto result = calculate_shrink_to_fit_widths(box);
|
auto result = calculate_shrink_to_fit_widths(box);
|
||||||
right = solve_for_right();
|
|
||||||
auto available_width = solve_for_width();
|
auto available_width = solve_for_width();
|
||||||
width = CSS::Length(min(max(result.preferred_minimum_width, available_width.to_px(box)), result.preferred_width), CSS::Length::Type::Px);
|
width = CSS::Length(min(max(result.preferred_minimum_width, available_width.to_px(box)), result.preferred_width), CSS::Length::Type::Px);
|
||||||
|
right = solve_for_right();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. 'left' is 'auto', 'width' and 'right' are not 'auto', then solve for 'left'
|
// 4. 'left' is 'auto', 'width' and 'right' are not 'auto', then solve for 'left'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue