LibWeb: Add method for whether tree-counting function is allowed

Some contexts (e.g. descriptors, media conditions) don't allow tree
counting functions, this commit adds an easy way to check if the current
value context is one of those.
This commit is contained in:
Callum Law 2025-09-30 15:12:52 +13:00 committed by Tim Ledbetter
commit fd31fbd84b
Notes: github-actions[bot] 2025-10-20 15:13:55 +00:00
5 changed files with 27 additions and 1 deletions

View file

@ -4142,6 +4142,9 @@ RefPtr<CalculatedStyleValue const> Parser::parse_calculated_value(ComponentValue
case SpecialContext::TranslateZArgument:
// Percentages are disallowed for the Z axis
return CalculationContext {};
case SpecialContext::DOMMatrixInitString:
case SpecialContext::MediaCondition:
return {};
}
VERIFY_NOT_REACHED();
});