mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Fix Animatable impl for LengthOrPercentageOrNone
This commit is contained in:
parent
43a5257a0c
commit
f658215f12
2 changed files with 33 additions and 2 deletions
|
@ -157,6 +157,25 @@ impl From<LengthOrPercentageOrAuto> for Option<CalcLengthOrPercentage> {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<LengthOrPercentageOrNone> for Option<CalcLengthOrPercentage> {
|
||||
fn from(len: LengthOrPercentageOrNone) -> Option<CalcLengthOrPercentage> {
|
||||
match len {
|
||||
LengthOrPercentageOrNone::Percentage(this) => {
|
||||
Some(CalcLengthOrPercentage::new(Au(0), Some(this)))
|
||||
}
|
||||
LengthOrPercentageOrNone::Length(this) => {
|
||||
Some(CalcLengthOrPercentage::new(this, None))
|
||||
}
|
||||
LengthOrPercentageOrNone::Calc(this) => {
|
||||
Some(this)
|
||||
}
|
||||
LengthOrPercentageOrNone::None => {
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ToCss for CalcLengthOrPercentage {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
match (self.length, self.percentage) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue