mirror of
https://github.com/servo/servo.git
synced 2025-10-04 02:29:12 +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
|
@ -30,7 +30,7 @@ use crate::values::distance::{ComputeSquaredDistance, SquaredDistance};
|
|||
use crate::values::generics::{calc, NonNegative};
|
||||
use crate::values::specified::length::FontBaseSize;
|
||||
use crate::values::{specified, CSSFloat};
|
||||
use crate::Zero;
|
||||
use crate::{Zero, ZeroNoPercent};
|
||||
use app_units::Au;
|
||||
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -556,6 +556,13 @@ impl Zero for LengthPercentage {
|
|||
}
|
||||
}
|
||||
|
||||
impl ZeroNoPercent for LengthPercentage {
|
||||
#[inline]
|
||||
fn is_zero_no_percent(&self) -> bool {
|
||||
self.is_definitely_zero() && !self.has_percentage()
|
||||
}
|
||||
}
|
||||
|
||||
impl Serialize for LengthPercentage {
|
||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue