1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:08:10 +00:00

LibWeb: Implement CSS Resolution class

This corresponds to `<resolution>` in the grammar.
This commit is contained in:
Sam Atkins 2022-02-21 17:51:01 +00:00 committed by Andreas Kling
parent bd79c303f6
commit 0465abcfec
7 changed files with 160 additions and 0 deletions

View file

@ -4306,6 +4306,10 @@ Optional<CalculatedStyleValue::CalcValue> Parser::parse_calc_value(TokenStream<S
return CalculatedStyleValue::CalcValue { dimension.length() };
if (dimension.is_percentage())
return CalculatedStyleValue::CalcValue { dimension.percentage() };
if (dimension.is_resolution()) {
// Resolution is not allowed in calc()
return {};
}
VERIFY_NOT_REACHED();
}