-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #27032 - mrobinson:fractional-iteration, r=emilio
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. Fixes: #14858 <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #14858 - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
- Loading branch information
Showing
4 changed files
with
154 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
tests/wpt/web-platform-tests/css/css-animations/animation-iteration-count-009.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!doctype html> | ||
<meta charset=utf-8> | ||
<title>CSS Animation Test: fractional animation-iteration-count</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-animations/#animation-iteration-count"> | ||
<link rel="author" title="Martin Robinson" href="mailto:mrobinson@igalia.com"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="support/testcommon.js"></script> | ||
<style> | ||
@keyframes margin-animation { | ||
from { | ||
margin-left: 0px; | ||
} | ||
to { | ||
margin-left: 100px; | ||
} | ||
} | ||
</style> | ||
<div id="log"></div> | ||
<script> | ||
'use strict'; | ||
|
||
promise_test(async t => { | ||
const div = addDiv(t); | ||
div.style.animation = 'margin-animation 1s -10s linear 1.5 normal forwards paused'; | ||
assert_equals(getComputedStyle(div).marginLeft, '50px'); | ||
}, 'Basic floating point iteration count'); | ||
|
||
promise_test(async t => { | ||
const div = addDiv(t); | ||
div.style.animation = 'margin-animation 1s -10s linear 3.25 normal forwards paused'; | ||
assert_equals(getComputedStyle(div).marginLeft, '25px'); | ||
}, 'Floating point iteration count after multiple iterations'); | ||
|
||
promise_test(async t => { | ||
const div = addDiv(t); | ||
div.style.animation = 'margin-animation 1s -10s linear 0.75 normal forwards paused'; | ||
assert_equals(getComputedStyle(div).marginLeft, '75px'); | ||
}, 'Floating point iteration count during first iteration'); | ||
|
||
promise_test(async t => { | ||
const div = addDiv(t); | ||
div.style.animation = 'margin-animation 1s -10s linear 1.75 alternate forwards paused'; | ||
assert_equals(getComputedStyle(div).marginLeft, '25px'); | ||
}, 'Floating point iteration count with alternating directions'); | ||
</script> |