Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / W3C-SVG-1.1-SE / struct-dom-11-f.svg
blob6a562f07e522371349b262bdbc8835d3c8c71435
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.4" reviewer="ED" author="CM" status="accepted"
13 version="$Revision: 1.5 $" testname="$RCSfile: struct-dom-11-f.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 the getIntersectionList() and getEnclosureList()
17 methods return NodeLists that are not live.
18 </p>
19 <p>
20 After loading the test, two rectangles will be presented. The
21 upper rectangle indicates the result of testing whether
22 getIntersectionList() returns a non-live NodeList, while the
23 lower rectangle indicates so for getEnclosureList().
24 </p>
25 </d:testDescription>
26 <d:operatorScript xmlns="http://www.w3.org/1999/xhtml">
27 <p>
28 Run the test. No interaction required.
29 </p>
30 </d:operatorScript>
31 <d:passCriteria xmlns="http://www.w3.org/1999/xhtml">
32 <p>
33 The test is passed if both rectangles are green.
34 </p>
35 </d:passCriteria>
36 </d:SVGTestCase>
37 <title id="test-title">$RCSfile: struct-dom-11-f.svg,v $</title>
38 <defs>
39 <font-face
40 font-family="SVGFreeSansASCII"
41 unicode-range="U+0-7F">
42 <font-face-src>
43 <font-face-uri xlink:href="../resources/SVGFreeSans.svg#ascii"/>
44 </font-face-src>
45 </font-face>
46 </defs>
47 <g id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
49 <text x='10' y='40' font-size='13'>Test getIntersectionList and getEnclosureList return value liveness</text>
51 <rect id='r1' x='10' y='70' width='50' height='50' fill='black'/>
52 <text x='70' y='100'>getIntersectionList</text>
54 <rect id='r2' x='10' y='130' width='50' height='50' fill='black'/>
55 <text x='70' y='160'>getEnclosureList</text>
57 <g id="g1" visibility="hidden" pointer-events="painted">
58 <circle id='c1' cx='305' cy='100' r='5'/>
59 <circle id='c2' cx='305' cy='150' r='5'/>
60 </g>
62 <script><![CDATA[
64 function userspace2viewport(elm, r)
66 var ctm = elm.getCTM();
68 var corners = [];
69 for(var i = 0; i < 4; i++)
70 corners.push(svg.createSVGPoint());
72 corners[0].x = r.x;
73 corners[0].y = r.y;
74 corners[1].x = r.x + r.width;
75 corners[1].y = r.y;
76 corners[2].x = r.x + r.width;
77 corners[2].y = r.y + r.height;
78 corners[3].x = r.x;
79 corners[3].y = r.y + r.height;
81 for(var i = 0; i < 4; i++)
82 corners[i] = corners[i].matrixTransform(ctm);
84 var min = svg.createSVGPoint();
85 var max = svg.createSVGPoint();
86 min.x = corners[0].x;
87 min.y = corners[0].y;
88 max.x = corners[0].x;
89 max.y = corners[0].y;
91 for(var i = 1; i < 4; i++)
93 var x = corners[i].x;
94 var y = corners[i].y;
96 if(x < min.x)
97 min.x = x;
98 else if(x > max.x)
99 max.x = x;
101 if(y < min.y)
102 min.y = y;
103 else if(y > max.y)
104 max.y = y;
107 var res = svg.createSVGRect();
108 res.x = min.x;
109 res.y = min.y;
110 res.width = max.x - min.x;
111 res.height = max.y - min.y;
112 return res;
115 var svg = document.documentElement,
116 c = document.getElementById('c'),
117 r1 = document.getElementById('r1'),
118 r2 = document.getElementById('r2'),
119 c1 = document.getElementById('c1'),
120 c2 = document.getElementById('c2'),
121 g1 = document.getElementById('g1'),
122 r = svg.createSVGRect(),
125 try {
126 r.x = 300;
127 r.y = 95;
128 r.width = 10;
129 r.height = 10;
131 r = userspace2viewport(g1, r);
133 nl = svg.getIntersectionList(r, null);
134 if (nl && nl.length == 1) {
135 c1.parentNode.removeChild(c1);
136 r1.setAttribute('fill', nl.length == 1 ? 'lime' : 'red');
138 } catch (e) {
141 try {
142 r.x = 290;
143 r.y = 135;
144 r.width = 20;
145 r.height = 20;
147 r = userspace2viewport(g1, r);
149 nl = svg.getEnclosureList(r, null);
150 if (nl && nl.length == 1) {
151 c2.parentNode.removeChild(c2);
152 r2.setAttribute('fill', nl.length == 1 ? 'lime' : 'red');
154 } catch (e) {
156 ]]></script>
157 </g>
158 <g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
159 <text id="revision" x="10" y="340" stroke="none"
160 fill="black">$Revision: 1.5 $</text>
161 </g>
162 <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/>
163 <!-- comment out this watermark once the test is approved -->
164 <!--<g id="draft-watermark">
165 <rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
166 <text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
167 text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
168 </g>-->
169 </svg>