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

@ -8982,11 +8982,16 @@ nsRuleNode::ComputePositionData(void* aStartStruct,
SETCOORD_UNSET_INITIAL,
aContext, mPresContext, conditions);
// aspect-ratio: float, initial
SetFactor(*aRuleData->ValueForAspectRatio(),
pos->mAspectRatio, conditions,
parentPos->mAspectRatio, 0.0f,
SETFCT_UNSET_INITIAL | SETFCT_POSITIVE | SETFCT_NONE);
// aspect-ratio: auto | <ratio>
const nsCSSValue* aspectRatio = aRuleData->ValueForAspectRatio();
if (aspectRatio->GetUnit() == eCSSUnit_Auto) {
pos->mAspectRatio = 0.0f;
} else {
SetFactor(*aspectRatio,
pos->mAspectRatio, conditions,
parentPos->mAspectRatio, 0.0f,
SETFCT_UNSET_INITIAL | SETFCT_POSITIVE | SETFCT_NONE);
}
// box-sizing: enum, inherit, initial
SetValue(*aRuleData->ValueForBoxSizing(),