mirror of
https://github.com/servo/servo.git
synced 2025-09-30 00:29:14 +01:00
animations: Finish support for fractional iteration counts
This change also improves support for creating animations with negative delays, as that is necessary to test support for fractional iteration lengths. This change also adjusts existing Servo animation tests which assumed that advancing to the exact moment of the end of the animation would be considered "before the end." With this change, this moment is "after the end." Fixes: #14858
This commit is contained in:
parent
99d409f15d
commit
954b5177f0
19 changed files with 163 additions and 101 deletions
|
@ -12867,7 +12867,7 @@
|
|||
"css": {
|
||||
"animations": {
|
||||
"animation-delay.html": [
|
||||
"0d2053a9134d8ff0ade7b5dc37ecfce305557c44",
|
||||
"f54cf2b9bca93e82b177243b9d754e4ae3bf15fa",
|
||||
[
|
||||
null,
|
||||
{}
|
||||
|
@ -12883,7 +12883,7 @@
|
|||
]
|
||||
],
|
||||
"animation-fill-mode.html": [
|
||||
"9602ec9f0e0eb1f6efcc2e7bd95181ef65339bae",
|
||||
"ac3062879af9836768890d653f4b29b6165b6a45",
|
||||
[
|
||||
null,
|
||||
{}
|
||||
|
|
|
@ -31,6 +31,7 @@ test(function() {
|
|||
element.style.animationIterationCount = 1;
|
||||
element.style.animationName = "width-animation";
|
||||
element.style.animationTimingFunction = "linear";
|
||||
element.style.animationFillMode = "forwards";
|
||||
|
||||
document.body.appendChild(element);
|
||||
assert_equals(getComputedStyle(element).getPropertyValue("width"), "50px");
|
||||
|
@ -48,7 +49,7 @@ test(function() {
|
|||
assert_equals(getComputedStyle(element).getPropertyValue("width"), "500px");
|
||||
|
||||
testBinding.advanceClock(500);
|
||||
assert_equals(getComputedStyle(element).getPropertyValue("width"), "50px");
|
||||
assert_equals(getComputedStyle(element).getPropertyValue("width"), "500px");
|
||||
}, "animation-delay should function correctly");
|
||||
|
||||
test(function() {
|
||||
|
@ -61,6 +62,7 @@ test(function() {
|
|||
element.style.animationIterationCount = 2;
|
||||
element.style.animationName = "width-animation";
|
||||
element.style.animationTimingFunction = "linear";
|
||||
element.style.animationFillMode = "forwards";
|
||||
|
||||
document.body.appendChild(element);
|
||||
assert_equals(getComputedStyle(element).getPropertyValue("width"), "50px");
|
||||
|
@ -85,7 +87,7 @@ test(function() {
|
|||
assert_equals(getComputedStyle(element).getPropertyValue("width"), "500px");
|
||||
|
||||
testBinding.advanceClock(500);
|
||||
assert_equals(getComputedStyle(element).getPropertyValue("width"), "50px");
|
||||
assert_equals(getComputedStyle(element).getPropertyValue("width"), "500px");
|
||||
}, "animation-delay should function correctly with multiple iterations");
|
||||
|
||||
</script>
|
||||
|
|
|
@ -48,8 +48,9 @@ function runThroughAnimation(testBinding, element, waitForDelay = true) {
|
|||
testBinding.advanceClock(500);
|
||||
assert_equals(getComputedStyle(element).getPropertyValue("width"), "250px");
|
||||
|
||||
// After advancing another 500 milliseconds the animation should finished and
|
||||
// width value will depend on the value of `animation-fill-mode`.
|
||||
testBinding.advanceClock(500);
|
||||
assert_equals(getComputedStyle(element).getPropertyValue("width"), "500px");
|
||||
}
|
||||
|
||||
test(function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue