| Index: tools/perf/page_sets/perf_week/css-animations-many-keyframes.html
|
| diff --git a/tools/perf/page_sets/perf_week/css-animations-many-keyframes.html b/tools/perf/page_sets/perf_week/css-animations-many-keyframes.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..921bfd718b0d95ef2bccaaaf61f065ad2648ba7e
|
| --- /dev/null
|
| +++ b/tools/perf/page_sets/perf_week/css-animations-many-keyframes.html
|
| @@ -0,0 +1,55 @@
|
| +<!doctype html>
|
| +<meta name="viewport" content="width=device-width, user-scalable=no">
|
| +<container id="container"></container>
|
| +<script>
|
| +var N = 400;
|
| +var numKeyframes = 500;
|
| +var duration = 4000;
|
| +
|
| +function makeKeyframes(numKeyframes, width, height) {
|
| + var keyframes = '@-webkit-keyframes anim {\n'
|
| + for (var i = 0; i < numKeyframes + 1; i++) {
|
| + var fraction = i / numKeyframes;
|
| + var t = fraction * 2 * Math.PI;
|
| + var x = Math.cos(t) - Math.pow(Math.cos(4*t), 3);
|
| + x = ((x/4 + 1/2) * width).toFixed(5);
|
| + var y = Math.pow(Math.sin(4*t), 3) - Math.sin(2*t);
|
| + y = ((y/4 + 1/2) * height).toFixed(5);
|
| + keyframes += (fraction*100) + '% { transform: translate(' + x + 'px, ' + y + 'px) }\n';
|
| + }
|
| + return keyframes;
|
| +}
|
| +
|
| +var style = document.createElement('style');
|
| +style.textContent = makeKeyframes(numKeyframes, 550, 800);
|
| +
|
| +for (var i = 0; i < N; i++) {
|
| + var target = document.createElement('target');
|
| + target.style.webkitAnimation = 'anim ' + duration + 'ms linear infinite -' + duration/10 * i/N + 'ms';
|
| + container.appendChild(target);
|
| +}
|
| +
|
| +container.appendChild(style);
|
| +
|
| +requestAnimationFrame(function() {
|
| + measurementReady = true;
|
| +});
|
| +</script>
|
| +
|
| +<style>
|
| +body {
|
| + margin: 0;
|
| + overflow: hidden;
|
| +}
|
| +target {
|
| + position: absolute;
|
| + border: 5px solid green;
|
| + border-radius: 100%;
|
| +}
|
| +container {
|
| + position: absolute;
|
| + width: 550px;
|
| + height: 800px;
|
| + background-color: lightgrey;
|
| +}
|
| +</style>
|
|
|