| OLD | NEW |
| (Empty) |
| 1 <?xml version="1.0" encoding="UTF-8"?> | |
| 2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics
/SVG/1.1/DTD/svg11-basic.dtd"> | |
| 3 | |
| 4 <!--======================================================================--> | |
| 5 <!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =--> | |
| 6 <!--= Institute of Technology, Institut National de Recherche en =--> | |
| 7 <!--= Informatique et en Automatique, Keio University). All Rights =--> | |
| 8 <!--= Reserved. See http://www.w3.org/Consortium/Legal/. =--> | |
| 9 <!--======================================================================--> | |
| 10 <!-- ===================================================================== --> | |
| 11 <!-- --> | |
| 12 <!-- coords-units-BE-01.svg --> | |
| 13 <!-- renamed for 1.1 suite to coords-units-03-f.svg --> | |
| 14 <!-- renamed for 1.1 basic profile suite to coords-units-03-b.svg --> | |
| 15 <!-- --> | |
| 16 <!-- Author : Vincent Hardy --> | |
| 17 <!-- Modified for svg 1.1 by Ola Andersson, 07-Mar-2002 --> | |
| 18 <!-- Modified for svg 1.1 basic profile by Luc Minnebo, 05-July-2002 -->
| |
| 19 <!-- --> | |
| 20 <!-- History: --> | |
| 21 <!-- 24-Feb-2000, VH: created --> | |
| 22 <!-- 27-Feb-2000, LH: minor adjustments to TC name, ser#3. --> | |
| 23 <!-- 02-Mar-2000, LH: fix names, legend, ser#4. --> | |
| 24 <!-- 09-Mar-2000, LH: fix framing rect, ser#5. --> | |
| 25 <!-- 24-Apr-2000, LH: remove text-anchor, ser#6. --> | |
| 26 <!-- 18-May-2000 - LH=" remove last 3 'px' tests per WG decision" fix --> | |
| 27 <!-- bad CSS property; ser#7. --> | |
| 28 <!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . --> | |
| 29 <!-- 16-Aug-2000, LH="rename" ser#8. --> | |
| 30 <!-- 29-Sep-2000, VH=" removed px unit specifier in transform" ser#9. --> | |
| 31 <!-- --> | |
| 32 <!-- ===================================================================== --> | |
| 33 <!--======================================================================--> | |
| 34 <!--= Note. After October 2000, revision history is kept as CVS 'commit' =--> | |
| 35 <!--= log messages, and therefore is no longer in the preceding preamble.=--> | |
| 36 <!--======================================================================--> | |
| 37 <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlin
k" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" version="1.1"
baseProfile="basic"> | |
| 38 <SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/"> | |
| 39 <OperatorScript version="$Revision: 1.4 $" testname="coords-unit
s-03-b.svg"> | |
| 40 <Paragraph> | |
| 41 This test verifies both the initial viewport size and the support fo
r the various | |
| 42 unit specifiers. | |
| 43 </Paragraph> | |
| 44 <Paragraph> | |
| 45 The units in SVG can be: user coordinate and CSS units: em, ex, px,
pt, pc, cm, mm, | |
| 46 in and percentages. The test does not check the absolute length accu
racy as this | |
| 47 can only be truly validated with a ruler. However, it validates that
the different | |
| 48 units are supported by drawing multiple elements who have the same l
ength specified | |
| 49 in different units. | |
| 50 </Paragraph> | |
| 51 <Paragraph> | |
| 52 The viewport is the "finite rectangular region" where rendering occu
rs in SVG. | |
| 53 Hence, nothing should be rendered outside the viewport (paragraph 7.
1). Furthermore, when no positioning properties are set on the top s
vg element, the initial viewport size should have the value of the t
op svg element's "width" and "height" attributes. | |
| 54 To check this behavior, the test does not define positioning propert
ies on the top | |
| 55 svg element but defines its "width" and "height" properties. Then it
fills a red | |
| 56 rectangle that is bigger than the viewport size. Then, a rectangle,
the size of the | |
| 57 viewport is drawn in white. If rendering is limited to the viewport
area, none of the | |
| 58 red should show. | |
| 59 </Paragraph> | |
| 60 <Paragraph> | |
| 61 The line showing the "ex" units will not necessarily appear with the
same length | |
| 62 as shown in the reference image because the X-height of a font is no
t | |
| 63 necessarily half of the font size (which is assumed in the reference
image where | |
| 64 1ex is considered to be .5em). | |
| 65 </Paragraph> | |
| 66 <Paragraph> | |
| 67 The rendered picture should match the reference image approximately.
There might be | |
| 68 variations due to the exact pixel size as negotiated by the SVG rend
erer. | |
| 69 </Paragraph> | |
| 70 </OperatorScript> | |
| 71 </SVGTestCase> | |
| 72 <title id="test-title">coords-units-03-b</title> | |
| 73 <desc id="test-desc">Validates simple initial viewport size and basic units h
andling.</desc> | |
| 74 <!--======================================================================--> | |
| 75 <!--Content of Test Case follows... =====================--> | |
| 76 <!--======================================================================--> | |
| 77 <g id="test-body-content"> | |
| 78 <g id="viewport-initial-size-test"> | |
| 79 <!-- ==================================================================
==== --> | |
| 80 <!-- First fill a rectangle that is bigger than the defined viewport ==
==== --> | |
| 81 <!-- ==================================================================
==== --> | |
| 82 <rect x="0px" y="0px" width="2000px" height="2000px" fill="red" /> | |
| 83 <!-- ==================================================================
==== --> | |
| 84 <!-- This second rectangle should cover the previous one, so none of th
e == --> | |
| 85 <!-- red should show if the initial viewport has the requested size
== --> | |
| 86 <!-- ==================================================================
==== --> | |
| 87 <rect x="0px" y="0px" width="480px" height="360px" fill="white" /> | |
| 88 </g> | |
| 89 <!-- viewport-initial-size-test --> | |
| 90 <!-- Title --> | |
| 91 <text x="125" y="20" fill="black" font-size="12" font-family="Arial" >Init
ial viewport and CSS units test</text> | |
| 92 <g id="units-test" fill="black" font-size="10pt" transform="translate(0,
60)"> | |
| 93 <!-- ==================================================================
==== --> | |
| 94 <!-- Now, draw rectangles using the various unit specifiers
--> | |
| 95 <!-- ==================================================================
==== --> | |
| 96 <!-- User Space --> | |
| 97 <text x="20" y="18">200</text> | |
| 98 <text x="230" y="20">User space units (no specifier)</text> | |
| 99 <rect x="20" y="20" width="200" height="1"/> | |
| 100 <!-- ================== --> | |
| 101 <!-- Relative CSS Units --> | |
| 102 <!-- ================== --> | |
| 103 <!-- Pixels : Should correspond to User Space, because the initial user
--> | |
| 104 <!-- coordinate is such that one user space unit equals one pixel in
--> | |
| 105 <!-- viewport.
--> | |
| 106 <text x="20" y="38">200 px</text> | |
| 107 <text x="230" y="40">Pixels (px)</text> | |
| 108 <rect x="20" y="40" width="200px" height="1"/> | |
| 109 <!-- Font size (em). Should be equal to 200pt because current font's
--> | |
| 110 <!-- point size is 10pt
--> | |
| 111 <text x="20" y="58">20 em = 200 px (font-size=10px)</text> | |
| 112 <text x="230" y="60">Relative to font size (em)</text> | |
| 113 <g font-size="10px" > | |
| 114 <rect x="20" y="60" width="20em" height="1"/> | |
| 115 </g> | |
| 116 <!-- X-Height (ex). With a 10px font-size, x-height is about 5px, so -
-> | |
| 117 <!-- ex units would be about 200px -
-> | |
| 118 <text x="20" y="78">40 ex</text> | |
| 119 <text x="230" y="80">Relative to font x-height (ex)</text> | |
| 120 <g font-size="10px" > | |
| 121 <rect x="20" y="80" width="40ex" height="1"/> | |
| 122 </g> | |
| 123 <!-- ========================= --> | |
| 124 <!-- Percentage --> | |
| 125 <!-- ========================= --> | |
| 126 <!-- 1% = 4.8px because viewport is 480px --> | |
| 127 <text x="20" y="98">41.67% = 200 px</text> | |
| 128 <text x="230" y="100">Percentage (%)</text> | |
| 129 <rect x="20" y="100" width="41.67%" height="1"/> | |
| 130 <!-- ========================= --> | |
| 131 <!-- Absolute Length CSS Units --> | |
| 132 <!-- ========================= --> | |
| 133 <!-- Inches (should be the same length as following (cm) rect)
--> | |
| 134 <text x="20" y="118">1 in</text> | |
| 135 <text x="230" y="120">Inches (in)</text> | |
| 136 <rect x="20" y="120" width="1in" height="1"/> | |
| 137 <!-- Centimeters(should be the same length as previous (in) rect)
--> | |
| 138 <!-- 1in = 2.54cm --> | |
| 139 <text x="20" y="138">2.54 cm = 1 in</text> | |
| 140 <text x="230" y="140">Centimeters (cm)</text> | |
| 141 <rect x="20" y="140" width="2.54cm" height="1"/> | |
| 142 <!-- Millimeters (should be the same length as previous (cm) rect)
--> | |
| 143 <!-- 10mm = 1cm --> | |
| 144 <text x="20" y="158">25.4 mm = 1 in</text> | |
| 145 <text x="230" y="160">Millimeters (mm)</text> | |
| 146 <rect x="20" y="160" width="25.4mm" height="1"/> | |
| 147 <!-- Points (should be the same length as (in) rect
--> | |
| 148 <!-- 1pt = 1/72 in --> | |
| 149 <text x="20" y="178">72pt = 1 in</text> | |
| 150 <text x="230" y="180">Points (pt)</text> | |
| 151 <rect x="20" y="180" width="72pt" height="1"/> | |
| 152 <!-- Picas (should be the same length as previous (pt) rect)
--> | |
| 153 <!-- 1pc = 12pt --> | |
| 154 <text x="20" y="198">6pc = 1 in</text> | |
| 155 <text x="230" y="200">Picas (pc)</text> | |
| 156 <rect x="20" y="200" width="6pc" height="1"/> | |
| 157 </g> | |
| 158 <!-- units-test --> | |
| 159 </g> | |
| 160 <text id="revision" x="10" y="340" font-size="40" stroke="none" fill="bl
ack">$Revision: 1.4 $</text> | |
| 161 <rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" s
troke="#000000"/> | |
| 162 </svg> | |
| 163 | |
| OLD | NEW |