mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Update web-platform-tests to revision cf261625e2d230ab219eec966f4abe26e3401b64
This commit is contained in:
parent
11a89bcc47
commit
8f98acd0e7
297 changed files with 3396 additions and 1555 deletions
|
@ -890,6 +890,30 @@ const transformListType = {
|
|||
150 * Math.sin(Math.PI / 2) ] }]);
|
||||
}, `${property}: translate and rotate`);
|
||||
|
||||
test(t => {
|
||||
const idlName = propertyToIDL(property);
|
||||
const target = createTestElement(t, setup);
|
||||
const animation =
|
||||
target.animate({ [idlName]: ['rotate(0deg)',
|
||||
'rotate(1080deg) translateX(100px)'] },
|
||||
1000);
|
||||
|
||||
testAnimationSampleMatrices(animation, idlName,
|
||||
[{ time: 500, expected: [ -1, 0, 0, -1, -50, 0 ] }]);
|
||||
}, `${property}: extend shorter list (from)`);
|
||||
|
||||
test(t => {
|
||||
const idlName = propertyToIDL(property);
|
||||
const target = createTestElement(t, setup);
|
||||
const animation =
|
||||
target.animate({ [idlName]: ['rotate(0deg) translateX(100px)',
|
||||
'rotate(1080deg)'] },
|
||||
1000);
|
||||
|
||||
testAnimationSampleMatrices(animation, idlName,
|
||||
[{ time: 500, expected: [ -1, 0, 0, -1, -50, 0 ] }]);
|
||||
}, `${property}: extend shorter list (to)`);
|
||||
|
||||
test(t => {
|
||||
const idlName = propertyToIDL(property);
|
||||
const target = createTestElement(t, setup);
|
||||
|
@ -1165,6 +1189,30 @@ const transformListType = {
|
|||
{ time: 1000, expected: [ 0, 1, -1, 0, 0, 200 ] }]);
|
||||
}, `${property}: translate on rotate`);
|
||||
|
||||
test(t => {
|
||||
const idlName = propertyToIDL(property);
|
||||
const target = createTestElement(t, setup);
|
||||
target.style[idlName] = 'rotate(45deg) translateX(100px)';
|
||||
const animation = target.animate({ [idlName]: ['rotate(-90deg)',
|
||||
'rotate(90deg)'] },
|
||||
{ duration: 1000, fill: 'both',
|
||||
composite: 'add' });
|
||||
|
||||
testAnimationSampleMatrices(animation, idlName,
|
||||
[{ time: 0, expected: [ Math.cos(-Math.PI / 4),
|
||||
Math.sin(-Math.PI / 4),
|
||||
-Math.sin(-Math.PI / 4),
|
||||
Math.cos(-Math.PI / 4),
|
||||
100 * Math.cos(Math.PI / 4),
|
||||
100 * Math.sin(Math.PI / 4) ] },
|
||||
{ time: 1000, expected: [ Math.cos(Math.PI * 3 / 4),
|
||||
Math.sin(Math.PI * 3 / 4),
|
||||
-Math.sin(Math.PI * 3 / 4),
|
||||
Math.cos(Math.PI * 3 / 4),
|
||||
100 * Math.cos(Math.PI / 4),
|
||||
100 * Math.sin(Math.PI / 4) ] }]);
|
||||
}, `${property}: rotate on rotate and translate`);
|
||||
|
||||
test(t => {
|
||||
const idlName = propertyToIDL(property);
|
||||
const target = createTestElement(t, setup);
|
||||
|
@ -1363,6 +1411,53 @@ const transformListType = {
|
|||
{ time: 1000, expected: [ 0, 1, -1, 0, 200, 0 ] }]);
|
||||
}, `${property}: translate on rotate`);
|
||||
|
||||
test(t => {
|
||||
const idlName = propertyToIDL(property);
|
||||
const target = createTestElement(t, setup);
|
||||
target.style[idlName] = 'rotate(45deg)';
|
||||
const animation =
|
||||
target.animate({ [idlName]: ['rotate(45deg) translateX(0px)',
|
||||
'rotate(45deg) translateX(100px)'] },
|
||||
{ duration: 1000, fill: 'both', composite: 'accumulate' });
|
||||
|
||||
testAnimationSampleMatrices(animation, idlName,
|
||||
[{ time: 0, expected: [ Math.cos(Math.PI / 2),
|
||||
Math.sin(Math.PI / 2),
|
||||
-Math.sin(Math.PI / 2),
|
||||
Math.cos(Math.PI / 2),
|
||||
0 * Math.cos(Math.PI / 2),
|
||||
0 * Math.sin(Math.PI / 2) ] },
|
||||
{ time: 1000, expected: [ Math.cos(Math.PI / 2),
|
||||
Math.sin(Math.PI / 2),
|
||||
-Math.sin(Math.PI / 2),
|
||||
Math.cos(Math.PI / 2),
|
||||
100 * Math.cos(Math.PI / 2),
|
||||
100 * Math.sin(Math.PI / 2) ] }]);
|
||||
}, `${property}: rotate and translate on rotate`);
|
||||
|
||||
test(t => {
|
||||
const idlName = propertyToIDL(property);
|
||||
const target = createTestElement(t, setup);
|
||||
target.style[idlName] = 'rotate(45deg) translateX(100px)';
|
||||
const animation =
|
||||
target.animate({ [idlName]: ['rotate(45deg)', 'rotate(45deg)'] },
|
||||
{ duration: 1000, fill: 'both', composite: 'accumulate' });
|
||||
|
||||
testAnimationSampleMatrices(animation, idlName,
|
||||
[{ time: 0, expected: [ Math.cos(Math.PI / 2),
|
||||
Math.sin(Math.PI / 2),
|
||||
-Math.sin(Math.PI / 2),
|
||||
Math.cos(Math.PI / 2),
|
||||
100 * Math.cos(Math.PI / 2),
|
||||
100 * Math.sin(Math.PI / 2) ] },
|
||||
{ time: 1000, expected: [ Math.cos(Math.PI / 2),
|
||||
Math.sin(Math.PI / 2),
|
||||
-Math.sin(Math.PI / 2),
|
||||
Math.cos(Math.PI / 2),
|
||||
100 * Math.cos(Math.PI / 2),
|
||||
100 * Math.sin(Math.PI / 2) ] }]);
|
||||
}, `${property}: rotate on roate and translate`);
|
||||
|
||||
test(t => {
|
||||
const idlName = propertyToIDL(property);
|
||||
const target = createTestElement(t, setup);
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
<!doctype html>
|
||||
<meta charset=utf-8>
|
||||
<title>The effect value of a keyframe effect: Calculating the interval
|
||||
distance between keyframes</title>
|
||||
<link rel="help" href="https://drafts.csswg.org/web-animations/#the-effect-value-of-a-keyframe-animation-effect">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="../../testcommon.js"></script>
|
||||
<body>
|
||||
<div id="log"></div>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
test(t => {
|
||||
// In Firefox there was a floating precision bug in the calculation of the
|
||||
// progress at the end of the 0.2<->1.0 interval. This test exercises that
|
||||
// calculation in case other UAs suffer from the same problem.
|
||||
const target = createDiv(t);
|
||||
const anim = target.animate(
|
||||
[
|
||||
{ opacity: 0 },
|
||||
{ offset: 0.2, opacity: 1, easing: 'step-end' },
|
||||
{ opacity: 0 },
|
||||
],
|
||||
{
|
||||
duration: 1000,
|
||||
fill: 'forwards',
|
||||
}
|
||||
);
|
||||
|
||||
anim.currentTime = 1000;
|
||||
assert_equals(getComputedStyle(target).opacity, '0');
|
||||
}, 'Interval distance is calculated correctly (precision test)');
|
||||
|
||||
</script>
|
||||
</body>
|
Loading…
Add table
Add a link
Reference in a new issue