Rename MinLength to MozLength.

So that we can reuse this for non-min-prefixed properties (e.g. width).
This commit is contained in:
Hiroyuki Ikezoe 2017-05-20 11:58:58 +09:00
parent 95bda2dff9
commit 57c27e5d35
8 changed files with 59 additions and 58 deletions

View file

@ -41,7 +41,7 @@ use values::{Auto, Either, generics};
use values::computed::{Angle, LengthOrPercentageOrAuto, LengthOrPercentageOrNone};
use values::computed::{BorderRadiusSize, ClipRect};
use values::computed::{CalcLengthOrPercentage, Context, LengthOrPercentage};
use values::computed::{MaxLength, MinLength};
use values::computed::{MaxLength, MozLength};
use values::computed::ToComputedValue;
use values::generics::position as generic_position;
@ -1237,14 +1237,14 @@ impl Animatable for LengthOrPercentageOrNone {
}
/// https://drafts.csswg.org/css-transitions/#animtype-lpcalc
impl Animatable for MinLength {
impl Animatable for MozLength {
#[inline]
fn add_weighted(&self, other: &Self, self_portion: f64, other_portion: f64) -> Result<Self, ()> {
match (*self, *other) {
(MinLength::LengthOrPercentageOrAuto(ref this),
MinLength::LengthOrPercentageOrAuto(ref other)) => {
(MozLength::LengthOrPercentageOrAuto(ref this),
MozLength::LengthOrPercentageOrAuto(ref other)) => {
this.add_weighted(other, self_portion, other_portion)
.map(MinLength::LengthOrPercentageOrAuto)
.map(MozLength::LengthOrPercentageOrAuto)
}
_ => Err(()),
}
@ -1253,8 +1253,8 @@ impl Animatable for MinLength {
#[inline]
fn compute_distance(&self, other: &Self) -> Result<f64, ()> {
match (*self, *other) {
(MinLength::LengthOrPercentageOrAuto(ref this),
MinLength::LengthOrPercentageOrAuto(ref other)) => {
(MozLength::LengthOrPercentageOrAuto(ref this),
MozLength::LengthOrPercentageOrAuto(ref other)) => {
this.compute_distance(other)
},
_ => Err(()),