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/css_transitions_simultaneous_by_updating_inline_style.html b/tools/perf/page_sets/tough_animation_cases/css_animations_simultaneous_by_inserting_new_element.html |
similarity index 51% |
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/css_animations_simultaneous_by_inserting_new_element.html |
index 86c73b411f4e844930a115aad2fd1874a62aa1a4..3352f1efdd23e494f35b5c3409bcb606bd90d1a6 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/css_animations_simultaneous_by_inserting_new_element.html |
@@ -1,7 +1,7 @@ |
<!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"> |
-<link rel="stylesheet" type="text/css" href="resources/transition.css"> |
<script src="resources/perftesthelper.js"></script> |
<container id="container"></container> |
@@ -9,25 +9,21 @@ |
<script> |
var N = PerfTestHelper.getN(1000); |
var duration = 1000; |
-var targets = []; |
-var keyframe = 1; |
-var keyframeValues = [0, 1] |
-for (var i = 0; i < N; i++) { |
+function startAnimation() { |
var target = document.createElement('target'); |
container.appendChild(target); |
- targets.push(target); |
} |
-function startAllTransitions() { |
- keyframe ^= 1; |
- targets.forEach(function(target) { |
- target.style.opacity = keyframeValues[keyframe]; |
- }); |
+function startAllAnimations() { |
+ container.textContent = ''; |
+ for (var i = 0; i < N; i++) { |
+ startAnimation(); |
+ } |
} |
-requestAnimationFrame(startAllTransitions); |
-setInterval(startAllTransitions, duration); |
+startAllAnimations(); |
+setInterval(startAllAnimations, duration); |
PerfTestHelper.signalReady(); |
</script> |