mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Change AnimatedValue for GreaterThanOrEqualToOneNumber to CSSFloat
This commit is contained in:
parent
f89ebf7fe9
commit
056abcbf5f
4 changed files with 19 additions and 21 deletions
|
@ -460,6 +460,20 @@ impl From<NonNegativeNumber> for CSSFloat {
|
|||
/// A wrapper of Number, but the value >= 1.
|
||||
pub type GreaterThanOrEqualToOneNumber = GreaterThanOrEqualToOne<CSSFloat>;
|
||||
|
||||
impl ToAnimatedValue for GreaterThanOrEqualToOneNumber {
|
||||
type AnimatedValue = CSSFloat;
|
||||
|
||||
#[inline]
|
||||
fn to_animated_value(self) -> Self::AnimatedValue {
|
||||
self.0
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn from_animated_value(animated: Self::AnimatedValue) -> Self {
|
||||
animated.max(1.).into()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<CSSFloat> for GreaterThanOrEqualToOneNumber {
|
||||
#[inline]
|
||||
fn from(number: CSSFloat) -> GreaterThanOrEqualToOneNumber {
|
||||
|
|
|
@ -9,7 +9,6 @@ use properties::StyleBuilder;
|
|||
use std::fmt::{self, Write};
|
||||
use style_traits::{CssWriter, ToCss};
|
||||
use values::{CSSInteger, CSSFloat};
|
||||
use values::animated::ToAnimatedZero;
|
||||
use values::computed::{NonNegativeLength, NonNegativeNumber};
|
||||
use values::computed::length::{Length, LengthOrPercentage};
|
||||
use values::generics::text::InitialLetter as GenericInitialLetter;
|
||||
|
@ -31,11 +30,6 @@ pub type WordSpacing = Spacing<LengthOrPercentage>;
|
|||
/// A computed value for the `line-height` property.
|
||||
pub type LineHeight = GenericLineHeight<NonNegativeNumber, NonNegativeLength>;
|
||||
|
||||
impl ToAnimatedZero for LineHeight {
|
||||
#[inline]
|
||||
fn to_animated_zero(&self) -> Result<Self, ()> { Err(()) }
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, MallocSizeOf, PartialEq)]
|
||||
/// text-overflow.
|
||||
/// When the specified value only has one side, that's the "second"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue