aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2017-11-02 14:10:28 -0700
committerManish Goregaokar <manishsmail@gmail.com>2017-11-02 14:37:54 -0700
commitcb9645cd17b6e1ecdf6f3e63d47efa88433bb1fc (patch)
treebd0b13445accba9e877ff59ee6a6ef24477fe62c
parent123bc1d6def72c621d86eac05ab96a0e53b53e22 (diff)
downloadservo-cb9645cd17b6e1ecdf6f3e63d47efa88433bb1fc.tar.gz
servo-cb9645cd17b6e1ecdf6f3e63d47efa88433bb1fc.zip
Comments and minor fixes
-rw-r--r--components/style/properties/gecko.mako.rs10
-rw-r--r--components/style/properties/helpers/animated_properties.mako.rs7
-rw-r--r--components/style/values/computed/transform.rs2
3 files changed, 13 insertions, 6 deletions
diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs
index 21d43c0d009..a7e433642c9 100644
--- a/components/style/properties/gecko.mako.rs
+++ b/components/style/properties/gecko.mako.rs
@@ -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')}
diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs
index 7f637fa26cd..b054e3f9863 100644
--- a/components/style/properties/helpers/animated_properties.mako.rs
+++ b/components/style/properties/helpers/animated_properties.mako.rs
@@ -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())
}
diff --git a/components/style/values/computed/transform.rs b/components/style/values/computed/transform.rs
index 3be9816b34c..440758a06b1 100644
--- a/components/style/values/computed/transform.rs
+++ b/components/style/values/computed/transform.rs
@@ -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]