mirror of
https://github.com/servo/servo.git
synced 2025-08-17 11:25:35 +01:00
Bug 1374233 - Part 6: Add PositiveInteger and PositiveIntegerOrAuto for column-count.
column-count should be a positive integer or auto. MozReview-Commit-ID: 9LFvrYo8De5
This commit is contained in:
parent
190cd5b952
commit
9d69cb2866
7 changed files with 49 additions and 9 deletions
|
@ -14,6 +14,7 @@ use values::computed::Angle as ComputedAngle;
|
|||
use values::computed::GreaterThanOrEqualToOneNumber as ComputedGreaterThanOrEqualToOneNumber;
|
||||
use values::computed::NonNegativeAu;
|
||||
use values::computed::NonNegativeNumber as ComputedNonNegativeNumber;
|
||||
use values::computed::PositiveInteger as ComputedPositiveInteger;
|
||||
use values::specified::url::SpecifiedUrl;
|
||||
|
||||
pub mod effects;
|
||||
|
@ -134,6 +135,20 @@ impl ToAnimatedValue for NonNegativeAu {
|
|||
}
|
||||
}
|
||||
|
||||
impl ToAnimatedValue for ComputedPositiveInteger {
|
||||
type AnimatedValue = Self;
|
||||
|
||||
#[inline]
|
||||
fn to_animated_value(self) -> Self {
|
||||
self
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn from_animated_value(animated: Self::AnimatedValue) -> Self {
|
||||
max(animated.0, 0).into()
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns a value similar to `self` that represents zero.
|
||||
pub trait ToAnimatedZero: Sized {
|
||||
/// Returns a value that, when added with an underlying value, will produce the underlying
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue