| Index: tools/perf/page_sets/tough_animation_cases/web_animations_simultaneous.html
|
| diff --git a/tools/perf/page_sets/tough_animation_cases/css_transitions_simultaneous_by_updating_inline_style.html b/tools/perf/page_sets/tough_animation_cases/web_animations_simultaneous.html
|
| similarity index 59%
|
| copy from tools/perf/page_sets/tough_animation_cases/css_transitions_simultaneous_by_updating_inline_style.html
|
| copy to tools/perf/page_sets/tough_animation_cases/web_animations_simultaneous.html
|
| index 86c73b411f4e844930a115aad2fd1874a62aa1a4..17c961791a61808b1416d778582cc9703031ebfc 100644
|
| --- a/tools/perf/page_sets/tough_animation_cases/css_transitions_simultaneous_by_updating_inline_style.html
|
| +++ b/tools/perf/page_sets/tough_animation_cases/web_animations_simultaneous.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/tablet.css">
|
| -<link rel="stylesheet" type="text/css" href="resources/transition.css">
|
| <script src="resources/perftesthelper.js"></script>
|
| +<script src="resources/web_animations_api_check.js"></script>
|
|
|
| <container id="container"></container>
|
|
|
| @@ -10,8 +10,19 @@
|
| var N = PerfTestHelper.getN(1000);
|
| var duration = 1000;
|
| var targets = [];
|
| -var keyframe = 1;
|
| -var keyframeValues = [0, 1]
|
| +
|
| +function startAnimation(element) {
|
| + element.animate([
|
| + {opacity: 0},
|
| + {opacity: 1},
|
| + ], duration);
|
| +}
|
| +
|
| +function startAllAnimations() {
|
| + for (var i in targets)
|
| + startAnimation(targets[i]);
|
| + setTimeout(startAllAnimations, duration);
|
| +}
|
|
|
| for (var i = 0; i < N; i++) {
|
| var target = document.createElement('target');
|
| @@ -19,15 +30,7 @@ for (var i = 0; i < N; i++) {
|
| targets.push(target);
|
| }
|
|
|
| -function startAllTransitions() {
|
| - keyframe ^= 1;
|
| - targets.forEach(function(target) {
|
| - target.style.opacity = keyframeValues[keyframe];
|
| - });
|
| -}
|
| -
|
| -requestAnimationFrame(startAllTransitions);
|
| -setInterval(startAllTransitions, duration);
|
| +startAllAnimations();
|
|
|
| PerfTestHelper.signalReady();
|
| </script>
|
|
|