mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Comments and minor fixes
This commit is contained in:
parent
123bc1d6de
commit
cb9645cd17
3 changed files with 13 additions and 6 deletions
|
@ -3202,8 +3202,7 @@ fn static_assert() {
|
|||
|
||||
let result = match list {
|
||||
Some(list) => {
|
||||
let vec: Vec<_> = list
|
||||
.into_iter()
|
||||
list.into_iter()
|
||||
.filter_map(|value| {
|
||||
// Handle none transform.
|
||||
if value.is_none() {
|
||||
|
@ -3212,12 +3211,11 @@ fn static_assert() {
|
|||
Some(Self::clone_single_transform_function(value))
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
if !vec.is_empty() { Some(vec) } else { None }
|
||||
.collect::<Vec<_>>()
|
||||
},
|
||||
_ => None,
|
||||
_ => vec![],
|
||||
};
|
||||
Transform(result.unwrap_or(vec!()))
|
||||
Transform(result)
|
||||
}
|
||||
|
||||
${impl_transition_time_value('delay', 'Delay')}
|
||||
|
|
|
@ -1438,6 +1438,8 @@ impl Animate for Matrix3D {
|
|||
}
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
// Gecko doesn't exactly follow the spec here; we use a different procedure
|
||||
// to match it
|
||||
fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> {
|
||||
let (from, to) = if self.is_3d() || other.is_3d() {
|
||||
(decompose_3d_matrix(*self), decompose_3d_matrix(*other))
|
||||
|
@ -1467,6 +1469,8 @@ impl Animate for Matrix {
|
|||
}
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
// Gecko doesn't exactly follow the spec here; we use a different procedure
|
||||
// to match it
|
||||
fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> {
|
||||
let from = decompose_2d_matrix(&(*self).into());
|
||||
let to = decompose_2d_matrix(&(*other).into());
|
||||
|
@ -2471,6 +2475,9 @@ impl ComputeSquaredDistance for ComputedTransformOperation {
|
|||
}
|
||||
p_matrix.compute_squared_distance(&m)
|
||||
}
|
||||
// Gecko cross-interpolates amongst all translate and all scale
|
||||
// functions (See ToPrimitive in layout/style/StyleAnimationValue.cpp)
|
||||
// without falling back to InterpolateMatrix
|
||||
_ if self.is_translate() && other.is_translate() => {
|
||||
self.to_translate_3d().compute_squared_distance(&other.to_translate_3d())
|
||||
}
|
||||
|
|
|
@ -59,6 +59,8 @@ pub type Matrix = GenericMatrix<Number>;
|
|||
/// computed value of matrix() in -moz-transform
|
||||
pub type PrefixedMatrix = GenericMatrix<Number, LengthOrPercentageOrNumber>;
|
||||
|
||||
// we rustfmt_skip here because we want the matrices to look like
|
||||
// matrices instead of being split across lines
|
||||
#[cfg_attr(rustfmt, rustfmt_skip)]
|
||||
impl Matrix3D {
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue