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:
AW255 2022-08-26 11:11:30 +00:00 committed by Martin Robinson
parent aefbae5f96
commit 12a2c88605
4 changed files with 33 additions and 11 deletions

View file

@ -244,6 +244,12 @@ where
}
}
/// A trait implementing a function to tell if the number is zero without a percent
pub trait ZeroNoPercent {
/// So, `0px` should return `true`, but `0%` or `1px` should return `false`
fn is_zero_no_percent(&self) -> bool;
}
/// A trait pretty much similar to num_traits::One, but without the need of
/// implementing `Mul`.
pub trait One {