Implement ToComputedValue for Box<T>

This commit is contained in:
Anthony Ramine 2017-09-11 17:20:41 +02:00
parent 4e64ccde60
commit 7c31202dda
4 changed files with 27 additions and 3 deletions

View file

@ -296,6 +296,22 @@ impl<T> ToComputedValue for Vec<T>
}
}
impl<T> ToComputedValue for Box<T>
where T: ToComputedValue
{
type ComputedValue = Box<<T as ToComputedValue>::ComputedValue>;
#[inline]
fn to_computed_value(&self, context: &Context) -> Self::ComputedValue {
Box::new(T::to_computed_value(self, context))
}
#[inline]
fn from_computed_value(computed: &Self::ComputedValue) -> Self {
Box::new(T::from_computed_value(computed))
}
}
impl<T> ToComputedValue for Box<[T]>
where T: ToComputedValue
{