blob: 277a3aa65dd49aae2f7b30dbf8e22d72fa5f743d [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.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/. =-->
<!--======================================================================-->
<!-- ===================================================================== -->
<!-- -->
<!-- text-whiteSpace-BE-06.svg -->
<!-- renamed for 1.1 suite to text-ws-01-f.svg -->
<!-- -->
<!-- Test that viewer correctly handles whitespace -->
<!-- and the "space" attribute. -->
<!-- -->
<!-- Author : Lofton Henderson, 10-Apr-2000 -->
<!-- 1.1 revision by Vincent Hardy -->
<!-- -->
<!-- History: -->
<!-- 10-Apr-2000, LH: Serial#1 created. -->
<!-- 02-Jun-2000, LH=" rmv 1 extra SPACE before "indented", test 3" ser#2. -->
<!-- 03-Aug-2000, LH=" update DOCTYPE for CR DTD, 20000802" ser# . -->
<!-- 12-Dec-2000, JF: test case 2 lost its linebreaks. restored. -->
<!-- -->
<!-- ===================================================================== -->
<!--======================================================================-->
<!--= 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="480" height="360">
<SVGTestCase xmlns="http://www.w3.org/2000/02/svg/testsuite/description/" >
<OperatorScript>
<Paragraph>
Test for viewer correct handling of whitespace and the 'xml:space' attribute.
There are four sub-tests, two for xml:space value "default" and two for
value "preserve". In each test, the content of the 'text' element is written on
multiple lines. The first test of each pair has indented text with leading
space characters, tabs, etc. The second has no indentation, but a line break
before the content and after it. There are no space (or other whitespace)
characters at the ends of the lines.
</Paragraph>
<Paragraph>
The four test cases are self-descriptive. From the top; first, "default" value applied to
3 lines of content with indents, space characters, tabs, etc; second, "default" applied to two lines content with no indent; third, "preserve" applied to essentially the same content as first; fourth, "preserve" applied to essentially the same content as second.
</Paragraph>
<Paragraph>
In each test, the test string is in blue and the reference
image is in black.
The rendered picture should approximately match the reference image,
however there is some question in the reference image concerning the
exact amount of space in the long-space areas. The third test uses the nbsp unicode character
to force the reference white spaces display, which provides an accurate match if the font in use
has the same metrics for that character and the default white space.
Also, variations are possible in the text fonts and layout (per CSS2 rules).
</Paragraph>
<Paragraph>
The test also uses the 'rect' element,
as well as basic fill (solid primary colors),
stroke (black 1-pixel lines), font-family (Helvetica)
and font-size properties.
</Paragraph>
</OperatorScript>
</SVGTestCase>
<title id="test-title">text-ws-01-f</title>
<desc id="test-desc">Test that viewer correctly handle whitespace and the "space" attribute.</desc>
<!--======================================================================-->
<!--Content of Test Case follows... =====================-->
<!--======================================================================-->
<g id="test-body-content">
<text x="75" y="20" font-size="10" font-family="Verdana" fill="black">Basic test of xml:space attribute &amp; whitespace handling.</text>
<!-- Test 1: indented, spaces, tabs, and space='default' -->
<!-- Features=" line break and spaces before 1st line" tabs before 2nd line; -->
<!-- spaces before 3rd line; no space at ends of any lines. -->
<text x="25" y="55" fill="blue" font-size="12" font-family="helvetica" xml:space="default">WS example with indented lines.</text>
<text x="25" y="70" fill="black" font-size="12" font-family="helvetica" >WS example with indented lines.</text>
<rect x="25" y="80" width="100" height="12" fill="none" stroke="black" />
<text x="28" y="90" fill="black" font-size="10" font-family="helvetica" >xml:space='default'</text>
<!-- Test 2: non-indented,and space='default' -->
<!-- Features=" line break before 1st line" no space either at beginning -->
<!-- or end of any lines. -->
<text x="25" y="115" fill="blue" font-size="12" font-family="helvetica" xml:space="default">
WS example
non-indented lines.
</text>
<text x="25" y="130" fill="black" font-size="12" font-family="helvetica" >WS examplenon-indented lines.</text>
<rect x="25" y="140" width="100" height="12" fill="none" stroke="black" />
<text x="28" y="150" fill="black" font-size="10" font-family="helvetica" >xml:space='default'</text>
<!-- Test 3: indented, spaces, tabs, and space='preserve' -->
<!-- Features=" line break and spaces before 1st line" tabs before 2nd line; -->
<!-- spaces before 3rd line; no space at ends of any lines. -->
<text x="25" y="175" fill="blue" font-size="12" font-family="helvetica" xml:space="preserve">
WS example
with
indented lines.
</text>
<!-- should match this, with blank replacing HT, LF, etc -->
<text x="25" y="190" fill="black" font-size="12" font-family="helvetica" xml:space='preserve'>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;WS&#160;example&#160;&#160;&#160;&#160;with&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;indented&#160;lines.</text>
<rect x="25" y="200" width="100" height="12" fill="none" stroke="black" />
<text x="28" y="210" fill="black" font-size="10" font-family="helvetica" >xml:space='preserve'</text>
<!-- Test 4: non-indented, and space='preserve' -->
<!-- Features=" no line break before 1st line" no space either at beginning -->
<!-- or end of any lines. -->
<text x="25" y="235" fill="blue" font-size="12" font-family="helvetica" xml:space="preserve">WS example
non-indented lines.
</text>
<text x="25" y="250" fill="black" font-size="12" font-family="helvetica" >WS example non-indented lines.</text>
<rect x="25" y="260" width="100" height="12" fill="none" stroke="black" />
<text x="28" y="270" fill="black" font-size="10" font-family="helvetica" >xml:space='preserve'</text>
</g>
<!--======================================================================-->
<!--Legend and frame: Title, suite and SVG document serialization====-->
<!--======================================================================-->
<g id="test-legend" fill="black" font-family="Helvetica" font-size="10" >
<rect x="10" y="300" width="275" height="50" fill="none" stroke="#000000" />
<path fill="none" stroke="#000000" d="M10 315 h275 M205 315 v35 M10 336 h195 M205 332 h80"/>
<text x="25" y="311">Scalable Vector Graphics (SVG) v1.1 Conformance Suite</text>
<a xlink:href="copyright-documents-19990405.html">
<text x="12" y="347" fill="blue" >Copyright 2002 W3C. All Rights Reserved.</text>
</a>
<text font-size="12" x="35" y="330">text-ws-01-f</text>
<text font-size="10" x="210" y="327">$Revision: 1.1 $</text>
<text font-size="10" x="210" y="345">Release 1.0</text>
<rect id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000000" />
</g>
</svg>