From 3f09a2946b21e65579a0add850a0ae7c298c0ff7 Mon Sep 17 00:00:00 2001 From: Jeremy Chen Date: Thu, 20 Jul 2017 15:30:53 +0800 Subject: [PATCH] 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 --- .../animation-types/property-types.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/testing/web-platform/tests/web-animations/animation-model/animation-types/property-types.js b/testing/web-platform/tests/web-animations/animation-model/animation-types/property-types.js index 19569f327630..382d8ccc56ba 100644 --- a/testing/web-platform/tests/web-animations/animation-model/animation-types/property-types.js +++ b/testing/web-platform/tests/web-animations/animation-model/animation-types/property-types.js @@ -884,6 +884,25 @@ const transformListType = { [{ time: 500, expected: rotate3dToMatrix(1, 1, 0, Math.PI * 2 / 4) }]); }, 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) {