mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Implement Calc for LengthOrPercentageOrAuto
This commit is contained in:
parent
9556141e57
commit
cb4d878169
7 changed files with 44 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue