Debian Codegraph @

test_non_regression/fail/na/animation/animate-struct-dom-01-b.svg

raw
1 <svg id="svg-root" width="100%" height="100%"
2 viewBox="0 0 480 360" xmlns="http://www.w3.org/2000/svg"
3 xmlns:xlink="http://www.w3.org/1999/xlink">
4 <!--======================================================================-->
5 <!--= Copyright 2008 World Wide Web Consortium, (Massachusetts =-->
6 <!--= Institute of Technology, European Research Consortium for =-->
7 <!--= Informatics and Mathematics (ERCIM), Keio University). =-->
8 <!--= All Rights Reserved. =-->
9 <!--= See http://www.w3.org/Consortium/Legal/. =-->
10 <!--======================================================================-->
11 <d:SVGTestCase xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/"
12 template-version="1.3" reviewer="CL" author="CM" status="accepted"
13 version="$Revision: 1.2 $" testname="$RCSfile: animate-struct-dom-01-b.svg,v $">
14 <d:testDescription xmlns="http://www.w3.org/1999/xhtml" href="http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGSVGElement">
15 <p>
16 This tests that calling SVGSVGElement.getCurrentTime() before the
17 document timeline has begun returns 0, and that
18 calling SVGSVGElement.setCurrentTime() before the document timeline
19 has begun will queue a seek to that time once the timeline
20 does begin.
21 After loading the test, two rectangles will be shown.
22 The left rectangle indicates whether SVGSVGElement.getCurrentTime()
23 correctly returned 0 before the document timeline had begun.
24 The right rectangles indicates whether a call to
25 SVGSVGElement.setCurrentTime() was acted upon once the timeline
26 did begin. For each rectangle, red indicates that the sub-test
27 failed and green indicates that the sub-test passed.
28 </p>
29 </d:testDescription>
30 <d:operatorScript xmlns="http://www.w3.org/1999/xhtml">
31 <p>
32 Run the test. No interaction required.
33 </p>
34 </d:operatorScript>
35 <d:passCriteria xmlns="http://www.w3.org/1999/xhtml">
36 <p>
37 The test is passed if both rectangles are green.
38 </p>
39 </d:passCriteria>
40 </d:SVGTestCase>
41 <title id="test-title">$RCSfile: animate-struct-dom-01-b.svg,v $</title>
42 <defs>
43 <font-face
44 font-family="SVGFreeSansASCII"
45 unicode-range="U+0-7F">
46 <font-face-src>
47 <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
48 </font-face-src>
49 </font-face>
50 </defs>
51 <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
52
53 <text x='10' y='30'>Test getCurrentTime() and setCurrentTime() before timeline begin</text>
54 <rect id='r' x='10' y='50' width='50' height='50' fill='red'/>
55 <rect x='210' y='50' width='50' height='50' fill='red'>
56 <set attributeName='fill' to='green' begin='36000'/> <!-- 10h -->
57 <set attributeName='fill' to='red' begin='72000'/> <!-- 20h -->
58 </rect>
59
60 <g font-size='15'>
61 <text x='10' y='120'>getCurrentTime</text>
62 <text x='210' y='120'>setCurrentTime</text>
63 </g>
64
65 <script>
66 try {
67 document.documentElement.setCurrentTime(90000); // 25h
68 document.documentElement.setCurrentTime(54000); // 15h
69 } catch (e) {
70 }
71
72 try {
73 if (document.documentElement.getCurrentTime() == 0) {
74 document.getElementById('r').setAttribute('fill', 'green');
75 }
76 } catch (e) {
77 }
78 </script>
79 </g>
80 <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
81 <text id="revision" x="10" y="340" stroke="none"
82 fill="black">$Revision: 1.2 $</text>
83 </g>
84 <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/>
85 <!-- comment out this watermark once the test is approved -->
86 <!--
87 <g id="draft-watermark">
88 <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
89 <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
90 text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
91 </g>
92 -->
93 </svg>