mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 10:09:14 +00:00
LibWeb: Parse rgb and hsl functions according to CSS Module Level 4
Implement parsing of rgb(..) and hsl(..) in both the modern level 4 syntax without commas, and the legacy syntax with commas. The parser accepts non-integer numbers but rounds to integer values for now.
This commit is contained in:
parent
83c79fec1c
commit
019e3a342d
Notes:
sideshowbarker
2024-07-17 11:34:34 +09:00
Author: https://github.com/madmoose
Commit: 019e3a342d
Pull-request: https://github.com/SerenityOS/serenity/pull/14230
Reviewed-by: https://github.com/AtkinsSJ ✅
2 changed files with 136 additions and 125 deletions
|
@ -304,6 +304,7 @@ private:
|
|||
Variant<Angle, Frequency, Length, Percentage, Resolution, Time> m_value;
|
||||
};
|
||||
Optional<Dimension> parse_dimension(ComponentValue const&);
|
||||
Optional<Color> parse_rgb_or_hsl_color(StringView function_name, Vector<ComponentValue> const&);
|
||||
Optional<Color> parse_color(ComponentValue const&);
|
||||
Optional<Length> parse_length(ComponentValue const&);
|
||||
Optional<Ratio> parse_ratio(TokenStream<ComponentValue>&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue