mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Add support for MaxLength
This builds on the ExtremumLength type from the previous commit.
This commit is contained in:
parent
76de979231
commit
dd4f331603
8 changed files with 154 additions and 11 deletions
|
@ -33,7 +33,7 @@ use values::Either;
|
|||
use values::computed::{Angle, LengthOrPercentageOrAuto, LengthOrPercentageOrNone};
|
||||
use values::computed::{BorderRadiusSize, ClipRect, LengthOrNone};
|
||||
use values::computed::{CalcLengthOrPercentage, Context, LengthOrPercentage};
|
||||
use values::computed::MinLength;
|
||||
use values::computed::{MaxLength, MinLength};
|
||||
use values::computed::position::{HorizontalPosition, Position, VerticalPosition};
|
||||
use values::computed::ToComputedValue;
|
||||
use values::specified::Angle as SpecifiedAngle;
|
||||
|
@ -645,6 +645,20 @@ impl Interpolate for MinLength {
|
|||
}
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-transitions/#animtype-lpcalc
|
||||
impl Interpolate for MaxLength {
|
||||
#[inline]
|
||||
fn interpolate(&self, other: &Self, progress: f64) -> Result<Self, ()> {
|
||||
match (*self, *other) {
|
||||
(MaxLength::LengthOrPercentage(ref this),
|
||||
MaxLength::LengthOrPercentage(ref other)) => {
|
||||
this.interpolate(other, progress).map(MaxLength::LengthOrPercentage)
|
||||
}
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-transitions/#animtype-number
|
||||
/// https://drafts.csswg.org/css-transitions/#animtype-length
|
||||
impl Interpolate for LineHeight {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue