Implement Calc for LengthOrPercentageOrAuto

This commit is contained in:
David Zbarsky 2015-08-11 21:08:05 -04:00
parent 9556141e57
commit cb4d878169
7 changed files with 44 additions and 0 deletions

View file

@ -379,6 +379,9 @@ impl MaybeAuto {
LengthOrPercentageOrAuto::Percentage(percent) => {
MaybeAuto::Specified(containing_length.scale_by(percent))
}
LengthOrPercentageOrAuto::Calc(calc) => {
MaybeAuto::Specified(calc.length() + containing_length.scale_by(calc.percentage()))
}
LengthOrPercentageOrAuto::Length(length) => MaybeAuto::Specified(length)
}
}