Index: tools/perf/page_sets/perf_week/css-animations-staggered-chaining-by-updating-class.html |
diff --git a/tools/perf/page_sets/perf_week/css-animations-staggered-chaining-by-updating-class.html b/tools/perf/page_sets/perf_week/css-animations-staggered-chaining-by-updating-class.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9a96c0fb067e1329701c7c1489c788a57e003683 |
--- /dev/null |
+++ b/tools/perf/page_sets/perf_week/css-animations-staggered-chaining-by-updating-class.html |
@@ -0,0 +1,64 @@ |
+<!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'); |
+ container.appendChild(target); |
+ target.addEventListener('webkitAnimationEnd', function(e) { |
+ e.target.classList.toggle('anim'); |
+ }); |
+} |
+ |
+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; |
+} |
+target.anim { |
+ -webkit-animation: anim2 1s; |
+} |
+@-webkit-keyframes anim1 { |
+ 0% { opacity: 0; } |
+ 100% { opacity: 1; } |
+} |
+@-webkit-keyframes anim2 { |
+ 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> |