| Index: pkg/polymer/lib/elements/web-animations-js/test/testcases/auto-test-transform-units.html
|
| diff --git a/pkg/polymer/lib/elements/web-animations-js/test/testcases/auto-test-transform-units.html b/pkg/polymer/lib/elements/web-animations-js/test/testcases/auto-test-transform-units.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..1ac3f4451613882d36760e7b0169c2bb219df65a
|
| --- /dev/null
|
| +++ b/pkg/polymer/lib/elements/web-animations-js/test/testcases/auto-test-transform-units.html
|
| @@ -0,0 +1,97 @@
|
| +<!--
|
| +Copyright 2012 Google Inc. All Rights Reserved.
|
| +
|
| +Licensed under the Apache License, Version 2.0 (the "License");
|
| +you may not use this file except in compliance with the License.
|
| +You may obtain a copy of the License at
|
| +
|
| + http://www.apache.org/licenses/LICENSE-2.0
|
| +
|
| +Unless required by applicable law or agreed to in writing, software
|
| +distributed under the License is distributed on an "AS IS" BASIS,
|
| +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| +See the License for the specific language governing permissions and
|
| +limitations under the License.
|
| +-->
|
| +
|
| +<!DOCTYPE html><meta charset="UTF-8">
|
| +<style>
|
| +.anim {
|
| + left: 0px;
|
| + width: 30px;
|
| + height: 30px;
|
| + background-color: lightsteelblue;
|
| + position: absolute;
|
| +}
|
| +
|
| +.expected {
|
| + width: 30px;
|
| + height: 30px;
|
| + position: absolute;
|
| + background-color: red;
|
| +}
|
| +</style>
|
| +<div style="height: 400px"></div>
|
| +
|
| +<script>
|
| +var expected_failures = {
|
| + '/Autogenerated .*/': {
|
| + msie: true,
|
| + message: "Floating point issues."
|
| + }
|
| +};
|
| +</script>
|
| +<script src="../bootstrap.js"></script>
|
| +<script>
|
| +"use strict";
|
| +
|
| +var transformValues = [
|
| + ['translate(0px, 0px)', 'translate(10em)', 'translate(10%, 1in)'],
|
| + ['rotate(0deg)', 'rotate(50deg)', 'rotate(3rad)', 'rotate(200grad)'],
|
| + ['skew(0deg)', 'skew(20rad)', 'skew(40grad, 20rad)'],
|
| + ['skewX(0deg)', 'skewX(20grad)', 'skewX(40rad)'],
|
| + ['skewY(0deg)', 'skewY(20rad)', 'skewY(40grad)']
|
| +];
|
| +
|
| +var separation_x = 100;
|
| +var separation_y = 50;
|
| +var max_x = 1000;
|
| +
|
| +var toplevel = document.querySelector("div");
|
| +var y = 50;
|
| +var animations = [];
|
| +for (var i = 0; i < transformValues.length; i++) {
|
| + var x = 10;
|
| + for (var j = 0; j < transformValues[i].length; j++) {
|
| + for (var k = 0; k < transformValues[i].length; k++) {
|
| + if (j == k) {
|
| + continue;
|
| + }
|
| + toplevel.appendChild(document.createElement("div"));
|
| + var div = toplevel.lastChild;
|
| + div.className = "expected";
|
| + div.style.top = y + 'px';
|
| + div.style.left = x + 'px';
|
| + div.style[test_features.transformProperty] = transformValues[i][k];
|
| + toplevel.appendChild(document.createElement("div"));
|
| + var div = toplevel.lastChild;
|
| + div.className = "anim";
|
| + div.style.top = y + 'px';
|
| + div.style.left = x + 'px';
|
| + div.id = "i" + i + "_" + j + "_" + k
|
| + animations.push(new Animation(div, [
|
| + {transform: transformValues[i][j]},
|
| + {transform: transformValues[i][k]},
|
| + ], {duration: 2, fill: 'forwards'}));
|
| + x += separation_x;
|
| + if (x > max_x) {
|
| + x = 20;
|
| + y += separation_y;
|
| + }
|
| + }
|
| + }
|
| + y += separation_y;
|
| +}
|
| +
|
| +animations.forEach(function(anim) { document.timeline.play(anim); });
|
| +</script>
|
|
|