SVG 2 – 15 September 2015 TopContentsPreviousNextElementsAttributesProperties

# Appendix D: Conformance Criteria

## Contents

This appendix is normative.

## D.1. Introduction

In order to ensure that SVG-family documents are maximally portable among SVG-family user agents, this specification rigidly defines conformance requirements for both, as well as for SVG-family document types. While the conformance definitions can be found in this appendix, they necessarily reference normative text within this document and within other related specifications. It is only possible to fully comprehend the conformance requirements of SVG through a complete reading of all normative references.

## D.2. Conforming SVG Document Fragments

An SVG document fragment is a Conforming SVG Document Fragment if it adheres to the specification described in this document (Scalable Vector Graphics (SVG) Specification) and also:

SVG document fragments can be included within parent XML documents using the XML namespace facilities described in Namespaces in XML [XML-XS]. Note, however, that since a Conforming SVG Document Fragment must have an svg element as its root, the use of an individual non-svg element from the SVG namespace is disallowed. Thus, the SVG part of the following document is not conforming:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE SomeParentXMLGrammar PUBLIC "-//SomeParent" "http://SomeParentXMLGrammar.dtd">
<ParentXML>
<!-- Elements from ParentXML go here -->
<!-- The following is not conforming -->
<z:rect xmlns:z="http://www.w3.org/2000/svg"
x="0" y="0" width="10" height="10" />
<!-- More elements from ParentXML go here -->
</ParentXML>

Instead, for the SVG part to become a Conforming SVG Document Fragment, the file could be modified as follows:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE SomeParentXMLGrammar PUBLIC "-//SomeParent" "http://SomeParentXMLGrammar.dtd">
<ParentXML>
<!-- Elements from ParentXML go here -->
<!-- The following is conforming -->
<z:svg xmlns:z="http://www.w3.org/2000/svg"
width="100px" height="100px">
<z:rect x="0" y="0" width="10" height="10"/>
</z:svg>
<!-- More elements from ParentXML go here -->
</ParentXML>


The SVG language or these conformance criteria provide no designated size limits on any aspect of SVG content. There are no maximum values on the number of elements, the amount of character data, or the number of characters in attribute values.

## D.3. Conforming SVG Stand-Alone Files

A file is a Conforming SVG Stand-Alone File if:

## D.4. Conforming SVG Generators

A Conforming SVG Generator is a program which:

Additionally, an authoring tool which is a Conforming SVG Generator conforms to all of the Priority 1 accessibility guidelines from the document Authoring Tool Accessibility Guidelines 1.0 [ATAG] that are relevant to generators of SVG content. (Priorities 2 and 3 are encouraged but not required for conformance.)

SVG generators are encouraged to follow W3C developments in the area of internationalization. Of particular interest is the W3C Character Model and the concept of Webwide Early Uniform Normalization, which promises to enhance the interchangability of Unicode character data across users and applications. Future versions of the SVG specification are likely to require support of the W3C Character Model in Conforming SVG Generators.

## D.5. Conforming SVG Servers

Conforming SVG Servers must meet all the requirements of a Conforming SVG Generator. In addition, Conforming SVG Servers using HTTP or other protocols that use Internet Media types must serve SVG stand-alone files with the media type "image/svg+xml".

Also, if the SVG file is compressed with gzip or deflate, Conforming SVG Servers must indicate this with the appropriate header, according to what the protocol supports. Specifically, for content compressed by the server immediately prior to transfer, the server must use the "Transfer-Encoding: gzip" or "Transfer-Encoding: deflate" headers as appropriate, and for content stored in a compressed format on the server (e.g. with the file extension "svgz"), the server must use the "Content-Encoding: gzip" or "Content-Encoding: deflate" headers as appropriate.

Note: Compression of stored content (the "entity," in HTTP terms) is distinct from automatic compression of the message body, as defined in HTTP/1.1 TE/ Transfer Encoding ([RFC2616], sections 14.39 and 14.41).

## D.6. Conforming SVG DOM Subtree

A DOM subtree rooted at a given element is a Conforming SVG DOM Subtree if, once serialized to XML, is a Conforming SVG Document Fragment. If the DOM subtree cannot be serialized to XML, such as when a Comment node's data contains the substring "--", then the subtree is not a Conforming SVG DOM Subtree.

## D.7. Conforming SVG Interpreters

An SVG interpreter is a program which can parse and process SVG document fragments. Examples of SVG interpreters are server-side transcoding tools (e.g., a tool which converts SVG content into modified SVG content) or analysis tools (e.g., a tool which extracts the text content from SVG content). An SVG viewer also satisfies the requirements of an SVG interpreter in that it can parse and process SVG document fragments, where processing consists of rendering the SVG content to the target medium.

In a Conforming SVG Interpreter, the XML parser must be able to parse and process all XML constructs defined within XML 1.0 [XML10] and Namespaces in XML [XML-NS].

There are two sub-categories of Conforming SVG Interpreters:

• Conforming Static SVG Interpreters must be able to parse and process the static language features of SVG that correspond to the feature string "http://www.w3.org/TR/SVG11/feature#SVG-static".
• In addition to the requirements for the static category, Conforming Dynamic SVG Interpreters must be able to parse and process the language features of SVG that correspond to the feature string "http://www.w3.org/TR/SVG11/feature#SVG-dynamic" and which support all of the required features in the SVG DOM described in this specification.

Now that feature strings have been removed, the above conformance classes need to be defined without reference to them.

A Conforming SVG Interpreter must parse any SVG document correctly. It is not required to interpret the semantics of all features correctly.

Note: A transcoder from SVG into another graphics representation, such as an SVG-to-raster transcoder, represents a viewer, and thus viewer conformance criteria apply. (See Conforming SVG Viewers.)

## D.8. Conforming SVG Viewers

Action: Look at the performance class requirements and decide whether to remove points or move them into general requirements. (heycam) Spec that calculation of CTMs should use double precision. (stakagi) Remove performance class requirements from SVG 2. ( ConformingHighQualitySVGViewers ) To modulate the tradeoff of a numerical precision in use cases of the technical drawing and mapping, and the performance of user agent. heycam, stakagi

An SVG viewer is a program which can parse and process an SVG document fragment and render the contents of the document onto some sort of output medium such as a display or printer; thus, an SVG Viewer is also an SVG Interpreter.

There are two sub-categories of Conforming SVG Viewers:

• Conforming Static SVG Viewers support the static language features of SVG that correspond to the feature string "http://www.w3.org/TR/SVG11/feature#SVG-static". This category often corresponds to platforms and environments which only render static documents, such as printers.
• Conforming Dynamic SVG Viewers support the language features of SVG that correspond to the feature string "http://www.w3.org/TR/SVG11/feature#SVG-dynamic". This category often applies to platforms and environments such as common Web browsers which support user interaction and dynamic document content (i.e., documents whose content can change over time). (User interaction includes support for hyperlinking, events [e.g., mouse clicks], text selection, zooming and panning [see Scripting and Interactivity]. Dynamic document content can be achieved via declarative animation or by scripts modifying the SVG DOM.)

Now that feature strings have been removed, the above conformance classes need to be defined without reference to them.

Specific criteria that apply to both Conforming Static SVG Viewers and Conforming Dynamic SVG Viewers:

• The program must also be a Conforming SVG Interpreter.
• For interactive user environments, facilities must exist for zooming and panning of stand-alone SVG documents or SVG document fragments embedded within parent XML documents.
• In environments that have appropriate user interaction facilities, the viewer must support the ability to activate hyperlinks.
• If printing devices are supported, SVG content must be printable at printer resolutions with the same graphics features available as required for display (e.g., the specified colors must be rendered on color printers).
• On systems where this information is available, the parent environment must provide the viewer with information about physical device resolution. In situations where this information is impossible to determine, the parent environment shall pass a reasonable value for device resolution which tends to approximate most common target devices.
• The viewer must support JPEG and PNG image formats [JPEG] [PNG].
• Resampling of image data must be consistent with the specification of property ‘image-rendering’.
• Areas of an image of SVG content may have opacity less than 100%. The viewer must at least support Simple Alpha Compositing of the image of the SVG content onto the target canvas, as described in the Compositing and Blending Specification [COMPOSITING-BLENDING].
• SVG implementations must correctly support gzip-encoded [RFC1952] and deflate-encoded [RFC1951] data streams, for any content type (including SVG, script files, images). SVG implementations that support HTTP must support these encodings according to the HTTP 1.1 specification [RFC2616]; in particular, the client must specify with an "Accept-Encoding:" request header [HTTP-ACCEPT-ENCODING] those encodings that it accepts, including at minimum gzip and deflate, and then decompress any gzip-encoded and deflate-encoded data streams that are downloaded from the server. When an SVG viewer retrieves compressed content (e.g., an .svgz file) over HTTP, if the "Content-Encoding" and "Transfer-Encoding" response headers are missing or specify a value that does not match the compression method that has been applied to the content, then the SVG viewer must not render the content and must treat the document as being in error.
• The viewer must support base64 encoded content using the "data:" URL scheme [RFC2397] wherever URI referencing of whole documents (such as raster images, SVG documents, fonts and color profiles) is permitted within SVG content. (Note: fragments of SVG content which do not constitute an entire SVG document are not available using the "data:" URL scheme.)
• The viewer must support the following W3C Recommendations with regard to SVG content:
• complete support for the XML 1.0 specification [XML10].
• complete support for inclusion of non-SVG namespaces within SVG content as defined in Namespaces in XML [XML-NS]. (Note that data from non-SVG namespaces are included in the DOM but are otherwise ignored.)
• All visual rendering must be accurate to within one device pixel (px unit) to the mathematically correct result at the initial 1:1 zoom ratio. It is suggested that viewers attempt to keep a high degree of accuracy when zooming.
• On systems which support accurate sRGB [SRGB] color, all sRGB color computations and all resulting color values must be accurate to within one sRGB color component value, where sRGB color component values range from 0 to 255.
• The viewer must use at least single-precision floating point for intermediate calculations on any numerical operations for conversion of coordinates. However, in order to prevent the rounding error on coordinate transformation, at least double-precision floating point computation must be used on CTM generation processing. Such minimum typical computation way is expressed with following formulas.
$\begin{array}{l}\left(\text{single}\right)\text{CTM}=\left(\text{single}\right)\left(\left(\text{double}\right)\left[\begin{array}{ccc}{a}_{1}& {c}_{1}& {e}_{1}\\ {b}_{1}& {d}_{1}& {f}_{1}\\ 0& 0& 1\end{array}\right]\cdot \left(\text{double}\right)\left[\begin{array}{ccc}{a}_{2}& {c}_{2}& {e}_{2}\\ {b}_{2}& {d}_{2}& {f}_{2}\\ 0& 0& 1\end{array}\right]\cdot \text{...}\cdot \left(\text{double}\right)\left[\begin{array}{ccc}{a}_{n}& {c}_{n}& {e}_{n}\\ {b}_{n}& {d}_{n}& {f}_{n}\\ 0& 0& 1\end{array}\right]\right)\\ \left(\text{single}\right)\left[\begin{array}{c}{x}_{\mathrm{viewport}}\\ {y}_{\mathrm{viewport}}\\ 1\end{array}\right]=\left(\text{single}\right)\text{CTM}\cdot \left(\text{single}\right)\left[\begin{array}{c}{x}_{\mathrm{userspace}}\\ {y}_{\mathrm{userspace}}\\ 1\end{array}\right]\end{array}$
Furthermore, when it has nested viewport coordinate sytstems, the ScreenCTM which is a transformation matrix produced by nested CTM for transforming user coordinates into the coordinates of an output device also must be generated by double-precision floating point computation.

Although anti-aliasing support is not a strict requirement for a Conforming SVG Viewer, it is highly recommended for display devices. Lack of anti-aliasing support will generally result in poor results on display devices.

Specific criteria that apply to only Conforming Dynamic SVG Viewers:

• In Web browser environments, the viewer must have the ability to search and select text strings within SVG content.
• If display devices are supported, the viewer must have the ability to select and copy text from SVG content to the system clipboard.
• The viewer must be a conforming ECMAScript implementation of all the IDL fragments in this specification. [WEBIDL]

The Web Accessibility Initiative is defining User Agent Accessibility Guidelines 1.0 [UAAG]. Viewers are encouraged to conform to the Priority 1 accessibility guidelines defined in this document, and preferably also Priorities 2 and 3. Once the guidelines are completed, a future version of this specification is likely to require conformance to the Priority 1 guidelines in Conforming SVG Viewers.

A higher order concept is that of a Conforming High-Quality SVG Viewer, with sub-categories Conforming High-Quality Static SVG Viewer and Conforming High-Quality Dynamic SVG Viewer.

Both a Conforming High-Quality Static SVG Viewer and a Conforming High-Quality Dynamic SVG Viewer must support the following additional features:

• Professional-quality results with good processing and rendering performance and smooth, flicker-free animations.
• On low-resolution devices such as display devices at 150dpi or less, support for smooth edges on lines, curves and text. (Smoothing is often accomplished using anti-aliasing techniques.)
• Color management via ICC profile support (i.e., the ability to support colors defined using ICC profiles).
• Resampling of image data must conform to the requirements for Conforming High-Quality SVG Viewers as specified in the description of property ‘image-rendering’.
• At least double-precision floating point computation on coordinate system transformation numerical calculations.

A Conforming High-Quality Dynamic SVG Viewer must support the following additional features:

• Progressive rendering and animation effects (i.e., the start of the document will start appearing and animations will start running in parallel with downloading the rest of the document).
• Restricted screen updates (i.e., only required areas of the display are updated in response to redraw events).

A Conforming SVG Viewer must be able to apply styling properties to SVG content using presentation attributes.

If the user agent supports Cascading Style Sheets, level 2 revision 1 [CSS21], a Conforming SVG Viewer must support CSS styling of SVG content and must support all features from CSS 2.1 that are described in this specification as applying to SVG (see Styling). The supported features from CSS 2.1 must be implemented in accordance with the conformance definitions from the CSS 2.1 specification ([CSS21], section 3.2).

If the user agent includes an HTML or XHTML viewing capability or can apply CSS/XSL styling properties to XML documents, then a Conforming SVG Viewer must support resources of MIME type "image/svg+xml" wherever raster image external resources can be used, such as in the HTML or XHTML ‘img’ element and in CSS/XSL properties that can refer to raster image resources (e.g., ‘background-image’).

SVG 2 – 15 September 2015 TopContentsPreviousNextElementsAttributesProperties