Bug 1382517 - add wpt interpolation test for mismatched 3D transforms. r=hiro

This test aims for forcing the two mismatched transforms to be decomposed into
matrix3d before interpolation. To do so, we need to:

1. make 'From' and 'To' to be two mismatched transforms,
2. at least one of the two transforms has to be a 3D transform.

In this way, we not only test the interpolation, but also test the correctness
of 3D matrix decomposition.

MozReview-Commit-ID: FAKu6GFVZRm

--HG--
extra : rebase_source : d590791d93ef28f2f0e7dc7957bc413fe60faa7b
This commit is contained in:
Jeremy Chen 2017-07-20 15:30:53 +08:00
Родитель 84df6e8c7e
Коммит 3f09a2946b
1 изменённых файлов: 19 добавлений и 0 удалений

Просмотреть файл

@ -884,6 +884,25 @@ const transformListType = {
[{ time: 500, expected: rotate3dToMatrix(1, 1, 0, Math.PI * 2 / 4) }]); [{ time: 500, expected: rotate3dToMatrix(1, 1, 0, Math.PI * 2 / 4) }]);
}, property + ': matrix3d'); }, property + ': matrix3d');
// This test aims for forcing the two mismatched transforms to be
// decomposed into matrix3d before interpolation. Therefore, we not only
// test the interpolation, but also test the 3D matrix decomposition.
test(function(t) {
var idlName = propertyToIDL(property);
var target = createTestElement(t, setup);
var animation =
target.animate({ [idlName]: ['scale(0.3)',
// scale(0.5) translateZ(1px)
'matrix3d(0.5, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1)'] },
1000);
testAnimationSampleMatrices(animation, idlName,
[{ time: 500, expected: [ 0.4, 0, 0, 0,
0, 0.4, 0, 0,
0, 0, 1, 0,
0, 0, 0.5, 1] }]);
}, property + ': mismatched 3D transforms');
}, },
testAddition: function(property, setup) { testAddition: function(property, setup) {