LibWeb: Compute math-depth in line with other font properties

The main change here is that we now properly absolutize values which
means we now support `random()` and `sibling-{count,index}()`

We are also more consistent with how we handle computation for the other
font properties
This commit is contained in:
Callum Law
2026-01-14 21:03:32 +13:00
committed by Sam Atkins
parent 27dd77a538
commit 2c3ddc294f
Notes: github-actions[bot] 2026-01-15 12:04:17 +00:00
8 changed files with 71 additions and 52 deletions

View File

@@ -9,6 +9,16 @@
namespace Web::CSS {
ValueComparingNonnullRefPtr<StyleValue const> AddFunctionStyleValue::absolutized(ComputationContext const& context) const
{
auto absolutized_value = m_value->absolutized(context);
if (absolutized_value == m_value)
return *this;
return AddFunctionStyleValue::create(m_value->absolutized(context));
}
void AddFunctionStyleValue::serialize(StringBuilder& builder, SerializationMode mode) const
{
builder.append("add("sv);