LibWeb: Clamp computed value for font-style oblique angle

Values outside [-90deg,90deg] are invalid and should be clamped
This commit is contained in:
Callum Law 2025-09-03 19:30:32 +12:00 committed by Sam Atkins
commit e17d91780d
Notes: github-actions[bot] 2025-09-19 09:07:38 +00:00
5 changed files with 13 additions and 8 deletions

View file

@ -4107,6 +4107,10 @@ RefPtr<StyleValue const> Parser::parse_calculated_value(ComponentValue const& co
},
[](SpecialContext special_context) -> Optional<CalculationContext> {
switch (special_context) {
case SpecialContext::FontStyleObliqueAngle:
return CalculationContext {
.accepted_type_ranges = { { ValueType::Angle, { -90, 90 } } }
};
case SpecialContext::ShadowBlurRadius:
return CalculationContext { .accepted_type_ranges = { { ValueType::Length, { 0, NumericLimits<float>::max() } } } };
case SpecialContext::TranslateZArgument: