diff --git a/Libraries/LibWeb/CSS/Parser/ValueParsing.cpp b/Libraries/LibWeb/CSS/Parser/ValueParsing.cpp index 70b34cddac5..7329804a605 100644 --- a/Libraries/LibWeb/CSS/Parser/ValueParsing.cpp +++ b/Libraries/LibWeb/CSS/Parser/ValueParsing.cpp @@ -4847,6 +4847,8 @@ RefPtr Parser::parse_value(ValueType value_type, TokenStream Parser::parse_value(ValueType value_type, TokenStream Parser::parse_value(ValueType value_type, TokenStream value_type_from_string(StringView string) return ValueType::AnchorSize; if (string.equals_ignoring_ascii_case("angle"sv)) return ValueType::Angle; + if (string.equals_ignoring_ascii_case("angle-percentage"sv)) + return ValueType::AnglePercentage; if (string.equals_ignoring_ascii_case("background-position"sv)) return ValueType::BackgroundPosition; if (string.equals_ignoring_ascii_case("basic-shape"sv)) @@ -35,12 +37,16 @@ Optional value_type_from_string(StringView string) return ValueType::Flex; if (string.equals_ignoring_ascii_case("frequency"sv)) return ValueType::Frequency; + if (string.equals_ignoring_ascii_case("frequency-percentage"sv)) + return ValueType::FrequencyPercentage; if (string.equals_ignoring_ascii_case("image"sv)) return ValueType::Image; if (string.equals_ignoring_ascii_case("integer"sv)) return ValueType::Integer; if (string.equals_ignoring_ascii_case("length"sv)) return ValueType::Length; + if (string.equals_ignoring_ascii_case("length-percentage"sv)) + return ValueType::LengthPercentage; if (string.equals_ignoring_ascii_case("number"sv)) return ValueType::Number; if (string.equals_ignoring_ascii_case("opacity"sv)) @@ -63,6 +69,8 @@ Optional value_type_from_string(StringView string) return ValueType::String; if (string.equals_ignoring_ascii_case("time"sv)) return ValueType::Time; + if (string.equals_ignoring_ascii_case("time-percentage"sv)) + return ValueType::TimePercentage; if (string.equals_ignoring_ascii_case("transform-function"sv)) return ValueType::TransformFunction; if (string.equals_ignoring_ascii_case("transform-list"sv)) @@ -81,6 +89,8 @@ StringView value_type_to_string(ValueType value_type) return "AnchorSize"sv; case Web::CSS::ValueType::Angle: return "Angle"sv; + case Web::CSS::ValueType::AnglePercentage: + return "AnglePercentage"sv; case Web::CSS::ValueType::BackgroundPosition: return "BackgroundPosition"sv; case Web::CSS::ValueType::BasicShape: @@ -103,12 +113,16 @@ StringView value_type_to_string(ValueType value_type) return "Flex"sv; case Web::CSS::ValueType::Frequency: return "Frequency"sv; + case Web::CSS::ValueType::FrequencyPercentage: + return "FrequencyPercentage"sv; case Web::CSS::ValueType::Image: return "Image"sv; case Web::CSS::ValueType::Integer: return "Integer"sv; case Web::CSS::ValueType::Length: return "Length"sv; + case Web::CSS::ValueType::LengthPercentage: + return "LengthPercentage"sv; case Web::CSS::ValueType::Number: return "Number"sv; case Web::CSS::ValueType::Opacity: @@ -131,6 +145,8 @@ StringView value_type_to_string(ValueType value_type) return "String"sv; case Web::CSS::ValueType::Time: return "Time"sv; + case Web::CSS::ValueType::TimePercentage: + return "TimePercentage"sv; case Web::CSS::ValueType::TransformFunction: return "TransformFunction"sv; case Web::CSS::ValueType::TransformList: diff --git a/Libraries/LibWeb/CSS/ValueType.h b/Libraries/LibWeb/CSS/ValueType.h index 44f86b43af5..1487531e8d6 100644 --- a/Libraries/LibWeb/CSS/ValueType.h +++ b/Libraries/LibWeb/CSS/ValueType.h @@ -16,6 +16,7 @@ enum class ValueType : u8 { Anchor, AnchorSize, Angle, + AnglePercentage, BackgroundPosition, BasicShape, Color, @@ -27,9 +28,11 @@ enum class ValueType : u8 { FitContent, Flex, Frequency, + FrequencyPercentage, Image, Integer, Length, + LengthPercentage, Number, Opacity, OpentypeTag, @@ -41,6 +44,7 @@ enum class ValueType : u8 { Resolution, String, Time, + TimePercentage, TransformFunction, TransformList, Url, diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-properties-values-api/register-property-syntax-parsing.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-properties-values-api/register-property-syntax-parsing.txt index 747edcfe9be..befecf4950f 100644 --- a/Tests/LibWeb/Text/expected/wpt-import/css/css-properties-values-api/register-property-syntax-parsing.txt +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-properties-values-api/register-property-syntax-parsing.txt @@ -2,8 +2,8 @@ Harness status: OK Found 239 tests -189 Pass -50 Fail +191 Pass +48 Fail Pass syntax:'*', initialValue:'a' is valid Pass syntax:' * ', initialValue:'b' is valid Pass syntax:'', initialValue:'2px' is valid @@ -32,8 +32,8 @@ Pass syntax:'', initialValue:'calc(7in - 12px)' is valid Pass syntax:'+', initialValue:'2px 7px calc(8px)' is valid Fail syntax:'#', initialValue:'2px, 7px, calc(8px)' is valid Pass syntax:'', initialValue:'-9.3e3%' is valid -Fail syntax:'', initialValue:'-54%' is valid -Fail syntax:'', initialValue:'0' is valid +Pass syntax:'', initialValue:'-54%' is valid +Pass syntax:'', initialValue:'0' is valid Fail syntax:'', initialValue:'calc(-11px + 10.4%)' is valid Pass syntax:'', initialValue:'10vmin' is valid Pass syntax:' | +', initialValue:'calc(100vh - 10px) 30px' is valid