mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Auto merge of #17839 - heycam:opacity-smil, r=hiro
style: allow out-of-range opacity values for SMIL animations From https://bugzilla.mozilla.org/show_bug.cgi?id=1371150. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17839) <!-- Reviewable:end -->
This commit is contained in:
commit
bf16b146e8
8 changed files with 45 additions and 4 deletions
|
@ -566,7 +566,14 @@ impl ToComputedValue for Opacity {
|
|||
|
||||
#[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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue