polymer-paper-rails 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (143) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +19 -18
  3. data/app/assets/components/core-a11y-keys/core-a11y-keys.html +4 -4
  4. data/app/assets/components/core-animation/web-animations.html +1 -1
  5. data/app/assets/components/core-collapse/core-collapse.html +1 -1
  6. data/app/assets/components/core-drawer-panel/core-drawer-panel.css +14 -6
  7. data/app/assets/components/core-drawer-panel/core-drawer-panel.html +32 -8
  8. data/app/assets/components/core-dropdown/core-dropdown.html +8 -2
  9. data/app/assets/components/core-icon/core-icon.html +0 -2
  10. data/app/assets/components/core-icons/av-icons.html +2 -9
  11. data/app/assets/components/core-icons/communication-icons.html +39 -42
  12. data/app/assets/components/core-icons/core-icons.html +231 -235
  13. data/app/assets/components/core-icons/device-icons.html +75 -90
  14. data/app/assets/components/core-icons/editor-icons.html +52 -52
  15. data/app/assets/components/core-icons/hardware-icons.html +40 -41
  16. data/app/assets/components/core-icons/image-icons.html +133 -137
  17. data/app/assets/components/core-icons/maps-icons.html +55 -57
  18. data/app/assets/components/core-icons/notification-icons.html +34 -34
  19. data/app/assets/components/core-icons/social-icons.html +23 -37
  20. data/app/assets/components/core-menu/core-menu.html +8 -3
  21. data/app/assets/components/core-menu/core-submenu.html +2 -2
  22. data/app/assets/components/core-overlay/core-key-helper.html +3 -0
  23. data/app/assets/components/core-overlay/core-overlay-layer.html +3 -0
  24. data/app/assets/components/core-overlay/core-overlay.html +20 -4
  25. data/app/assets/components/core-resizable/core-resizable.html +248 -0
  26. data/app/assets/components/core-scroll-header-panel/core-scroll-header-panel.html +14 -3
  27. data/app/assets/components/core-selection/core-selection.html +1 -1
  28. data/app/assets/components/core-selector/core-selector.html +26 -26
  29. data/app/assets/components/core-style/core-style.html +1 -1
  30. data/app/assets/components/core-toolbar/core-toolbar.html +1 -1
  31. data/app/assets/components/paper-button/paper-button-base.html +56 -12
  32. data/app/assets/components/paper-button/paper-button.html +22 -5
  33. data/app/assets/components/paper-checkbox/paper-checkbox.css +65 -184
  34. data/app/assets/components/paper-checkbox/paper-checkbox.html +47 -55
  35. data/app/assets/components/paper-dialog/paper-action-dialog.html +3 -3
  36. data/app/assets/components/paper-dialog/paper-dialog.html +2 -2
  37. data/app/assets/components/paper-dropdown-menu/paper-dropdown-menu.html +4 -1
  38. data/app/assets/components/{core-elements → paper-elements}/metadata.html +0 -0
  39. data/app/assets/components/{core-elements → paper-elements}/paper-elements.html +1 -0
  40. data/app/assets/components/paper-fab/paper-fab.html +2 -2
  41. data/app/assets/components/paper-input/paper-autogrow-textarea.html +8 -3
  42. data/app/assets/components/paper-input/paper-char-counter.html +121 -0
  43. data/app/assets/components/paper-input/paper-input-decorator.css +1 -21
  44. data/app/assets/components/paper-input/paper-input-decorator.html +130 -51
  45. data/app/assets/components/paper-input/paper-input.html +31 -5
  46. data/app/assets/components/paper-item/paper-item.html +1 -2
  47. data/app/assets/components/paper-progress/paper-progress.html +1 -1
  48. data/app/assets/components/paper-radio-button/paper-radio-button.css +16 -12
  49. data/app/assets/components/paper-radio-button/paper-radio-button.html +9 -3
  50. data/app/assets/components/paper-ripple/paper-ripple.html +2 -1
  51. data/app/assets/components/paper-shadow/paper-shadow.css +10 -10
  52. data/app/assets/components/paper-shadow/paper-shadow.html +8 -1
  53. data/app/assets/components/paper-slider/paper-slider.html +28 -4
  54. data/app/assets/components/paper-spinner/paper-spinner.css +35 -23
  55. data/app/assets/components/paper-spinner/paper-spinner.html +46 -5
  56. data/app/assets/components/paper-tabs/paper-tabs.css +5 -0
  57. data/app/assets/components/paper-tabs/paper-tabs.html +32 -7
  58. data/app/assets/components/paper-toggle-button/paper-toggle-button.css +58 -30
  59. data/app/assets/components/paper-toggle-button/paper-toggle-button.html +69 -44
  60. data/app/assets/components/sampler-scaffold/sampler-scaffold.css +1 -1
  61. data/app/assets/components/web-animations-js/web-animations-next-lite.min.js +17 -0
  62. data/app/assets/components/web-animations-js/web-animations-next.min.js +17 -0
  63. data/app/assets/components/web-animations-js/web-animations.min.js +17 -0
  64. data/app/assets/components/webcomponentsjs/CustomElements.js +634 -0
  65. data/app/assets/components/webcomponentsjs/CustomElements.min.js +11 -0
  66. data/app/assets/components/webcomponentsjs/HTMLImports.js +764 -0
  67. data/app/assets/components/webcomponentsjs/HTMLImports.min.js +11 -0
  68. data/app/assets/components/webcomponentsjs/ShadowDOM.js +4277 -0
  69. data/app/assets/components/webcomponentsjs/ShadowDOM.min.js +13 -0
  70. data/app/assets/components/webcomponentsjs/package.json +31 -0
  71. data/app/assets/components/webcomponentsjs/webcomponents-lite.js +1728 -0
  72. data/app/assets/components/webcomponentsjs/webcomponents-lite.min.js +11 -0
  73. data/app/assets/components/webcomponentsjs/webcomponents.js +6114 -0
  74. data/app/assets/components/webcomponentsjs/webcomponents.min.js +14 -0
  75. data/lib/polymer-paper-rails/version.rb +1 -1
  76. metadata +20 -71
  77. data/app/assets/components/core-dropdown/metadata.html +0 -62
  78. data/app/assets/components/core-icons/png-icons.html +0 -19
  79. data/app/assets/components/core-label/core-label.html +0 -124
  80. data/app/assets/components/core-overlay/tests/html/core-overlay-basic.html +0 -127
  81. data/app/assets/components/core-overlay/tests/html/core-overlay-positioning-margin.html +0 -153
  82. data/app/assets/components/core-overlay/tests/html/core-overlay-positioning.html +0 -167
  83. data/app/assets/components/core-overlay/tests/html/core-overlay-scroll.html +0 -130
  84. data/app/assets/components/core-overlay/tests/js/htmltests.js +0 -6
  85. data/app/assets/components/core-overlay/tests/runner.html +0 -14
  86. data/app/assets/components/core-overlay/tests/tests.json +0 -6
  87. data/app/assets/components/core-popup-menu/core-popup-menu.css +0 -28
  88. data/app/assets/components/core-popup-menu/core-popup-menu.html +0 -198
  89. data/app/assets/components/core-popup-menu/core-popup-overlay.html +0 -111
  90. data/app/assets/components/core-popup-menu/metadata.html +0 -62
  91. data/app/assets/components/paper-focusable/paper-focusable.html +0 -146
  92. data/app/assets/components/platform/platform.js +0 -16
  93. data/app/assets/components/web-animations-js/web-animations.js +0 -5529
  94. data/app/assets/components/web-animations-next/Gruntfile.js +0 -279
  95. data/app/assets/components/web-animations-next/History.md +0 -76
  96. data/app/assets/components/web-animations-next/package.json +0 -33
  97. data/app/assets/components/web-animations-next/src/animation-constructor.js +0 -139
  98. data/app/assets/components/web-animations-next/src/animation-node.js +0 -31
  99. data/app/assets/components/web-animations-next/src/animation.js +0 -65
  100. data/app/assets/components/web-animations-next/src/apply-preserving-inline-style.js +0 -192
  101. data/app/assets/components/web-animations-next/src/apply.js +0 -25
  102. data/app/assets/components/web-animations-next/src/box-handler.js +0 -57
  103. data/app/assets/components/web-animations-next/src/color-handler.js +0 -62
  104. data/app/assets/components/web-animations-next/src/deprecation.js +0 -42
  105. data/app/assets/components/web-animations-next/src/dev.js +0 -16
  106. data/app/assets/components/web-animations-next/src/dimension-handler.js +0 -167
  107. data/app/assets/components/web-animations-next/src/effect-callback.js +0 -86
  108. data/app/assets/components/web-animations-next/src/effect.js +0 -110
  109. data/app/assets/components/web-animations-next/src/element-animatable.js +0 -19
  110. data/app/assets/components/web-animations-next/src/font-weight-handler.js +0 -42
  111. data/app/assets/components/web-animations-next/src/group-constructors.js +0 -81
  112. data/app/assets/components/web-animations-next/src/handler-utils.js +0 -177
  113. data/app/assets/components/web-animations-next/src/interpolation.js +0 -49
  114. data/app/assets/components/web-animations-next/src/matrix-decomposition.js +0 -452
  115. data/app/assets/components/web-animations-next/src/matrix-interpolation.js +0 -130
  116. data/app/assets/components/web-animations-next/src/maxifill-player.js +0 -162
  117. data/app/assets/components/web-animations-next/src/normalize-keyframes.js +0 -259
  118. data/app/assets/components/web-animations-next/src/number-handler.js +0 -72
  119. data/app/assets/components/web-animations-next/src/player.js +0 -193
  120. data/app/assets/components/web-animations-next/src/position-handler.js +0 -117
  121. data/app/assets/components/web-animations-next/src/property-interpolation.js +0 -62
  122. data/app/assets/components/web-animations-next/src/property-names.js +0 -35
  123. data/app/assets/components/web-animations-next/src/scope.js +0 -20
  124. data/app/assets/components/web-animations-next/src/shadow-handler.js +0 -108
  125. data/app/assets/components/web-animations-next/src/shape-handler.js +0 -85
  126. data/app/assets/components/web-animations-next/src/tick.js +0 -148
  127. data/app/assets/components/web-animations-next/src/timeline.js +0 -77
  128. data/app/assets/components/web-animations-next/src/timing-utilities.js +0 -242
  129. data/app/assets/components/web-animations-next/src/transform-handler.js +0 -262
  130. data/app/assets/components/web-animations-next/src/visibility-handler.js +0 -29
  131. data/app/assets/components/web-animations-next/target-config.js +0 -124
  132. data/app/assets/components/web-animations-next/target-loader.js +0 -13
  133. data/app/assets/components/web-animations-next/templates/boilerplate +0 -13
  134. data/app/assets/components/web-animations-next/templates/runner.html +0 -26
  135. data/app/assets/components/web-animations-next/templates/web-animations.html +0 -18
  136. data/app/assets/components/web-animations-next/templates/web-animations.js +0 -21
  137. data/app/assets/components/web-animations-next/web-animations-next-lite.dev.html +0 -44
  138. data/app/assets/components/web-animations-next/web-animations-next-lite.dev.js +0 -21
  139. data/app/assets/components/web-animations-next/web-animations-next.dev.html +0 -49
  140. data/app/assets/components/web-animations-next/web-animations-next.dev.js +0 -21
  141. data/app/assets/components/web-animations-next/web-animations.dev.html +0 -44
  142. data/app/assets/components/web-animations-next/web-animations.dev.js +0 -21
  143. data/app/assets/components/web-animations-next/web-animations.html +0 -50
@@ -1,130 +0,0 @@
1
- // Copyright 2014 Google Inc. All rights reserved.
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- (function(scope, testing) {
16
- var composeMatrix = (function() {
17
- function multiply(a, b) {
18
- var result = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]];
19
- for (var i = 0; i < 4; i++) {
20
- for (var j = 0; j < 4; j++) {
21
- for (var k = 0; k < 4; k++) {
22
- result[i][j] += b[i][k] * a[k][j];
23
- }
24
- }
25
- }
26
- return result;
27
- }
28
-
29
- function is2D(m) {
30
- return (
31
- m[0][2] == 0 &&
32
- m[0][3] == 0 &&
33
- m[1][2] == 0 &&
34
- m[1][3] == 0 &&
35
- m[2][0] == 0 &&
36
- m[2][1] == 0 &&
37
- m[2][2] == 1 &&
38
- m[2][3] == 0 &&
39
- m[3][2] == 0 &&
40
- m[3][3] == 1);
41
- }
42
-
43
- function composeMatrix(translate, scale, skew, quat, perspective) {
44
- var matrix = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]];
45
-
46
- for (var i = 0; i < 4; i++) {
47
- matrix[i][3] = perspective[i];
48
- }
49
-
50
- for (var i = 0; i < 3; i++) {
51
- for (var j = 0; j < 3; j++) {
52
- matrix[3][i] += translate[j] * matrix[j][i];
53
- }
54
- }
55
-
56
- var x = quat[0], y = quat[1], z = quat[2], w = quat[3];
57
-
58
- var rotMatrix = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]];
59
-
60
- rotMatrix[0][0] = 1 - 2 * (y * y + z * z);
61
- rotMatrix[0][1] = 2 * (x * y - z * w);
62
- rotMatrix[0][2] = 2 * (x * z + y * w);
63
- rotMatrix[1][0] = 2 * (x * y + z * w);
64
- rotMatrix[1][1] = 1 - 2 * (x * x + z * z);
65
- rotMatrix[1][2] = 2 * (y * z - x * w);
66
- rotMatrix[2][0] = 2 * (x * z - y * w);
67
- rotMatrix[2][1] = 2 * (y * z + x * w);
68
- rotMatrix[2][2] = 1 - 2 * (x * x + y * y);
69
-
70
- matrix = multiply(matrix, rotMatrix);
71
-
72
- var temp = [[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]];
73
- if (skew[2]) {
74
- temp[2][1] = skew[2];
75
- matrix = multiply(matrix, temp);
76
- }
77
-
78
- if (skew[1]) {
79
- temp[2][1] = 0;
80
- temp[2][0] = skew[0];
81
- matrix = multiply(matrix, temp);
82
- }
83
-
84
- if (skew[0]) {
85
- temp[2][0] = 0;
86
- temp[1][0] = skew[0];
87
- matrix = multiply(matrix, temp);
88
- }
89
-
90
- for (var i = 0; i < 3; i++) {
91
- for (var j = 0; j < 3; j++) {
92
- matrix[i][j] *= scale[i];
93
- }
94
- }
95
-
96
- if (is2D(matrix)) {
97
- return [matrix[0][0], matrix[0][1], matrix[1][0], matrix[1][1], matrix[3][0], matrix[3][1]];
98
- }
99
- return matrix[0].concat(matrix[1], matrix[2], matrix[3]);
100
- }
101
- return composeMatrix;
102
- })();
103
-
104
- function clamp(x, min, max) {
105
- return Math.max(Math.min(x, max), min);
106
- };
107
-
108
- function quat(fromQ, toQ, f) {
109
- var product = scope.dot(fromQ, toQ);
110
- product = clamp(product, -1.0, 1.0);
111
-
112
- var quat = [];
113
- if (product === 1.0) {
114
- quat = fromQ;
115
- } else {
116
- var theta = Math.acos(product);
117
- var w = Math.sin(f * theta) * 1 / Math.sqrt(1 - product * product);
118
-
119
- for (var i = 0; i < 4; i++) {
120
- quat.push(fromQ[i] * (Math.cos(f * theta) - product * w) +
121
- toQ[i] * w);
122
- }
123
- }
124
- return quat;
125
- }
126
-
127
- scope.composeMatrix = composeMatrix;
128
- scope.quat = quat;
129
-
130
- })(webAnimationsMinifill, webAnimationsTesting);
@@ -1,162 +0,0 @@
1
- // Copyright 2014 Google Inc. All rights reserved.
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- (function(shared, scope, testing) {
16
- scope.Player = function(source) {
17
- this.source = source;
18
- if (source) {
19
- // FIXME: detach existing player.
20
- source.player = this;
21
- }
22
- this._isGroup = false;
23
- this._player = null;
24
- this._childPlayers = [];
25
- this._callback = null;
26
- this._rebuildUnderlyingPlayer();
27
- // Players are constructed in the idle state.
28
- this._player.cancel();
29
- };
30
-
31
- // TODO: add a source getter/setter
32
- scope.Player.prototype = {
33
- _rebuildUnderlyingPlayer: function() {
34
- if (this._player) {
35
- this._player.cancel();
36
- this._player = null;
37
- }
38
-
39
- if (!this.source || this.source instanceof window.Animation) {
40
- this._player = scope.newUnderlyingPlayerForAnimation(this.source);
41
- scope.bindPlayerForAnimation(this);
42
- }
43
- if (this.source instanceof window.AnimationSequence || this.source instanceof window.AnimationGroup) {
44
- this._player = scope.newUnderlyingPlayerForGroup(this.source);
45
- scope.bindPlayerForGroup(this);
46
- }
47
-
48
- // FIXME: move existing currentTime/startTime/playState to new player
49
- },
50
- get paused() {
51
- return this._player.paused;
52
- },
53
- get playState() {
54
- return this._player.playState;
55
- },
56
- get onfinish() {
57
- return this._onfinish;
58
- },
59
- set onfinish(v) {
60
- if (typeof v == 'function') {
61
- this._onfinish = v;
62
- this._player.onfinish = (function(e) {
63
- e.target = this;
64
- v.call(this, e);
65
- }).bind(this);
66
- } else {
67
- this._player.onfinish = v;
68
- this.onfinish = this._player.onfinish;
69
- }
70
- },
71
- get currentTime() {
72
- return this._player.currentTime;
73
- },
74
- set currentTime(v) {
75
- this._player.currentTime = v;
76
- this._register();
77
- this._forEachChild(function(child, offset) {
78
- child.currentTime = v - offset;
79
- });
80
- },
81
- get startTime() {
82
- return this._player.startTime;
83
- },
84
- set startTime(v) {
85
- this._player.startTime = v;
86
- this._register();
87
- this._forEachChild(function(child, offset) {
88
- child.startTime = v + offset;
89
- });
90
- },
91
- get playbackRate() {
92
- return this._player.playbackRate;
93
- },
94
- get finished() {
95
- return this._player.finished;
96
- },
97
- play: function() {
98
- this._player.play();
99
- this._register();
100
- scope.awaitStartTime(this);
101
- this._forEachChild(function(child) {
102
- var time = child.currentTime;
103
- child.play();
104
- child.currentTime = time;
105
- });
106
- },
107
- pause: function() {
108
- this._player.pause();
109
- this._register();
110
- this._forEachChild(function(child) {
111
- child.pause();
112
- });
113
- },
114
- finish: function() {
115
- this._player.finish();
116
- this._register();
117
- // TODO: child players??
118
- },
119
- cancel: function() {
120
- this._player.cancel();
121
- this._register();
122
- this._removePlayers();
123
- },
124
- reverse: function() {
125
- this._player.reverse();
126
- scope.awaitStartTime(this);
127
- this._register();
128
- this._forEachChild(function(child, offset) {
129
- child.reverse();
130
- child.startTime = this.startTime + offset * this.playbackRate;
131
- child.currentTime = this.currentTime + offset * this.playbackRate;
132
- });
133
- },
134
- addEventListener: function(type, handler) {
135
- var wrapped = handler;
136
- if (typeof handler == 'function') {
137
- wrapped = (function(e) {
138
- e.target = this;
139
- handler.call(this, e);
140
- }).bind(this);
141
- handler._wrapper = wrapped;
142
- }
143
- this._player.addEventListener(type, wrapped);
144
- },
145
- removeEventListener: function(type, handler) {
146
- this._player.removeEventListener(type, (handler && handler._wrapper) || handler);
147
- },
148
- _removePlayers: function() {
149
- while (this._childPlayers.length)
150
- this._childPlayers.pop().cancel();
151
- },
152
- _forEachChild: function(f) {
153
- var offset = 0;
154
- this._childPlayers.forEach(function(child) {
155
- f.call(this, child, offset);
156
- if (this.source instanceof window.AnimationSequence)
157
- offset += child.source.activeDuration;
158
- }.bind(this));
159
- },
160
- };
161
-
162
- })(webAnimationsShared, webAnimationsMaxifill, webAnimationsTesting);
@@ -1,259 +0,0 @@
1
- // Copyright 2014 Google Inc. All rights reserved.
2
- //
3
- // Licensed under the Apache License, Version 2.0 (the "License");
4
- // you may not use this file except in compliance with the License.
5
- // You may obtain a copy of the License at
6
- //
7
- // http://www.apache.org/licenses/LICENSE-2.0
8
- //
9
- // Unless required by applicable law or agreed to in writing, software
10
- // distributed under the License is distributed on an "AS IS" BASIS,
11
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- // See the License for the specific language governing permissions and
13
- // limitations under the License.
14
-
15
- (function(shared, testing) {
16
- var shorthandToLonghand = {
17
- background: [
18
- 'backgroundImage',
19
- 'backgroundPosition',
20
- 'backgroundSize',
21
- 'backgroundRepeat',
22
- 'backgroundAttachment',
23
- 'backgroundOrigin',
24
- 'backgroundClip',
25
- 'backgroundColor'
26
- ],
27
- border: [
28
- 'borderTopColor',
29
- 'borderTopStyle',
30
- 'borderTopWidth',
31
- 'borderRightColor',
32
- 'borderRightStyle',
33
- 'borderRightWidth',
34
- 'borderBottomColor',
35
- 'borderBottomStyle',
36
- 'borderBottomWidth',
37
- 'borderLeftColor',
38
- 'borderLeftStyle',
39
- 'borderLeftWidth'
40
- ],
41
- borderBottom: [
42
- 'borderBottomWidth',
43
- 'borderBottomStyle',
44
- 'borderBottomColor'
45
- ],
46
- borderColor: [
47
- 'borderTopColor',
48
- 'borderRightColor',
49
- 'borderBottomColor',
50
- 'borderLeftColor'
51
- ],
52
- borderLeft: [
53
- 'borderLeftWidth',
54
- 'borderLeftStyle',
55
- 'borderLeftColor'
56
- ],
57
- borderRadius: [
58
- 'borderTopLeftRadius',
59
- 'borderTopRightRadius',
60
- 'borderBottomRightRadius',
61
- 'borderBottomLeftRadius'
62
- ],
63
- borderRight: [
64
- 'borderRightWidth',
65
- 'borderRightStyle',
66
- 'borderRightColor'
67
- ],
68
- borderTop: [
69
- 'borderTopWidth',
70
- 'borderTopStyle',
71
- 'borderTopColor'
72
- ],
73
- borderWidth: [
74
- 'borderTopWidth',
75
- 'borderRightWidth',
76
- 'borderBottomWidth',
77
- 'borderLeftWidth'
78
- ],
79
- flex: [
80
- 'flexGrow',
81
- 'flexShrink',
82
- 'flexBasis'
83
- ],
84
- font: [
85
- 'fontFamily',
86
- 'fontSize',
87
- 'fontStyle',
88
- 'fontVariant',
89
- 'fontWeight',
90
- 'lineHeight'
91
- ],
92
- margin: [
93
- 'marginTop',
94
- 'marginRight',
95
- 'marginBottom',
96
- 'marginLeft'
97
- ],
98
- outline: [
99
- 'outlineColor',
100
- 'outlineStyle',
101
- 'outlineWidth'
102
- ],
103
- padding: [
104
- 'paddingTop',
105
- 'paddingRight',
106
- 'paddingBottom',
107
- 'paddingLeft'
108
- ]
109
- };
110
-
111
- var shorthandExpanderElem = document.createElement('div');
112
-
113
- var borderWidthAliases = {
114
- thin: '1px',
115
- medium: '3px',
116
- thick: '5px'
117
- };
118
-
119
- var aliases = {
120
- borderBottomWidth: borderWidthAliases,
121
- borderLeftWidth: borderWidthAliases,
122
- borderRightWidth: borderWidthAliases,
123
- borderTopWidth: borderWidthAliases,
124
- fontSize: {
125
- 'xx-small': '60%',
126
- 'x-small': '75%',
127
- 'small': '89%',
128
- 'medium': '100%',
129
- 'large': '120%',
130
- 'x-large': '150%',
131
- 'xx-large': '200%'
132
- },
133
- fontWeight: {
134
- normal: '400',
135
- bold: '700'
136
- },
137
- outlineWidth: borderWidthAliases,
138
- textShadow: {
139
- none: '0px 0px 0px transparent'
140
- },
141
- boxShadow: {
142
- none: '0px 0px 0px 0px transparent'
143
- }
144
- };
145
-
146
- function antiAlias(property, value) {
147
- if (property in aliases) {
148
- return aliases[property][value] || value;
149
- }
150
- return value;
151
- }
152
-
153
- // This delegates parsing shorthand value syntax to the browser.
154
- function expandShorthandAndAntiAlias(property, value, result) {
155
- var longProperties = shorthandToLonghand[property];
156
- if (longProperties) {
157
- shorthandExpanderElem.style[property] = value;
158
- for (var i in longProperties) {
159
- var longProperty = longProperties[i];
160
- var longhandValue = shorthandExpanderElem.style[longProperty];
161
- result[longProperty] = antiAlias(longProperty, longhandValue);
162
- }
163
- } else {
164
- result[property] = antiAlias(property, value);
165
- }
166
- };
167
-
168
- function normalizeKeyframes(effectInput) {
169
- if (!Array.isArray(effectInput) && effectInput !== null)
170
- throw new TypeError('Keyframe effect must be null or an array of keyframes');
171
-
172
- if (effectInput == null)
173
- return [];
174
-
175
- var keyframeEffect = effectInput.map(function(originalKeyframe) {
176
- var keyframe = {};
177
- for (var member in originalKeyframe) {
178
- var memberValue = originalKeyframe[member];
179
- if (member == 'offset') {
180
- if (memberValue != null) {
181
- memberValue = Number(memberValue);
182
- if (!isFinite(memberValue))
183
- throw new TypeError('keyframe offsets must be numbers.');
184
- }
185
- } else if (member == 'composite') {
186
- throw {
187
- type: DOMException.NOT_SUPPORTED_ERR,
188
- name: 'NotSupportedError',
189
- message: 'add compositing is not supported'
190
- };
191
- } else if (member == 'easing') {
192
- memberValue = shared.toTimingFunction(memberValue);
193
- } else {
194
- memberValue = '' + memberValue;
195
- }
196
- expandShorthandAndAntiAlias(member, memberValue, keyframe);
197
- }
198
- if (keyframe.offset == undefined)
199
- keyframe.offset = null;
200
- if (keyframe.easing == undefined)
201
- keyframe.easing = shared.toTimingFunction('linear');
202
- return keyframe;
203
- });
204
-
205
- var everyFrameHasOffset = true;
206
- var looselySortedByOffset = true;
207
- var previousOffset = -Infinity;
208
- for (var i = 0; i < keyframeEffect.length; i++) {
209
- var offset = keyframeEffect[i].offset;
210
- if (offset != null) {
211
- if (offset < previousOffset) {
212
- throw {
213
- code: DOMException.INVALID_MODIFICATION_ERR,
214
- name: 'InvalidModificationError',
215
- message: 'Keyframes are not loosely sorted by offset. Sort or specify offsets.'
216
- };
217
- }
218
- previousOffset = offset;
219
- } else {
220
- everyFrameHasOffset = false;
221
- }
222
- }
223
-
224
- keyframeEffect = keyframeEffect.filter(function(keyframe) {
225
- return keyframe.offset >= 0 && keyframe.offset <= 1;
226
- });
227
-
228
- function spaceKeyframes() {
229
- var length = keyframeEffect.length;
230
- if (keyframeEffect[length - 1].offset == null)
231
- keyframeEffect[length - 1].offset = 1;
232
- if (length > 1 && keyframeEffect[0].offset == null)
233
- keyframeEffect[0].offset = 0;
234
-
235
- var previousIndex = 0;
236
- var previousOffset = keyframeEffect[0].offset;
237
- for (var i = 1; i < length; i++) {
238
- var offset = keyframeEffect[i].offset;
239
- if (offset != null) {
240
- for (var j = 1; j < i - previousIndex; j++)
241
- keyframeEffect[previousIndex + j].offset = previousOffset + (offset - previousOffset) * j / (i - previousIndex);
242
- previousIndex = i;
243
- previousOffset = offset;
244
- }
245
- }
246
- }
247
- if (!everyFrameHasOffset)
248
- spaceKeyframes();
249
-
250
- return keyframeEffect;
251
- }
252
-
253
- shared.normalizeKeyframes = normalizeKeyframes;
254
-
255
- if (WEB_ANIMATIONS_TESTING) {
256
- testing.normalizeKeyframes = normalizeKeyframes;
257
- }
258
-
259
- })(webAnimationsShared, webAnimationsTesting);