Revision control
Copy as Markdown
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.2" baseProfile="tiny" xml:id="svg-root" width="100%" height="100%"
<!--======================================================================-->
<!--= Copyright 2008 World Wide Web Consortium, (Massachusetts =-->
<!--= Institute of Technology, European Research Consortium for =-->
<!--= Informatics and Mathematics (ERCIM), Keio University). =-->
<!--= All Rights Reserved. =-->
<!--======================================================================-->
reviewer="AE" owner="ED" desc="Test reference restrictions on the 'use' element." status="accepted"
approved="yes"
version="$Revision: 1.5 $" testname="$RCSfile: struct-use-201-t.svg,v $">
<d:OperatorScript xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/" xmlns="http://www.w3.org/1999/xhtml">
<p>
This test tests reference restrictions on the use element. Each of the 5 different
restrictions is tested.
</p>
<p>
A compliant SVG Tiny 1.2 user agent must treat each of the invalid IRI:s as if the xlink:href
attribute hadn't been specified, which is the same as disabling rendering of the use element
in question. Thus for the test to pass none of the content that the use elements try to reference
must be visible, the end result should be 5 empty (white) rects.
</p>
<p>
For a user agent that handles at least SVG 1.1 Basic the testcase has still passed if the referenced
content in the rect that is labelled "B" is visible since this is allowed for 1.1.
</p>
</d:OperatorScript>
</SVGTestCase>
<title xml:id="test-title">$RCSfile: struct-use-201-t.svg,v $</title>
<defs>
<font-face
font-family="SVGFreeSansASCII"
unicode-range="U+0-7F">
<font-face-src>
<font-face-uri xlink:href="../images/SVGFreeSans.svg#ascii"/>
</font-face-src>
</font-face>
</defs>
<g xml:id="test-body-content" font-family="SVGFreeSansASCII,sans-serif" font-size="18">
<text x="240" y="50" text-anchor="middle">Test <use> reference restrictions</text>
<g>
<!-- this is an invalid IRI because it directly creates a circular dependency -->
<use xlink:href="#svg-root" x="20" y="105" width="80" height="80"/>
<rect x="15" y="100" width="90" height="120" fill="none" stroke="black"/>
<rect x="15" y="190" width="90" height="30" fill="none" stroke="black"/>
<text x="60" y="210" text-anchor="middle">A</text>
</g>
<g>
<!-- this is an invalid IRI because it references an svg fragment, however it may be visible if SVG 1.1 is supported -->
<use xlink:href="../images/resources.svg#svg-root" x="110" y="105" width="80" height="80"/>
<rect x="105" y="100" width="90" height="120" fill="none" stroke="black"/>
<rect x="105" y="190" width="90" height="30" fill="none" stroke="black"/>
<text x="150" y="210" text-anchor="middle">B</text>
</g>
<g>
<!-- this is an invalid IRI because it references an entire file -->
<use xlink:href="../images/resources.svg" x="200" y="105" width="80" height="80"/>
<rect x="195" y="100" width="90" height="120" fill="none" stroke="black"/>
<rect x="195" y="190" width="90" height="30" fill="none" stroke="black"/>
<text x="240" y="210" text-anchor="middle">C</text>
</g>
<g>
<!-- this is an invalid IRI because it references a media resource other than svg -->
<use xlink:href="../images/1pixelred.png" x="290" y="105" width="80" height="80"/>
<rect x="285" y="100" width="90" height="120" fill="none" stroke="black"/>
<rect x="285" y="190" width="90" height="30" fill="none" stroke="black"/>
<text x="330" y="210" text-anchor="middle">D</text>
</g>
<g>
<!-- this is an invalid IRI because data IRI:s are not allowed on 'use' -->
<use xlink:href="data:image/svg+xml;charset=utf-8,%3Crect%20width%3D%22100%22%20height%3D%22100%22%20fill%3D%22red%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%2F%3E"
x="380" y="105" width="80" height="80"/>
<rect x="375" y="100" width="90" height="120" fill="none" stroke="black"/>
<rect x="375" y="190" width="90" height="30" fill="none" stroke="black"/>
<text x="420" y="210" text-anchor="middle">E</text>
</g>
</g>
<g font-family="SVGFreeSansASCII,sans-serif" font-size="32">
<text xml:id="revision" x="10" y="340" stroke="none"
fill="black">$Revision: 1.5 $</text>
</g>
<rect xml:id="test-frame" x="1" y="1" width="478" height="358" fill="none" stroke="#000"/>
<!-- comment out this watermark once the test is approved -->
<!--<g xml:id="draft-watermark">
<rect x="1" y="1" width="478" height="20" fill="red" stroke="black" stroke-width="1"/>
<text font-family="SVGFreeSansASCII,sans-serif" font-weight="bold" font-size="20" x="240"
text-anchor="middle" y="18" stroke-width="0.5" stroke="black" fill="white">DRAFT</text>
</g>-->
</svg>