mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Parse CSS fit-content(<length-percentage>) values
Before this change, we only parsed fit-content as a standalone keyword, but CSS-SIZING-3 added it as a function as well. I don't know of anything else in CSS that is overloaded like this, so it ends up looking a little awkward in the implementation. Note that a lot of code had already been prepped for fit-content values to have an argument, we just weren't parsing it.
This commit is contained in:
parent
6fc19ec059
commit
8ab61843be
Notes:
github-actions[bot]
2025-02-26 23:45:14 +00:00
Author: https://github.com/awesomekling
Commit: 8ab61843be
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3706
Reviewed-by: https://github.com/AtkinsSJ
25 changed files with 185 additions and 67 deletions
|
@ -30,6 +30,7 @@ static bool type_name_is_enum(StringView type_name)
|
|||
"custom-ident"sv,
|
||||
"easing-function"sv,
|
||||
"flex"sv,
|
||||
"fit-content"sv,
|
||||
"frequency"sv,
|
||||
"image"sv,
|
||||
"integer"sv,
|
||||
|
@ -230,6 +231,7 @@ enum class ValueType {
|
|||
CustomIdent,
|
||||
EasingFunction,
|
||||
FilterValueList,
|
||||
FitContent,
|
||||
Flex,
|
||||
Frequency,
|
||||
Image,
|
||||
|
@ -801,6 +803,8 @@ bool property_accepts_type(PropertyID property_id, ValueType value_type)
|
|||
property_generator.appendln(" case ValueType::CustomIdent:");
|
||||
} else if (type_name == "easing-function") {
|
||||
property_generator.appendln(" case ValueType::EasingFunction:");
|
||||
} else if (type_name == "fit-content") {
|
||||
property_generator.appendln(" case ValueType::FitContent:");
|
||||
} else if (type_name == "flex") {
|
||||
property_generator.appendln(" case ValueType::Flex:");
|
||||
} else if (type_name == "frequency") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue