diff options
author | Andreas Kling <kling@serenityos.org> | 2023-05-02 06:51:32 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-05-02 11:47:13 +0200 |
commit | 00e3e82bbd5a01878331caa55ae9fd90a4839cb0 (patch) | |
tree | 630c3eee6c31d413550dd32c52a950280ba788be /Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp | |
parent | deea7cbc117ba8debe1c54dee1ec3d334b240756 (diff) | |
download | serenity-00e3e82bbd5a01878331caa55ae9fd90a4839cb0.zip |
LibWeb: Account for box-sizing:border-box in layout-less definite sizes
When we determine that a size is definite because it can be resolved now
without performing layout, we also need to account for the box-sizing
property.
This lets us remove a hack from flex layout where box-sizing:border-box
was manually undone at one point in the layout algorithm.
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp index db62b6c526..32ef24b418 100644 --- a/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FlexFormattingContext.cpp @@ -1088,15 +1088,7 @@ void FlexFormattingContext::determine_hypothetical_cross_size_of_item(FlexItem& return; } - auto cross_size = [&]() { - if (item.box->computed_values().box_sizing() == CSS::BoxSizing::BorderBox && !should_treat_cross_size_as_auto(item.box)) { - return max(CSSPixels(0.0f), inner_cross_size(item.box) - item.padding.cross_before - item.padding.cross_after - item.borders.cross_before - item.borders.cross_after); - } - - return inner_cross_size(item.box); - }(); - - item.hypothetical_cross_size = css_clamp(cross_size, clamp_min, clamp_max); + item.hypothetical_cross_size = css_clamp(inner_cross_size(item.box), clamp_min, clamp_max); return; } |