Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: tools/perf/page_sets/tough_animation_cases/css_transitions_simultaneous_by_updating_class.html

Issue 399393002: Add CSS Transitions performance tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Appease linter Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta name="viewport" content="width=device-width, user-scalable=no">
3 <link rel="stylesheet" type="text/css" href="resources/tablet.css">
4 <link rel="stylesheet" type="text/css" href="resources/transition.css">
5 <script src="resources/perftesthelper.js"></script>
6 <style>
7 .keyframe0 {
8 opacity: 0;
9 }
10 .keyframe1 {
11 opacity: 1;
12 }
13 </style>
14
15 <container id="container"></container>
16
17 <script>
18 var N = PerfTestHelper.getN(1000);
19 var duration = 1000;
20 var keyframe = 1;
21 var targets = [];
22
23 for (var i = 0; i < N; i++) {
24 var target = document.createElement('target');
25 container.appendChild(target);
26 targets.push(target);
27 }
28
29 function startAllTransitions() {
30 keyframe ^= 1;
31 targets.forEach(function(target) {
32 target.className = 'keyframe' + keyframe;
33 });
34 }
35
36 requestAnimationFrame(startAllTransitions);
37 setInterval(startAllTransitions, duration);
38
39 PerfTestHelper.signalReady();
40 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698