mirror of
https://github.com/servo/servo.git
synced 2025-08-15 10:25:32 +01:00
Implement a MinLength type
Implement an ExtremumLength type which contains all the enumerated keyword values for min-width, min-height, max-width, and max-height. Then, implement a MinLength which can be used for min-width and min-height. So far this just maps to Gecko values. Refs #13821.
This commit is contained in:
parent
063aec5ade
commit
76de979231
9 changed files with 199 additions and 10 deletions
|
@ -33,6 +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::position::{HorizontalPosition, Position, VerticalPosition};
|
||||
use values::computed::ToComputedValue;
|
||||
use values::specified::Angle as SpecifiedAngle;
|
||||
|
@ -630,6 +631,20 @@ impl Interpolate for LengthOrPercentageOrNone {
|
|||
}
|
||||
}
|
||||
|
||||
/// https://drafts.csswg.org/css-transitions/#animtype-lpcalc
|
||||
impl Interpolate for MinLength {
|
||||
#[inline]
|
||||
fn interpolate(&self, other: &Self, progress: f64) -> Result<Self, ()> {
|
||||
match (*self, *other) {
|
||||
(MinLength::LengthOrPercentage(ref this),
|
||||
MinLength::LengthOrPercentage(ref other)) => {
|
||||
this.interpolate(other, progress).map(MinLength::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