| Index: tools/perf/page_sets/perf_week/css-animations-staggered-chaining-by-updating-inline-style.html
|
| diff --git a/tools/perf/page_sets/perf_week/css-animations-staggered-chaining-by-updating-inline-style.html b/tools/perf/page_sets/perf_week/css-animations-staggered-chaining-by-updating-inline-style.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..695afb39d2ae7160d6d140057f7cd34b9b1c7c67
|
| --- /dev/null
|
| +++ b/tools/perf/page_sets/perf_week/css-animations-staggered-chaining-by-updating-inline-style.html
|
| @@ -0,0 +1,62 @@
|
| +<!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.style.webkitAnimationName = 'anim' + (1 + e.target.i++ % 2);
|
| + });
|
| +}
|
| +
|
| +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; }
|
| +}
|
| +@-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>
|
|
|