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="CL" owner="AE" desc="Required Formats Attribute" status="accepted"
approved="yes"
version="$Revision: 1.4 $" testname="$RCSfile: struct-cond-204-t.svg,v $">
<d:OperatorScript xmlns:d="http://www.w3.org/2000/02/svg/testsuite/description/" xmlns="http://www.w3.org/1999/xhtml">
<p>Required Formats Attribute</p>
<p>
A series of switches are used to determine which Internet Media types ('MIME types')
are supported, using the 'requiredFormats' attribute,
displaying a 'yes' or 'no' as appropriate. The test is passed if there is text in
the second row of each column, and that text is only
<span style="color:#070">green</span> (in the top table)
or <span style="color:rgb(138, 43, 226)">blueviolet</span> (in the bottom table);
no <span style="color:red">red</span> text is displayed.
</p>
<p>
The SVG Tiny 1.2 specification mandates certain formats, so these must be supported:
image/jpeg, image/png, image/svg+xml.
It is an error not to support them, therefore 'yes' is green and 'no' is red.
</p>
<p>
This test also checks for support of Internet Media types which are
assumed to not exist and are unlikely to ever be registered: garbage/garbage.
Therefore, 'yes' is red and 'no' is green.
</p>
<p>
Lastly, most media types are optional. For example, image/tiff may be
supported but support is not mandated by the SVG Tiny 1.2 specification.
The second table examines these optional formats.
Both 'yes' and 'no' are displayed in blueviolet. Whether the particular Internet Media type
is supported or not does not affect whether the test is passed or failed, but does provide useful
information about the optional capabilities of a particular implementation.
</p>
</d:OperatorScript>
</SVGTestCase>
<title xml:id="test-title">$RCSfile: struct-cond-204-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">
<g fill="#555" font-size="10" text-anchor="middle">
<text fill="#000" x="240" font-size="14" y="30" xml:id="display-title">requiredFormats Attribute</text>
<text x="240" y="45" xml:id="comment-1">
Supported Internet Media types are determined, using the 'requiredFormats' attribute
</text>
<!--text x="240" y="57" xml:id="comment-2">
Results that are expected are marked as such.
</text-->
</g>
<g font-size="10" transform="translate(-30,97)">
<text text-anchor="end" x="340" y="-15" fill="#555" font-size="14">Mandatory Formats</text>
<text x="350" y="-15" fill="#555" font-size="14">Supported?</text>
<text text-anchor="end" x="340" y="0" fill="black">image/svg+xml</text>
<switch>
<text x="350" y="0" fill="green" requiredFormats="image/svg+xml">Yes (required)</text>
<text x="350" y="0" fill="red">No (fail)</text>
</switch>
<text text-anchor="end" x="340" y="12" fill="black">image/png</text>
<switch>
<text x="350" y="12" fill="green" requiredFormats="image/png">Yes (required)</text>
<text x="350" y="12" fill="red">No (fail)</text>
</switch>
<text text-anchor="end" x="340" y="24" fill="black">image/jpeg</text>
<switch>
<text x="350" y="24" fill="green" requiredFormats="image/jpeg">Yes (required)</text>
<text x="350" y="24" fill="red">No (fail)</text>
</switch>
<text text-anchor="end" x="340" y="36" fill="black">foo/foo</text>
<switch>
<text x="350" y="36" fill="red" requiredFormats="garbage/garbage">Yes (fail)</text>
<text x="350" y="36" fill="green">No (expected)</text>
</switch>
<text text-anchor="end" x="340" y="48" fill="black">image/png image/svg+xml foo/foo</text>
<switch>
<text x="350" y="48" fill="red" requiredFormats="image/png image/svg+xml garbage/garbage">Yes (fail)</text>
<text x="350" y="48" fill="green">No (expected)</text>
</switch>
<text text-anchor="end" x="340" y="60" fill="black">image/svg+xml image/png image/jpeg</text>
<switch>
<text x="350" y="60" fill="green" requiredFormats="image/svg+xml image/png image/jpeg">Yes (required)</text>
<text x="350" y="60" fill="red">No (fail)</text>
</switch>
<text text-anchor="end" x="340" y="85" fill="#555" font-size="14">Optional Formats</text>
<text x="350" y="85" fill="#555" font-size="14">Supported?</text>
<text text-anchor="end" x="340" y="100" fill="black">image/tif</text>
<switch>
<text x="350" y="100" fill="rgb(138, 43, 226)" requiredFormats="image/tif">Yes</text>
<text x="350" y="100" fill="rgb(138, 43, 226)">No </text>
</switch>
<text text-anchor="end" x="340" y="112" fill="black">image/g3fax</text>
<switch>
<text x="350" y="112" fill="rgb(138, 43, 226)" requiredFormats="image/g3fax">Yes</text>
<text x="350" y="112" fill="rgb(138, 43, 226)">No</text>
</switch>
<text text-anchor="end" x="340" y="124" fill="black">video/mpeg</text>
<switch>
<text x="350" y="124" fill="rgb(138, 43, 226)" requiredFormats="video/mpeg">Yes</text>
<text x="350" y="124" fill="rgb(138, 43, 226)">No</text>
</switch>
<text text-anchor="end" x="340" y="136" fill="black">video/3gpp</text>
<switch>
<text x="350" y="136" fill="rgb(138, 43, 226)" requiredFormats="video/3gpp">Yes</text>
<text x="350" y="136" fill="rgb(138, 43, 226)">No</text>
</switch>
<text text-anchor="end" x="340" y="148" fill="black">audio/vnd.wave;codec=1</text>
<switch>
<text x="350" y="148" fill="rgb(138, 43, 226)" requiredFormats="audio/vnd.wave;codec=1">Yes</text>
<text x="350" y="148" fill="rgb(138, 43, 226)">No</text>
</switch>
<text text-anchor="end" x="340" y="160" fill="black">audio/3gpp</text>
<switch>
<text x="350" y="160" fill="rgb(138, 43, 226)" requiredFormats="audio/3gpp">Yes</text>
<text x="350" y="160" fill="rgb(138, 43, 226)">No</text>
</switch>
</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.4 $</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>