OLD | NEW |
| (Empty) |
1 <svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:
xlink="http://www.w3.org/1999/xlink" onload="runRepaintAndPixelTest()"> | |
2 <script xlink:href="../../fast/repaint/resources/text-based-repaint.js"/> | |
3 <defs> | |
4 <g id="reference"> | |
5 <rect x="240" y="1" width="239" height="358" /> | |
6 <circle cx="240" cy="1" width="39" height="58" /> | |
7 </g> | |
8 | |
9 <script type="text/ecmascript"> | |
10 <![CDATA[ | |
11 window.outputRepaintRects = false; | |
12 function repaintTest() { | |
13 if (window.eventSender) { | |
14 testRunner.waitUntilDone(); | |
15 eventSender.mouseMoveTo(250, 50); | |
16 eventSender.mouseDown(); | |
17 eventSender.mouseUp(); | |
18 } | |
19 } | |
20 | |
21 function test (event) { | |
22 // get pointers to use and referenced elements | |
23 var container = document.getElementById('reference'); | |
24 var rect = container.firstChild.nextSibling; | |
25 var circle = rect.nextSibling.nextSibling; | |
26 var use = document.getElementById('use'); | |
27 | |
28 // test all SVGElementInstance methods (except childNodes) | |
29 var rectInstance = event.target; | |
30 var gInstance = rectInstance.parentNode; | |
31 var circleInstance = rectInstance.nextSibling; | |
32 | |
33 // Check wheter correspdoningElement is the <rect>, and wheter <use> is
set correctly. | |
34 if (rectInstance.correspondingElement != rect) return; | |
35 if (rectInstance.correspondingUseElement != use) return; | |
36 | |
37 // Our <rect> doesn't have children. | |
38 if (rectInstance.firstChild) return; | |
39 if (rectInstance.lastChild) return; | |
40 | |
41 // Our <rect> SVGElementInstance has the <g> SVGElementInstance as paren
t node | |
42 if (!gInstance) return; | |
43 if (gInstance.correspondingElement != container) return; | |
44 | |
45 // Our <rect> SVGElementInstance has no previous sibling | |
46 if (rectInstance.previousSibling) return; | |
47 | |
48 // Our <rect> SVGElementInstance has the <circle> SVGElementInstance as
next sibling | |
49 if (!circleInstance) return; | |
50 if (circleInstance.correspondingElement != circle) return; | |
51 if (rectInstance.nextSibling != circleInstance) return; | |
52 | |
53 // Our <g> SVGElementInstance has no parent node, and <rect> as firstChi
ld, <circle> as lastChild | |
54 if (gInstance.parentNode) return; | |
55 if (gInstance.firstChild != rectInstance) return; | |
56 if (gInstance.lastChild != circleInstance) return; | |
57 | |
58 // Hopefully we pass :-) | |
59 document.getElementById("status").firstChild.nodeValue = "Test passed."; | |
60 | |
61 if (window.testRunner) | |
62 testRunner.notifyDone(); | |
63 } | |
64 ]]> | |
65 </script> | |
66 </defs> | |
67 | |
68 <text x="100" y="50" id="status">Test failed.</text> | |
69 <use id="use" xlink:href="#reference" onclick="test(evt)" fill="grey" /> | |
70 <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke=
"#000"/> | |
71 </svg> | |
OLD | NEW |