aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/style/gecko/wrapper.rs6
-rw-r--r--components/style/properties/gecko.mako.rs6
-rw-r--r--components/style/properties/helpers/animated_properties.mako.rs7
-rw-r--r--components/style/values/animated/mod.rs2
4 files changed, 11 insertions, 10 deletions
diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs
index bb079321bf5..80ab02ae518 100644
--- a/components/style/gecko/wrapper.rs
+++ b/components/style/gecko/wrapper.rs
@@ -1396,6 +1396,8 @@ impl<'le> TElement for GeckoElement<'le> {
existing_transitions: &HashMap<TransitionProperty,
Arc<AnimationValue>>)
-> bool {
+ use properties::animated_properties::Animatable;
+
// |property| should be an animatable longhand
let animatable_longhand = AnimatableLonghand::from_transition_property(property).unwrap();
@@ -1414,7 +1416,9 @@ impl<'le> TElement for GeckoElement<'le> {
let to = AnimationValue::from_computed_values(&animatable_longhand,
after_change_style);
- combined_duration > 0.0f32 && from != to
+ combined_duration > 0.0f32 &&
+ from != to &&
+ from.interpolate(&to, 0.5).is_ok()
}
#[inline]
diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs
index 92cc18ab3af..45ffb371d8a 100644
--- a/components/style/properties/gecko.mako.rs
+++ b/components/style/properties/gecko.mako.rs
@@ -5434,10 +5434,10 @@ clip-path
${impl_simple_copy('column_count', 'mColumnCount')}
pub fn clone_column_count(&self) -> longhands::column_count::computed_value::T {
- use gecko_bindings::structs::NS_STYLE_COLUMN_COUNT_AUTO;
+ use gecko_bindings::structs::{NS_STYLE_COLUMN_COUNT_AUTO, nsStyleColumn_kMaxColumnCount};
if self.gecko.mColumnCount != NS_STYLE_COLUMN_COUNT_AUTO {
- debug_assert!((self.gecko.mColumnCount as i32) >= 0 &&
- (self.gecko.mColumnCount as i32) < i32::max_value());
+ debug_assert!(self.gecko.mColumnCount >= 1 &&
+ self.gecko.mColumnCount <= nsStyleColumn_kMaxColumnCount);
Either::First((self.gecko.mColumnCount as i32).into())
} else {
Either::Second(Auto)
diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs
index ac1e5dc3660..64d29252ddc 100644
--- a/components/style/properties/helpers/animated_properties.mako.rs
+++ b/components/style/properties/helpers/animated_properties.mako.rs
@@ -863,7 +863,7 @@ impl Animatable for f64 {
impl Animatable for i32 {
#[inline]
fn add_weighted(&self, other: &i32, self_portion: f64, other_portion: f64) -> Result<Self, ()> {
- Ok((*self as f64 * self_portion + *other as f64 * other_portion).round() as i32)
+ Ok((*self as f64 * self_portion + *other as f64 * other_portion + 0.5).floor() as i32)
}
}
@@ -2410,10 +2410,7 @@ impl<T, U> Animatable for Either<T, U>
(Either::Second(ref this), Either::Second(ref other)) => {
this.add_weighted(&other, self_portion, other_portion).map(Either::Second)
},
- _ => {
- let result = if self_portion > other_portion {*self} else {*other};
- Ok(result)
- }
+ _ => Err(()),
}
}
}
diff --git a/components/style/values/animated/mod.rs b/components/style/values/animated/mod.rs
index 8f505211ab6..6883f98ac09 100644
--- a/components/style/values/animated/mod.rs
+++ b/components/style/values/animated/mod.rs
@@ -172,7 +172,7 @@ impl ToAnimatedValue for ComputedPositiveInteger {
#[inline]
fn from_animated_value(animated: Self::AnimatedValue) -> Self {
- max(animated.0, 0).into()
+ max(animated.0, 1).into()
}
}