Index: tools/perf/page_sets/tough_animation_cases/css_animations_simultaneous_by_inserting_new_element.html |
diff --git a/tools/perf/page_sets/tough_animation_cases/web_animations_simultaneous.html b/tools/perf/page_sets/tough_animation_cases/css_animations_simultaneous_by_inserting_new_element.html |
similarity index 58% |
copy from tools/perf/page_sets/tough_animation_cases/web_animations_simultaneous.html |
copy to tools/perf/page_sets/tough_animation_cases/css_animations_simultaneous_by_inserting_new_element.html |
index 17c961791a61808b1416d778582cc9703031ebfc..3352f1efdd23e494f35b5c3409bcb606bd90d1a6 100644 |
--- a/tools/perf/page_sets/tough_animation_cases/web_animations_simultaneous.html |
+++ b/tools/perf/page_sets/tough_animation_cases/css_animations_simultaneous_by_inserting_new_element.html |
@@ -1,36 +1,29 @@ |
<!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> |
<script> |
var N = PerfTestHelper.getN(1000); |
var duration = 1000; |
-var targets = []; |
-function startAnimation(element) { |
- element.animate([ |
- {opacity: 0}, |
- {opacity: 1}, |
- ], duration); |
+function startAnimation() { |
+ var target = document.createElement('target'); |
+ container.appendChild(target); |
} |
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'); |
- container.appendChild(target); |
- targets.push(target); |
+ container.textContent = ''; |
+ for (var i = 0; i < N; i++) { |
+ startAnimation(); |
+ } |
} |
startAllAnimations(); |
+setInterval(startAllAnimations, duration); |
PerfTestHelper.signalReady(); |
</script> |