Replace LengthOrNone by a specific type for the perspective property

This was its only use, and it was bugged: AFAIK this didn't properly
clamp animated values below 0.
This commit is contained in:
Anthony Ramine 2018-02-26 15:46:41 +01:00
parent 4a98fa70bf
commit 260e05320c
11 changed files with 88 additions and 32 deletions

View file

@ -5,8 +5,9 @@
//! Computed types for box properties.
use values::computed::Number;
use values::computed::length::LengthOrPercentage;
use values::computed::length::{LengthOrPercentage, NonNegativeLength};
use values::generics::box_::AnimationIterationCount as GenericAnimationIterationCount;
use values::generics::box_::Perspective as GenericPerspective;
use values::generics::box_::VerticalAlign as GenericVerticalAlign;
pub use values::specified::box_::{AnimationName, Display, OverflowClipBox, Contain};
@ -25,3 +26,6 @@ impl AnimationIterationCount {
GenericAnimationIterationCount::Number(1.0)
}
}
/// A computed value for the `perspective` property.
pub type Perspective = GenericPerspective<NonNegativeLength>;