mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Properly implement ToAnimatedZero for BorderSpacing
This commit is contained in:
parent
b17fea1d7f
commit
52f0fcabad
4 changed files with 15 additions and 10 deletions
|
@ -380,3 +380,16 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<T> ToAnimatedZero for Size2D<T>
|
||||||
|
where
|
||||||
|
T: ToAnimatedZero,
|
||||||
|
{
|
||||||
|
#[inline]
|
||||||
|
fn to_animated_zero(&self) -> Result<Self, ()> {
|
||||||
|
Ok(Size2D::new(
|
||||||
|
self.width.to_animated_zero()?,
|
||||||
|
self.height.to_animated_zero()?,
|
||||||
|
))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -69,14 +69,6 @@ impl BorderCornerRadius {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ToAnimatedZero for BorderSpacing {
|
|
||||||
#[inline]
|
|
||||||
fn to_animated_zero(&self) -> Result<Self, ()> {
|
|
||||||
// FIXME(emilio): Why?
|
|
||||||
Err(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ToAnimatedZero for BorderCornerRadius {
|
impl ToAnimatedZero for BorderCornerRadius {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn to_animated_zero(&self) -> Result<Self, ()> {
|
fn to_animated_zero(&self) -> Result<Self, ()> {
|
||||||
|
|
|
@ -43,7 +43,7 @@ impl<L> BorderCornerRadius<L> {
|
||||||
|
|
||||||
/// A generic value for the `border-spacing` property.
|
/// A generic value for the `border-spacing` property.
|
||||||
#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf)]
|
#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug, MallocSizeOf)]
|
||||||
#[derive(PartialEq, ToAnimatedValue, ToComputedValue, ToCss)]
|
#[derive(PartialEq, ToAnimatedValue, ToAnimatedZero, ToComputedValue, ToCss)]
|
||||||
pub struct BorderSpacing<L>(pub Size<L>);
|
pub struct BorderSpacing<L>(pub Size<L>);
|
||||||
|
|
||||||
impl<L> BorderSpacing<L> {
|
impl<L> BorderSpacing<L> {
|
||||||
|
|
|
@ -14,7 +14,7 @@ use values::animated::ToAnimatedValue;
|
||||||
/// A generic size, for `border-*-radius` longhand properties, or
|
/// A generic size, for `border-*-radius` longhand properties, or
|
||||||
/// `border-spacing`.
|
/// `border-spacing`.
|
||||||
#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug)]
|
#[derive(Animate, Clone, ComputeSquaredDistance, Copy, Debug)]
|
||||||
#[derive(MallocSizeOf, PartialEq, ToComputedValue)]
|
#[derive(MallocSizeOf, PartialEq, ToAnimatedZero, ToComputedValue)]
|
||||||
pub struct Size<L>(pub Size2D<L>);
|
pub struct Size<L>(pub Size2D<L>);
|
||||||
|
|
||||||
impl<L> Size<L> {
|
impl<L> Size<L> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue