mirror of
https://github.com/servo/servo.git
synced 2025-10-04 10:39:16 +01:00
style: 0% values are not skipped when parsing CSS transform
Adds trait ZeroNoPercent to check for values that are 0 (such as 0px) but not 0% Updated test css/css-transforms/animation/translate-interpolation.html and removed unnecessary formatting changes Differential Revision: https://phabricator.services.mozilla.com/D154930
This commit is contained in:
parent
aefbae5f96
commit
12a2c88605
4 changed files with 33 additions and 11 deletions
|
@ -18,7 +18,7 @@ use crate::values::generics::NonNegative;
|
|||
use crate::values::specified::calc::{self, CalcNode};
|
||||
use crate::values::specified::NonNegativeNumber;
|
||||
use crate::values::CSSFloat;
|
||||
use crate::Zero;
|
||||
use crate::{Zero, ZeroNoPercent};
|
||||
use app_units::Au;
|
||||
use cssparser::{Parser, Token};
|
||||
use std::cmp;
|
||||
|
@ -1486,6 +1486,15 @@ impl Zero for LengthPercentage {
|
|||
}
|
||||
}
|
||||
|
||||
impl ZeroNoPercent for LengthPercentage {
|
||||
fn is_zero_no_percent(&self) -> bool {
|
||||
match *self {
|
||||
LengthPercentage::Percentage(_) => false,
|
||||
_ => self.is_zero(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A specified type for `<length-percentage> | auto`.
|
||||
pub type LengthPercentageOrAuto = generics::LengthPercentageOrAuto<LengthPercentage>;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue