1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | (function(scope, testing) {
|
16 |
|
17 | var prefixed = {};
|
18 | var unprefixed = {};
|
19 |
|
20 | function alias(name, aliases) {
|
21 | aliases.concat([name]).forEach(function(candidate) {
|
22 | if (candidate in document.documentElement.style) {
|
23 | prefixed[name] = candidate;
|
24 | }
|
25 | unprefixed[candidate] = name;
|
26 | });
|
27 | }
|
28 | alias('transform', ['webkitTransform', 'msTransform']);
|
29 | alias('transformOrigin', ['webkitTransformOrigin']);
|
30 | alias('perspective', ['webkitPerspective']);
|
31 | alias('perspectiveOrigin', ['webkitPerspectiveOrigin']);
|
32 |
|
33 | scope.propertyName = function(property) {
|
34 | return prefixed[property] || property;
|
35 | };
|
36 | scope.unprefixedPropertyName = function(property) {
|
37 | return unprefixed[property] || property;
|
38 | };
|
39 |
|
40 | })(webAnimations1, webAnimationsTesting);
|