1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:27:35 +00:00

LibWeb: Support min-content for width, min-width and max-width

We're gonna need to handle this in many more places, this patch only
adds it to calculate_inner_width().
This commit is contained in:
Andreas Kling 2023-05-28 18:24:55 +02:00
parent 97c510329c
commit af004ff0ef
4 changed files with 62 additions and 1 deletions

View file

@ -1339,6 +1339,7 @@
"valid-identifiers": [
"fit-content",
"max-content",
"min-content",
"none"
],
"quirks": [
@ -1376,6 +1377,7 @@
"auto",
"fit-content",
"max-content",
"min-content",
"none"
],
"quirks": [
@ -1776,7 +1778,8 @@
"valid-identifiers": [
"auto",
"fit-content",
"max-content"
"max-content",
"min-content"
],
"quirks": [
"unitless-length"

View file

@ -1352,6 +1352,9 @@ CSS::Length FormattingContext::calculate_inner_width(Layout::Box const& box, Ava
if (width.is_max_content()) {
return CSS::Length::make_px(calculate_max_content_width(box));
}
if (width.is_min_content()) {
return CSS::Length::make_px(calculate_min_content_width(box));
}
auto& computed_values = box.computed_values();
if (computed_values.box_sizing() == CSS::BoxSizing::BorderBox) {