LibWeb/CSS: Add a Property -> CalculationContext factory method

We have this code duplicated in multiple places, and we'll want to
handle registered custom properties too at some point, so wrap it in a
reusable `CalculationContext::for_property()` method.

Noticed while doing this that ValueParsingContext will eventually need
to take a PropertyNameAndID, not a PropertyID, so I've added a FIXME.
This commit is contained in:
Sam Atkins 2025-10-10 16:04:51 +01:00
parent a3e973970a
commit 0afa93e639
Notes: github-actions[bot] 2025-10-13 09:01:24 +00:00
6 changed files with 19 additions and 15 deletions

View file

@ -566,6 +566,7 @@ private:
ShadowBlurRadius,
TranslateZArgument
};
// FIXME: Use PropertyNameAndID instead of PropertyID as the context, for registered custom properties.
using ValueParsingContext = Variant<PropertyID, FunctionContext, DescriptorContext, SpecialContext>;
Vector<ValueParsingContext> m_value_context;
auto push_temporary_value_parsing_context(ValueParsingContext&& context)