Commit 6e6659f6 authored by Kevin Ellis's avatar Kevin Ellis Committed by Commit Bot

Augment set of WPT tests for interpolation of transform lists.

This patch improves test coverage for the interpolation of transform lists. Specifically, the new tests cover:
* mismatched list lengths with a partial prefix match
* mix of exact and primitive (e.g. scaleX & scaleY --> scale) matches

These new tests fail in Chrome without the patch (https://chromium-review.googlesource.com/c/chromium/src/+/1372025) to implement the algorithm outlined in transforms spec (https://drafts.csswg.org/css-transforms-1/#interpolation-of-transforms), but pass when tested in Firefox version 64.0.


Bug: 918643

Change-Id: I65bfe5b3c13c2fb33b3d2b926dc153135b140a63
Reviewed-on: https://chromium-review.googlesource.com/c/1393460Reviewed-by: default avatarIan Vollick <vollick@chromium.org>
Commit-Queue: Kevin Ellis <kevers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619635}
parent e3d0df76
......@@ -23,5 +23,15 @@ PASS Complete mismatch (except length): "scale(2) rotate(0deg) translate(100px)"
PASS Complete mismatch (except length): Animation between "scale(2) rotate(0deg) translate(100px)" and "rotate(720deg) scale(2) translate(200px)" at progress 0.25
PASS Complete mismatch including length: "scale(2) rotate(0deg)" and "rotate(720deg) scale(2) translate(200px)" are valid transform values
PASS Complete mismatch including length: Animation between "scale(2) rotate(0deg)" and "rotate(720deg) scale(2) translate(200px)" at progress 0.25
PASS Mismatched lengths (from is shorter), partial match: "rotate(0deg) scaleX(1)" and "rotate(720deg) translateX(0px) scaleX(2)" are valid transform values
FAIL Mismatched lengths (from is shorter), partial match: Animation between "rotate(0deg) scaleX(1)" and "rotate(720deg) translateX(0px) scaleX(2)" at progress 0.25 assert_equals: expected "matrix(-1.25, 0, 0, -1, 0, 0)" but got "matrix(1.25, 0, 0, 1, 0, 0)"
PASS Mismatched lengths (to is shorter), partial match: "rotate(720deg) translateX(0px) scaleX(2)" and "rotate(0deg) scaleX(1)" are valid transform values
FAIL Mismatched lengths (to is shorter), partial match: Animation between "rotate(720deg) translateX(0px) scaleX(2)" and "rotate(0deg) scaleX(1)" at progress 0.25 assert_equals: expected "matrix(-1.75, 0, 0, -1, 0, 0)" but got "matrix(1.75, 0, 0, 1, 0, 0)"
PASS Mismatched lengths (from is shorter), partial match on primitive: "scaleX(-3) scaleY(2)" and "scaleY(-3) translateX(0px) scaleX(2)" are valid transform values
FAIL Mismatched lengths (from is shorter), partial match on primitive: Animation between "scaleX(-3) scaleY(2)" and "scaleY(-3) translateX(0px) scaleX(2)" at progress 0.25 assert_equals: expected "matrix(-2.5, 0, 0, 0, 0, 0)" but got "matrix(-1.75, 0, 0, 0.75, 0, 0)"
PASS Mismatched lengths (to is shorter), partial match on primitive: "scaleY(-3) translateX(0px) scaleX(2)" and "scaleX(-3) scaleY(2)" are valid transform values
FAIL Mismatched lengths (to is shorter), partial match on primitive: Animation between "scaleY(-3) translateX(0px) scaleX(2)" and "scaleX(-3) scaleY(2)" at progress 0.25 assert_equals: expected "matrix(0, 0, 0, -2.5, 0, 0)" but got "matrix(0.75, 0, 0, -1.75, 0, 0)"
PASS Common prefix on primitive: "scaleY(-3) translateX(0px)" and "scaleX(-3) scaleY(2)" are valid transform values
FAIL Common prefix on primitive: Animation between "scaleY(-3) translateX(0px)" and "scaleX(-3) scaleY(2)" at progress 0.25 assert_equals: expected "matrix(0, 0, 0, -2.5, 0, 0)" but got "matrix(0, 0, 0, -1.75, 0, 0)"
Harness: the test ran to completion.
......@@ -135,6 +135,56 @@ test_interpolation(
[{ at: 0.25, expect: 'matrix(2, 0, 0, 2, 100, 0)' }],
'Complete mismatch including length'
);
test_interpolation(
{
property: 'transform',
from: 'rotate(0deg) scaleX(1)',
to: 'rotate(720deg) translateX(0px) scaleX(2)'
},
[{at: 0.25, expect: 'rotate(180deg) matrix(1.25, 0, 0, 1, 0, 0)'}],
'Mismatched lengths (from is shorter), partial match'
);
test_interpolation(
{
property: 'transform',
from: 'rotate(720deg) translateX(0px) scaleX(2)',
to: 'rotate(0deg) scaleX(1)'
},
[{at: 0.25, expect: 'rotate(540deg) matrix(1.75, 0, 0, 1, 0, 0)'}],
'Mismatched lengths (to is shorter), partial match'
);
test_interpolation(
{
property: 'transform',
from: 'scaleX(-3) scaleY(2)',
to: 'scaleY(-3) translateX(0px) scaleX(2)'
},
[{at: 0.25, expect: 'scale(-2, 0) matrix(1.25, 0, 0, 1.75, 0, 0)'}],
'Mismatched lengths (from is shorter), partial match on primitive'
);
test_interpolation(
{
property: 'transform',
from: 'scaleY(-3) translateX(0px) scaleX(2)',
to: 'scaleX(-3) scaleY(2)'
},
[{at: 0.25, expect: 'scale(0, -2) matrix(1.75, 0, 0, 1.25, 0, 0)'}],
'Mismatched lengths (to is shorter), partial match on primitive'
);
test_interpolation(
{
property: 'transform',
from: 'scaleY(-3) translateX(0px)',
to: 'scaleX(-3) scaleY(2)'
},
[{at: 0.25, expect: 'scale(0, -2) matrix(1, 0, 0, 1.25, 0, 0)'}],
'Common prefix on primitive'
);
</script>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment