| Index: tools/perf/page_sets/tough_animation_cases/css_animations_staggered_triggering_by_updating_inline_style.html
|
| diff --git a/tools/perf/page_sets/tough_animation_cases/web_animations_staggered_triggering.html b/tools/perf/page_sets/tough_animation_cases/css_animations_staggered_triggering_by_updating_inline_style.html
|
| similarity index 63%
|
| copy from tools/perf/page_sets/tough_animation_cases/web_animations_staggered_triggering.html
|
| copy to tools/perf/page_sets/tough_animation_cases/css_animations_staggered_triggering_by_updating_inline_style.html
|
| index 52946627386247c53cd86dea0d3dc7535bbe3fa8..f8f0a6b1d3a4c325655c9fdf7a555d1414b6bdbe 100644
|
| --- a/tools/perf/page_sets/tough_animation_cases/web_animations_staggered_triggering.html
|
| +++ b/tools/perf/page_sets/tough_animation_cases/css_animations_staggered_triggering_by_updating_inline_style.html
|
| @@ -1,8 +1,8 @@
|
| <!DOCTYPE html>
|
| <meta name="viewport" content="width=device-width, user-scalable=no">
|
| +<link rel="stylesheet" type="text/css" href="resources/animation.css">
|
| <link rel="stylesheet" type="text/css" href="resources/tablet.css">
|
| <script src="resources/perftesthelper.js"></script>
|
| -<script src="resources/web_animations_api_check.js"></script>
|
|
|
| <container id="container"></container>
|
|
|
| @@ -12,21 +12,22 @@ var duration = 1000;
|
|
|
| var targets = [];
|
| function startAnimation(i) {
|
| - if (!targets[i]) {
|
| - targets[i] = document.createElement('target');
|
| - container.appendChild(targets[i]);
|
| + if (targets[i]) {
|
| + targets[i].style.webkitAnimationName = ((targets[i].i++) % 2 ? '' : 'reverse-') + 'anim';
|
| + targets[i].classList.toggle('anim');
|
| + return;
|
| }
|
| - targets[i].animate([
|
| - {opacity: 0},
|
| - {opacity: 1},
|
| - ], duration);
|
| + var target = document.createElement('target');
|
| + target.i = 0;
|
| + container.appendChild(target);
|
| + targets[i] = target;
|
| }
|
|
|
| requestAnimationFrame(function(t) {
|
| var base = t;
|
| var i = 0;
|
|
|
| - requestAnimationFrame(function staggeredStart(t) {
|
| + function staggeredStart(t) {
|
| var elapsed = t - base;
|
| for (; i < N && i < N * elapsed / duration; i++) {
|
| startAnimation(i);
|
| @@ -38,6 +39,7 @@ requestAnimationFrame(function(t) {
|
| elapsed = 0;
|
| }
|
| requestAnimationFrame(staggeredStart);
|
| - });
|
| + }
|
| + requestAnimationFrame(staggeredStart);
|
| });
|
| </script>
|
|
|