Bug 1371150 - style: Don't clamp Opacity values when computing them for SMIL. r?hiro
MozReview-Commit-ID: Hn3KKErzhUT
--- a/servo/components/style/values/specified/mod.rs
+++ b/servo/components/style/values/specified/mod.rs
@@ -558,17 +558,24 @@ impl Parse for Opacity {
}
}
impl ToComputedValue for Opacity {
type ComputedValue = CSSFloat;
#[inline]
fn to_computed_value(&self, context: &Context) -> CSSFloat {
- self.0.to_computed_value(context).min(1.0).max(0.0)
+ let value = self.0.to_computed_value(context);
+ if context.for_smil_animation {
+ // SMIL expects to be able to interpolate between out-of-range
+ // opacity values.
+ value
+ } else {
+ value.min(1.0).max(0.0)
+ }
}
#[inline]
fn from_computed_value(computed: &CSSFloat) -> Self {
Opacity(Number::from_computed_value(computed))
}
}