mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:27:43 +00:00
LibWeb: Add fit-content as a valid size value for CSS width
This commit is contained in:
parent
1dfb065a9c
commit
09eb3ef405
5 changed files with 12 additions and 1 deletions
|
@ -118,6 +118,7 @@
|
|||
"fantasy",
|
||||
"fast",
|
||||
"fine",
|
||||
"fit-content",
|
||||
"fixed",
|
||||
"flex",
|
||||
"flex-end",
|
||||
|
|
|
@ -1663,7 +1663,8 @@
|
|||
"percentage [0,∞]"
|
||||
],
|
||||
"valid-identifiers": [
|
||||
"auto"
|
||||
"auto",
|
||||
"fit-content"
|
||||
],
|
||||
"quirks": [
|
||||
"unitless-length"
|
||||
|
|
|
@ -64,6 +64,12 @@ Size Size::make_fit_content(Length available_space)
|
|||
return Size { Type::FitContent, move(available_space) };
|
||||
}
|
||||
|
||||
Size Size::make_fit_content()
|
||||
{
|
||||
// NOTE: We use "auto" as a stand-in for "stretch" here.
|
||||
return Size { Type::FitContent, Length::make_auto() };
|
||||
}
|
||||
|
||||
Size Size::make_none()
|
||||
{
|
||||
return Size { Type::None, Length::make_auto() };
|
||||
|
|
|
@ -33,6 +33,7 @@ public:
|
|||
static Size make_min_content();
|
||||
static Size make_max_content();
|
||||
static Size make_fit_content(Length available_space);
|
||||
static Size make_fit_content();
|
||||
static Size make_none();
|
||||
|
||||
bool is_auto() const { return m_type == Type::Auto; }
|
||||
|
|
|
@ -72,6 +72,8 @@ CSS::Size StyleProperties::size_value(CSS::PropertyID id) const
|
|||
return CSS::Size::make_min_content();
|
||||
case ValueID::MaxContent:
|
||||
return CSS::Size::make_max_content();
|
||||
case ValueID::FitContent:
|
||||
return CSS::Size::make_fit_content();
|
||||
case ValueID::None:
|
||||
return CSS::Size::make_none();
|
||||
default:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue