~ubuntu-branches/ubuntu/karmic/moon/karmic

« back to all changes in this revision

Viewing changes to test/xaml/enums/fillrule-polyline.html

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2009-02-14 12:01:08 UTC
  • Revision ID: james.westby@ubuntu.com-20090214120108-06539vb25vhbd8bn
Tags: upstream-1.0
ImportĀ upstreamĀ versionĀ 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
  <head>
 
3
      <title>FillRule (Polyline) Test Page</title>
 
4
 
 
5
      <script language="javascript" src="Silverlight.js"></script>
 
6
 
 
7
      <script type="text/xaml" id="xaml">
 
8
        <Canvas x:Name="canvas" xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="100" Height="100" Loaded="onLoaded">
 
9
 
 
10
                <Polyline Fill="#000000" Stroke="#FF00FF" StrokeThickness="4" Points="20,80 50,20 80,80 20,40 80,40" RenderTransform="1,0,0,1,0,0" />
 
11
                <Polyline Fill="#000000" Stroke="#FF00FF" StrokeThickness="4" Points="20,80 50,20 80,80 20,40 80,40" RenderTransform="1,0,0,1,100,0" FillRule="EvenOdd" />
 
12
                <Polyline Fill="#000000" Stroke="#FF00FF" StrokeThickness="4" Points="20,80 50,20 80,80 20,40 80,40" RenderTransform="1,0,0,1,200,0" FillRule="Nonzero" />
 
13
 
 
14
                <Polyline x:Name="testcase1" Fill="#000000" Stroke="#FF00FF" StrokeThickness="4" Points="20,80 50,20 80,80 20,40 80,40" RenderTransform="1,0,0,1,0,100" />
 
15
                <Polyline x:Name="testcase2" Fill="#000000" Stroke="#FF00FF" StrokeThickness="4" Points="20,80 50,20 80,80 20,40 80,40" RenderTransform="1,0,0,1,100,100" />
 
16
                <Polyline x:Name="testcase3" Fill="#000000" Stroke="#FF00FF" StrokeThickness="4" Points="20,80 50,20 80,80 20,40 80,40" RenderTransform="1,0,0,1,200,100" />
 
17
        </Canvas>
 
18
      </script>
 
19
 
 
20
      <script language="javascript">
 
21
function onLoaded (sender, args)
 
22
{
 
23
        // invalid values defaults to EvenOdd (no value is EvenOdd)
 
24
        sender.findName ("testcase1").FillRule = -1;
 
25
        sender.findName ("testcase2").FillRule = 911;
 
26
 
 
27
        sender.findName ("testcase3").FillRule = "nONzERO";
 
28
 
 
29
        // Silverlight shows an Alert
 
30
        // Silverlight error message, ErrorCode: 2203, ErrorType:RuntimeError, Message: AG_E_RUNTIME_SETVALUE, MethodName: FillRule
 
31
/*
 
32
        sender.findName ("testcase3").FillRule = "-1";
 
33
        sender.findName ("testcase3").FillRule = sender.findName ("testcase2");
 
34
        sender.findName ("testcase3").FillRule = null;
 
35
        sender.findName ("testcase3").FillRule = true;
 
36
*/
 
37
}
 
38
      </script>
 
39
  </head>
 
40
 
 
41
  <body>
 
42
  <div id="SilverlightPluginHost" style="position:absolute; top:50px; left:50px; width:500px; height:50px;"></div>
 
43
 
 
44
  <script type="text/javascript">
 
45
        var pe = document.getElementById("SilverlightPluginHost");
 
46
        Silverlight.createObject("#xaml", pe, "AgControl1", {
 
47
                        width:'600px',
 
48
                        height:'300px',
 
49
                        inplaceInstallPrompt:false,
 
50
                        background:'#FFFFFF',
 
51
                        isWindowless:'false',
 
52
                        framerate:'24',
 
53
                        version:'1.0'
 
54
                }, {
 
55
                        onError:null,
 
56
                        onLoad:null
 
57
                },
 
58
                null);
 
59
  </script>
 
60
  <div style="position:absolute; top:400px; left:50px">
 
61
<p>0,0 star center should be <b>white</b>
 
62
<br>1,0 star center should be <b>white</b>
 
63
<br>2,0 star center should be <b>black</b>
 
64
<p>0,1 should be identical to 0,1*
 
65
<br>1,1 should be identical to 1,1*
 
66
<br>2,1 should be identical to 2,1*
 
67
<p>* Note: this test fails (when the script part is used) on Silverlight. It does not paint anything and, if force (move a window
 
68
on top) often draws a black box over the second line. Browser (both FF and IE) start consuming large amount of memory . 
 
69
Stepping with Firebug does show the 6 original images but does not show any update to the poly[gons|lines].
 
70
  </div>
 
71
  </body>
 
72
</html>