Enable CSS aspect-ratio sizing

This commit is contained in:
Basilisk-Dev 2026-05-10 13:00:24 -04:00 committed by wuggy
commit 7766f8f53d
12 changed files with 164 additions and 1310 deletions

View file

@ -964,6 +964,22 @@ nsComputedDOMStyle::DoGetBinding()
return val.forget();
}
already_AddRefed<CSSValue>
nsComputedDOMStyle::DoGetAspectRatio()
{
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
float ratio = StylePosition()->mAspectRatio;
if (ratio == 0.0f) {
val->SetIdent(eCSSKeyword_auto);
} else {
nsAutoString ratioString;
nsStyleUtil::AppendCSSNumber(ratio, ratioString);
ratioString.AppendLiteral(" / 1");
val->SetString(ratioString);
}
return val.forget();
}
already_AddRefed<CSSValue>
nsComputedDOMStyle::DoGetClear()
{
@ -6841,6 +6857,4 @@ already_AddRefed<CSSValue>
nsComputedDOMStyle::DoGetOverflowBlockEnd()
{
return DoGetOverflowBlock();
}
}