mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Implement calc expressions for more value types
This commit is contained in:
parent
35b452660b
commit
00980ea595
9 changed files with 383 additions and 312 deletions
|
@ -411,6 +411,8 @@ pub fn specified_or_none(length: LengthOrPercentageOrNone, containing_length: Au
|
|||
match length {
|
||||
LengthOrPercentageOrNone::None => None,
|
||||
LengthOrPercentageOrNone::Percentage(percent) => Some(containing_length.scale_by(percent)),
|
||||
LengthOrPercentageOrNone::Calc(calc) =>
|
||||
Some(containing_length.scale_by(calc.percentage()) + calc.length()),
|
||||
LengthOrPercentageOrNone::Length(length) => Some(length),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue