3 <object id=
"svg-content" data=
"resources/Cowboy.svg" width=
"400px" height=
"400px" type=
"image/svg+xml">
6 <script src=
"../resources/runner.js"></script>
10 var loop_iterations
= 5;
11 var ANIMATION_ITERATIONS
= 5;
18 return window
.performance
? performance
.now() : Date
.now();
20 var init = function(){
21 animation_loop
= ANIMATION_ITERATIONS
;
26 requestAnimationFrame(step
);
28 var step = function(){
30 if (animation_loop
==0){
31 animation_loop
= ANIMATION_ITERATIONS
;
43 results
.push(now()-startTime
);
44 if (loop_iterations
>0)
47 PerfTestRunner
.logStatistics(results
, 'ms', "Time:");
48 if (testRunner
) testRunner
.notifyDone();
56 svgContent
.style
.transform
='matrix('+delta
+',0,0,'+delta
+',0,0)';
59 if (animation_loop
>ANIMATION_ITERATIONS
/2) delta
+= 80;
61 svgContent
.style
.transform
='matrix(2,0,0,2,'+delta
+',0)';
65 svgContent
.style
.transform
='matrix('+delta
+',0,0,'+delta
+',0,0)';
68 requestAnimationFrame(step
);
70 window
.onload = function(){
71 svgContent
= document
.getElementById('svg-content').contentDocument
.documentElement
;