146 lines
9.6 KiB
XML
146 lines
9.6 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">
|
|
|
|
<!--======================================================================-->
|
|
<!--= Copyright 2000 World Wide Web Consortium, (Massachusetts =-->
|
|
<!--= Institute of Technology, Institut National de Recherche en =-->
|
|
<!--= Informatique et en Automatique, Keio University). All Rights =-->
|
|
<!--= Reserved. See http://www.w3.org/Consortium/Legal/. =-->
|
|
<!--======================================================================-->
|
|
<!-- ===================================================================== -->
|
|
<!-- -->
|
|
<!-- coords-unitsProc-BE-04.svg -->
|
|
<!-- renamed for 1.1 suite to coords-units-02-f.svg -->
|
|
<!-- renamed for 1.1 basic profile suite to coords-units-02-b.svg -->
|
|
<!-- -->
|
|
<!-- This test validates the CSS units and percentages processing rules -->
|
|
<!-- -->
|
|
<!-- Author : Vincent Hardy, 29-Feb-2000 -->
|
|
<!-- Modified for svg 1.1 by Ola Andersson, 07-Mar-2002 -->
|
|
<!-- Modified for svg 1.1 basic profile by Luc Minnebo, 05-July-2002 -->
|
|
<!-- -->
|
|
<!-- History: -->
|
|
<!-- 29-Feb-2000, VH: Created. Matches 20000302 SVG spec. -->
|
|
<!-- 09-Mar-2000, LH: suite integration (name, editorial, ..), ser#2 -->
|
|
<!-- 09-Mar-2000, LH: fix framing rect, ser#3. -->
|
|
<!-- 30-Apr-2000, VH=" fix stroke properties bug" ser#3. -->
|
|
<!-- 12-May-2000, LH: fix title and integrate, ser#4. -->
|
|
<!-- 01-Jun-2000, LH: remove text-anchor, ser#5. -->
|
|
<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
|
|
<!-- 16-Aug-2000, LH="rename" ser#6. -->
|
|
<!-- 13-Dec-2000, JF: Adapt to new rules for CSS units and pcts in -->
|
|
<!-- 02Nov2000 spec. -->
|
|
<!-- -->
|
|
<!-- ===================================================================== -->
|
|
<!--======================================================================-->
|
|
<!--= Note. After October 2000, revision history is kept as CVS 'commit' =-->
|
|
<!--= log messages, and therefore is no longer in the preceding preamble.=-->
|
|
<!--======================================================================-->
|
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360" version="1.1" baseProfile="basic">
|
|
<SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/">
|
|
<OperatorScript version="$Revision: 1.4 $" testname="coords-units-02-b.svg">
|
|
<Paragraph>
|
|
Verify the conversion processing of CSS units and percentage values for both
|
|
coordinates and length values. Note that the test uses the CSS px unit to be usable
|
|
in all pixel resolutions. Hence, the conversion from other CSS units to CSS px is
|
|
left out of the test.
|
|
</Paragraph>
|
|
<Paragraph>
|
|
There are six atomic tests in this test. For each, the approach is to draw two similar
|
|
elements (circles or rects) with coordinates specified in user space for one and in
|
|
CSS units or percentage for the other. Each test is such that these two values (or
|
|
value pairs) should match.
|
|
</Paragraph>
|
|
<Paragraph>
|
|
For example, in the first two tests, that validate coordinate processing, the circles
|
|
should have the same center. In the following two tests, the rectangles should have
|
|
the same height and width. And finally, in the last test, the 3 circles should have the
|
|
same radius.
|
|
</Paragraph>
|
|
<Paragraph>
|
|
The rendered image should match the reference image except for the text which may
|
|
show minor differences, per CSS2 rules for font selection and matching.
|
|
</Paragraph>
|
|
</OperatorScript>
|
|
</SVGTestCase>
|
|
<title id="test-title">coords-units-02-b</title>
|
|
<desc id="test-desc">This test validates the processing rules for converting coordinates and length in CSS units to user space coordinate values.</desc>
|
|
<!--======================================================================-->
|
|
<!--Content of Test Case follows... =====================-->
|
|
<!--======================================================================-->
|
|
<g id="test-body-content" font-size="13pt">
|
|
<!-- ==================================================================== -->
|
|
<!-- First test, converting CSS coordinates to user space. -->
|
|
<!-- If implemented properly, the red marker should appear on top of -->
|
|
<!-- the black marker. -->
|
|
<!-- ==================================================================== -->
|
|
<!-- Draw Text Comment -->
|
|
<text x="60" y="35">CSS pixel coordinate to user space conversion</text>
|
|
<g transform="translate(5, 0) scale(4)">
|
|
<!-- Draw marker using user space units -->
|
|
<circle cx="7.5" cy="7.5" r="2.5" fill="black" />
|
|
<!-- Draw CSS marker using px units -->
|
|
<circle cx="7.5px" cy="7.5px" r="1.5px" fill="red" />
|
|
</g>
|
|
<!-- ==================================================================== -->
|
|
<!-- Same test, using percentage values for the coordinates -->
|
|
<!-- ==================================================================== -->
|
|
<!-- Draw Text Comment -->
|
|
<text x="60" y="85">Percentage coordinates to user space conversion</text>
|
|
<g transform="translate(5, 50) scale(4)">
|
|
<!-- Draw marker using user space units -->
|
|
<circle cx="7.5" cy="7.5" r="2.5" fill="black" />
|
|
<!-- Draw marker using percentages: 7.5 = 1.563% of 480 (cx) -->
|
|
<!-- Draw marker using percentages: 7.5 = 2.083% of 360 (cy) -->
|
|
<circle cx="1.563%" cy="2.083%" r=".3535%" fill="red" />
|
|
</g>
|
|
<!-- ==================================================================== -->
|
|
<!-- Second test, converting CSS width and height to user space. -->
|
|
<!-- If implemented properly, the red marker should appear bellow the -->
|
|
<!-- black one and have the same size -->
|
|
<!-- ==================================================================== -->
|
|
<!-- Draw Text Comment -->
|
|
<text x="60" y="140">CSS width/height to user space conversion</text>
|
|
<g transform="translate(30, 115) scale(4)">
|
|
<!-- Draw marker using user space units -->
|
|
<rect x="-5" y="0" width="10" height="5" fill="black" />
|
|
<!-- Draw CSS marker using px units -->
|
|
<rect x="-5" y="5" width="10px" height="5px" fill="red" />
|
|
</g>
|
|
<!-- ==================================================================== -->
|
|
<!-- Same test, using percentage values for the length -->
|
|
<!-- ==================================================================== -->
|
|
<!-- Draw Text Comment -->
|
|
<text x="60" y="200">Percentage width/height to user space conversion</text>
|
|
<g transform="translate(30, 175) scale(4)">
|
|
<!-- Draw marker using user space units -->
|
|
<rect x="-5" y="0" width="10" height="5" fill="black" />
|
|
<!-- Draw CSS marker using percentages: 5*2 = 10 = 2.083% of 480 -->
|
|
<!-- 2.5*2 = 5 = 1.389% of 360 -->
|
|
<rect x="-5" y="5" width="2.083%" height="1.389%" fill="red" />
|
|
</g>
|
|
<!-- ==================================================================== -->
|
|
<!-- Third test, converting CSS arbitrary length to user space . -->
|
|
<!-- If implemented properly, the three circles which are side by side -->
|
|
<!-- should have the same radius -->
|
|
<!-- ==================================================================== -->
|
|
<!-- Draw Text Comment -->
|
|
<text x="140" y="265">CSS and percentage length conversion</text>
|
|
<g transform="translate(30, 260) skewX(45) scale(4)">
|
|
<!-- Draw marker using user space units -->
|
|
<circle cx="0" cy="0" r="3.536" fill="black" />
|
|
<!-- Draw CSS marker using px units. -->
|
|
<circle cx="10" cy="0" r="3.536px" fill="red" />
|
|
<!-- Draw marker using percentages. This should yield a value of 3.536 -->
|
|
<!-- in user space. 3.536 = .8334% of 424.268px -->
|
|
<circle cx="20" cy="0" r=".8334%" fill="green" />
|
|
<!-- Draw control lines at the top and bottom of the circles -->
|
|
<line x1="-3.536" y1="-3.536" x2="25" y2="-3.536" fill="none" stroke="#cccccc" stroke-width=".5" />
|
|
<line x1="-3.536" y1="3.536" x2="25" y2="3.536" fill="none" stroke="#cccccc" stroke-width=".5" />
|
|
</g>
|
|
</g>
|
|
<text id="revision" x="10" y="340" font-size="40" stroke="none" fill="black">$Revision: 1.4 $</text>
|
|
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000"/>
|
|
</svg>
|
|
|