2009-11-12 Jeffrey Stedfast <fejj@novell.com>
[moon.git] / perf / perf-suite-set / storyboard-attack.html
blob937845d6ea5c27825296ca5b065870dacd78c3f6
1 <html>
2 <head>
3 <style type="text/css">
4 body {
5 margin-left: 0;
6 margin-top: 0;
7 padding: 0;
8 };
10 embed {
11 margin-left: 0;
12 margin-top: 0;
13 margin-right: 0;
14 margin-bottom: 0;
16 </style>
17 </head>
18 <body>
19 <script type="text/javascript">
21 function CreateRectangle(l, t, i, sj, master)
23 var xaml =
24 '<Rectangle xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" \
25 x:Name="rect%no%" Canvas.Left="%left%" Canvas.Top="%top%" Width="5" Height="5" Fill="Black"> \
26 <Rectangle.Resources> \
27 <Storyboard x:Name="sb%no%"> \
28 <DoubleAnimation \
29 Storyboard.TargetName="rect%no%" \
30 Storyboard.TargetProperty="(Canvas.Left)" \
31 To="195" Duration="0:0:4" /> \
32 <DoubleAnimation \
33 Storyboard.TargetName="rect%no%" \
34 Storyboard.TargetProperty="(Canvas.Top)" \
35 To="195" Duration="0:0:4" /> \
36 </Storyboard> \
37 </Rectangle.Resources> \
38 </Rectangle>';
40 xaml = xaml.replace(/%no%/g, i);
41 xaml = xaml.replace(/%top%/g, t);
42 xaml = xaml.replace(/%left%/g, l);
44 var obj = sj.createFromXaml(xaml);
45 master.Children.Add(obj);
46 master.findName ("sb%no%".replace('%no%', i)).Begin ();
49 function OnLoaded (sender)
51 var SJ = document.getElementById ("slControl").content;
52 var master = sender.findName("MasterCanvas");
54 for (i = 0; i < 40; i++)
55 xaml = CreateRectangle (0, i * 10, i, SJ, master);
57 for (i = 40; i < 80; i++)
58 xaml = CreateRectangle (390, (i - 40) * 10, i, SJ, master);
60 for (i = 80; i < 120; i++)
61 xaml = CreateRectangle ((i - 80) * 10, 0, i, SJ, master);
63 for (i = 120; i < 160; i++)
64 xaml = CreateRectangle ((i - 120) * 10, 390, i, SJ, master);
66 </script>
68 <embed type="application/x-silverlight" data="data:," id="slControl" width="400" height="400" source="#xamlContent" windowless="true">
69 </embed>
70 <script type="text/xaml" id="xamlContent">
71 <?xml version="1.0"?>
72 <Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
73 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="MasterCanvas" Loaded="OnLoaded">
74 </Canvas>
75 </script>
76 </body>
77 </html>