summaryrefslogtreecommitdiffstats
path: root/ksvg/test/ecma/circle.svg
blob: e9b198c368bb3b93bdfc30fc9cecf91618601500 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg width="6cm" height="5cm" viewBox="0 0 600 500" onload="foobar(evt)">
  <script type="text/ecmascript"> <![CDATA[
    function foobar(evt)
	{
      var circle = evt.getTarget().ownerDocument.getElementById('moo');
	 
	  var id = circle.id; // Should call SVGElementImpl::getValueProperty

	  var name = circle; // Should call toString()

	  var nodeName = circle.nodeName;
	  
	  var prop = circle.cx; // Should call SVGCircleElementImpl::getValueProperty

	  alert('NODENAME: ' + nodeName + '\nID: ' + id + '\nNAME: ' + name + '\nPROP: ' + prop.baseVal.value);
	}

	function click(evt)
	{
      var circle = evt.target;
	 
	  var id = circle.id; // Should call SVGElementImpl::getValueProperty

	  var name = circle; // Should call toString()

	  var nodeName = circle.nodeName;
	  
	  var prop = circle.cx; // Should call SVGCircleElementImpl::getValueProperty

	  alert('NODENAME: ' + nodeName + '\nID: ' + id + '\nNAME: ' + name + '\nPROP: ' + prop.baseVal.value);
	}

  ]]> </script>

  <circle id="moo" onclick="click(evt)" cx="300" cy="225" r="100" fill="red"/>
</svg>