mirror of
https://github.com/servo/servo.git
synced 2025-08-01 03:30:33 +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.)
|
KeyframePercentage::new(1.)
|
||||||
} else {
|
} else {
|
||||||
let percentage = try!(input.expect_percentage());
|
let percentage = try!(input.expect_percentage());
|
||||||
if percentage > 1. || percentage < 0. {
|
if percentage >= 0. && percentage <= 1. {
|
||||||
|
KeyframePercentage::new(percentage)
|
||||||
|
} else {
|
||||||
return Err(());
|
return Err(());
|
||||||
}
|
}
|
||||||
KeyframePercentage::new(percentage)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(percentage)
|
Ok(percentage)
|
||||||
|
|
|
@ -8294,6 +8294,12 @@
|
||||||
"url": "/_mozilla/mozilla/iterable.html"
|
"url": "/_mozilla/mozilla/iterable.html"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"mozilla/keyframe-infinite-percentage.html": [
|
||||||
|
{
|
||||||
|
"path": "mozilla/keyframe-infinite-percentage.html",
|
||||||
|
"url": "/_mozilla/mozilla/keyframe-infinite-percentage.html"
|
||||||
|
}
|
||||||
|
],
|
||||||
"mozilla/lenient_this.html": [
|
"mozilla/lenient_this.html": [
|
||||||
{
|
{
|
||||||
"path": "mozilla/lenient_this.html",
|
"path": "mozilla/lenient_this.html",
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
<!doctype html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Shouldn't end up with an invalid keyframe when inf or nan are at play.</title>
|
||||||
|
<script src="/resources/testharness.js"></script>
|
||||||
|
<script src="/resources/testharnessreport.js"></script>
|
||||||
|
<style>
|
||||||
|
@keyframes anim {
|
||||||
|
0e309% {}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script>
|
||||||
|
test(function() {
|
||||||
|
assert_true(true, "Doesn't crash");
|
||||||
|
}, "Doesn't crash");
|
||||||
|
</script>
|
Loading…
Add table
Add a link
Reference in a new issue