mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
style: Avoid ending up with an invalid keyframe when inf or NaN are at play.
This commit is contained in:
parent
04d9ab50eb
commit
fa01716c52
3 changed files with 24 additions and 2 deletions
|
@ -50,10 +50,11 @@ impl KeyframePercentage {
|
|||
KeyframePercentage::new(1.)
|
||||
} else {
|
||||
let percentage = try!(input.expect_percentage());
|
||||
if percentage > 1. || percentage < 0. {
|
||||
if percentage >= 0. && percentage <= 1. {
|
||||
KeyframePercentage::new(percentage)
|
||||
} else {
|
||||
return Err(());
|
||||
}
|
||||
KeyframePercentage::new(percentage)
|
||||
};
|
||||
|
||||
Ok(percentage)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue