LibWeb: Add pc CSS unit

This commit is contained in:
Luke 2020-10-05 16:18:07 +01:00 committed by Andreas Kling
parent aa71dae03c
commit 043b31ad9a
Notes: sideshowbarker 2024-07-19 02:02:02 +09:00
3 changed files with 16 additions and 5 deletions

View file

@ -284,6 +284,9 @@ static CSS::Length parse_length(const CSS::ParsingContext& context, const String
} else if (view.ends_with("pt", CaseSensitivity::CaseInsensitive)) {
type = CSS::Length::Type::Pt;
value = try_parse_float(view.substring_view(0, view.length() - 2));
} else if (view.ends_with("pc", CaseSensitivity::CaseInsensitive)) {
type = CSS::Length::Type::Pc;
value = try_parse_float(view.substring_view(0, view.length() - 2));
} else if (view.ends_with("mm", CaseSensitivity::CaseInsensitive)) {
type = CSS::Length::Type::Mm;
value = try_parse_float(view.substring_view(0, view.length() - 2));