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
commit 0465abcfec
Notes: sideshowbarker 2024-07-17 18:20:07 +09:00
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();
}