| Index: tools/perf/page_sets/tough_animation_cases/css_animations_staggered_triggering_by_inserting_new_element.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_inserting_new_element.html
|
| similarity index 69%
|
| 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_inserting_new_element.html
|
| index 52946627386247c53cd86dea0d3dc7535bbe3fa8..0553cb32a246218cbd4929b7218f53d13bc9e4e5 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_inserting_new_element.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,18 @@ var duration = 1000;
|
|
|
| var targets = [];
|
| function startAnimation(i) {
|
| - if (!targets[i]) {
|
| - targets[i] = document.createElement('target');
|
| - container.appendChild(targets[i]);
|
| - }
|
| - targets[i].animate([
|
| - {opacity: 0},
|
| - {opacity: 1},
|
| - ], duration);
|
| + if (targets[i])
|
| + targets[i].remove();
|
| + var target = document.createElement('target');
|
| + 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 +35,7 @@ requestAnimationFrame(function(t) {
|
| elapsed = 0;
|
| }
|
| requestAnimationFrame(staggeredStart);
|
| - });
|
| + }
|
| + requestAnimationFrame(staggeredStart);
|
| });
|
| -</script>
|
| +</script>
|
|
|