summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-12-17 01:47:42 +0100
committerAndreas Kling <kling@serenityos.org>2020-12-17 01:47:42 +0100
commit2a5877b02ce39744180188bc159acb046f93750e (patch)
tree5f43407ec8eb08f5726257793c1cf5e31160c7fa /Libraries/LibWeb
parenta5422a210f27f48a8a086ee12969c510c416f8fa (diff)
downloadserenity-2a5877b02ce39744180188bc159acb046f93750e.zip
LibWeb: Fix shrink-to-fit layout for position:absolute
We were following the spec incorrectly. The comment was right, but the code was wrong.
Diffstat (limited to 'Libraries/LibWeb')
-rw-r--r--Libraries/LibWeb/Layout/BlockFormattingContext.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibWeb/Layout/BlockFormattingContext.cpp b/Libraries/LibWeb/Layout/BlockFormattingContext.cpp
index d97f4c93e1..03eac50701 100644
--- a/Libraries/LibWeb/Layout/BlockFormattingContext.cpp
+++ b/Libraries/LibWeb/Layout/BlockFormattingContext.cpp
@@ -356,9 +356,9 @@ void BlockFormattingContext::compute_width_for_absolutely_positioned_block(Box&
else if (width.is_auto() && right.is_auto() && !left.is_auto()) {
Rule3:
auto result = calculate_shrink_to_fit_widths(box);
- right = solve_for_right();
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);
+ right = solve_for_right();
}
// 4. 'left' is 'auto', 'width' and 'right' are not 'auto', then solve for 'left'