Index: tools/perf/page_sets/perf_week/css-animations-staggered-chaining-by-inserting-new-element.html |
diff --git a/tools/perf/page_sets/perf_week/css-animations-staggered-chaining-by-inserting-new-element.html b/tools/perf/page_sets/perf_week/css-animations-staggered-chaining-by-inserting-new-element.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c4a7a94dbf2b14b680f58fe31e83cc345f5c2574 |
--- /dev/null |
+++ b/tools/perf/page_sets/perf_week/css-animations-staggered-chaining-by-inserting-new-element.html |
@@ -0,0 +1,59 @@ |
+<!doctype html> |
+<meta name="viewport" content="width=device-width, user-scalable=no"> |
+<container id="container"></container> |
+<script> |
+var N = 1000; |
+var duration = 1000; |
+ |
+function startAnimation() { |
+ var target = document.createElement('target'); |
+ target.i = 1; |
+ container.appendChild(target); |
+ target.addEventListener('webkitAnimationEnd', function(e) { |
+ e.target.remove(); |
+ startAnimation(); |
+ }); |
+} |
+ |
+requestAnimationFrame(function(t) { |
+ var base = t; |
+ var i = 0; |
+ |
+ function staggeredStart(t) { |
+ elapsed = t - base; |
+ for (; i < N * elapsed / duration; i++) { |
+ startAnimation(); |
+ } |
+ if (i < N) { |
+ requestAnimationFrame(staggeredStart); |
+ } else { |
+ window.measurementReady = true; |
+ } |
+ } |
+ requestAnimationFrame(staggeredStart); |
+}); |
+</script> |
+ |
+<style> |
+target { |
+ display: inline-block; |
+ width: 9px; height: 9px; |
+ background: orange; |
+ -webkit-animation: anim1 1s; |
+} |
+@-webkit-keyframes anim1 { |
+ 0% { opacity: 0; } |
+ 100% { opacity: 1; } |
+} |
+body { |
+ margin: 0; |
+ overflow: hidden; |
+} |
+container { |
+ display: flex; |
+ flex-flow: row wrap; |
+ width: 550px; |
+ height: 800px; |
+ background: magenta; |
+} |
+</style> |