previous next contents properties index

# Appendix G: Conformance Criteria

### Contents

This appendix is normative.

## G.1 Introduction

Different sets of SVG conformance criteria exist for:

- Conforming SVG Document Fragments
- Conforming SVG Stand-Alone Files
- Conforming SVG Included Documents
- Conforming SVG Generators
- Conforming SVG Interpreters
- Conforming SVG Viewers

## G.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) including SVG's DTD (see Document Type Definition) and also:

- (relative to XML) is well-formed.
- if all non-SVG namespace elements and attributes and all xmlns attributes which refer to non-SVG namespace elements are removed from the given document, and if an appropriate `<?xml...?>` statement is included at the top of the document, and if an appropriate `<!DOCTYPE svg ... >` statement which points to the SVG DTD is included immediately thereafter, the result is a valid XML document.
- conforms to the following W3C Recommendations:
  - the XML 1.0 specification (Extensible Markup Language (XML) 1.0).
  - (if any namespaces other than SVG are used in the document) Namespaces in XML.
  - any use of CSS styles and properties shall conform to Cascading Style Sheets, level 2 CSS2 Specification.
  - any references to external style sheets shall conform to Associating stylesheets with XML documents.

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.

## G.3 Conforming SVG Stand-Alone Files

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

- it is an XML document.
- its root element is an 'svg' element.
- it conforms to the criteria for Conforming SVG Document Fragment.

## G.4 Conforming SVG Included Document Fragments

SVG document fragments can be included within parent XML documents using the XML namespace facilities described in Namespaces in XML.

An SVG document fragment that is included within a parent XML document is a Conforming Included SVG Document Fragment if the SVG document fragment, when taken out of the parent XML document, conforms to the SVG Document Type Definitions (DTD).

In particular, note that individual elements from the SVG namespace cannot be used by themselves. 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-20000303-stylable"
                x="0" y="0" width="10" height="10" />

      <!-- More elements from ParentXML go here -->
    </ParentXML>

Instead, for the SVG part to become a Conforming Included SVG Document Fragment, the file could be modified as follows (the example below shows the use of Stylable SVG):

    <?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-20000303-stylable"
             width="100px" height="100px" >
        <z:rect x="0" y="0" width="10" height="10" />
      </z:svg>

      <!-- More elements from ParentXML go here -->
    </ParentXML>

## G.5 Conforming SVG Generators

A Conforming SVG Generator is a program which:

- always creates at least one of Conforming SVG Document Fragments, Conforming SVG Stand-Alone Files or Conforming SVG Included Documents.
- does not create non-conforming SVG document fragments of any of the above types.

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.

## G.6 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 a raster image) 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. An SVG Viewer does indeed parse and process SVG document fragments, where processing consists of rendering the SVG content to the target medium.

A Conforming SVG Interpreter is defined as follows:

- The interpreter must be able to successfully parse and process any Conforming SVG Document Fragment. (It is not required, however, that the semantics of every possible SVG feature be understood and supported beyond parsing. Thus, for example, a Conforming SVG Interpreter might only parse the defined syntax but not process the semantics of all features in the language.)
- The XML parser must be able to parse and process and XML constructs defined within [XML10] and [XML-NS].
- If the program allows scripts to run against Document Object Model, then a Conforming SVG Interpreter must support the entire DOM model for SVG defined in this specification.

A Conforming SVG Interpreter is required to be one of the following (see Stylable SVG vs. Exchange SVG):

- A Conforming Stylable SVG Interpreter, which represents an SVG Interpreter capable of processing both Stylable SVG and Exchange SVG content. (A Conforming Stylable SVG Interpreter is required to support both Stylable SVG and Exchange SVG.)
- A Conforming Exchange SVG Interpreter, which represents an SVG Interpreter capable of processing only Exchange SVG content.

## G.7 Conforming SVG Viewers

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 apply to platforms and environments which only render static documents, such as printers.
- Conforming Dynamic SVG Viewers apply to platforms and environments such as common web browsers which support user interaction and content whose representation can change over time.

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

- The program must also be a Conforming SVG Interpreter,
- All of SVG static rendering features corresponding to the feature name "SVGStatic" (see Feature strings) must be supported and rendered according to this specification.
- For interactive user environments, facilities must exist for zooming and panning of standalone SVG documents or SVG document fragments embedded within parent XML documents.
- 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 [JPEG] and PNG [PNG10] image formats.
- The viewer must support alpha channel blending of the image of the SVG content onto the target canvas.
- SVG implementations which support the HTTP protocol must correctly support gzip-encoded SVG data streams according to the HTTP 1.1 specification [RFC2616]; thus, the client must specify "Accept-Encoding: gzip" [HTTP-ACCEPT-ENCODING] on its request-header field and then decompress any gzip-encoded data streams that are downloaded from the server. If the implementation supports progressive rendering, the implementation should also support progressive rendering of compressed data streams.
- The viewer must support BASE64 encoded content using the "data:" protocol [RFC2397] wherever URI referencing is permitted within SVG content.
- The viewer must support the following W3C Recommendations with regard to SVG content:
  - complete support for the XML 1.0 specification (Extensible Markup Language (XML) 1.0).
  - complete support for inclusion of non-SVG namespaces within SVG content Namespaces in XML. (Note that data from non-SVG namespaces are included in the DOM but are otherwise ignored.)
  - complete support for all features from CSS2 (Cascading Style Sheets, level 2 CSS2 Specification) that are described in this specification as applying to SVG (see SVG's use of Cascading Style Sheets). The supported features from CSS2 must be implemented in accordance with the conformance definitions from the CSS2 specification.
  - complete support for external style sheets as described in Associating stylesheets with XML documents.
- All visual rendering must be accurate to within one device pixel to the mathematically correct result.
- 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.

Although anti-aliasing support isn't 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 have complete support for an ECMAScript binding of the SVG Document Object Model.

The Web Accessibility Initiative [WAI] 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 using algorithms at least as good as bicubic resampling methods.
- 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).
- Background downloading of images and fonts retrieved from a web server, with updating of the display once the downloads are complete.

A Conforming SVG Viewer is required to be one of the following (see Stylable SVG vs. Exchange SVG):

- A Conforming Stylable SVG Viewer, which represents an SVG Viewer capable of processing both Stylable SVG and Exchange SVG content. (A Conforming Stylable SVG Viewer is required to support both Stylable SVG and Exchange SVG.)
- A Conforming Exchange SVG Viewer, which represents an SVG Viewer capable of processing only Exchange SVG content.

Thus, there are multiple independent conformance axes for a Conforming SVG Viewer:

- static vs. dynamic
- high-quality (yes or no)
- Stylable SVG and Exchange SVG vs. Exchange SVG only

Any combination of the above are possible in a particular Conforming SVG Viewer. An implementation that supports all of the options would be a Conforming Dynamic, High-Quality, Stylable SVG Viewer.

If the user agent includes a CSS2 capability, a Conforming Stylable SVG Viewer must support CSS styling of Stylable SVG content.

previous next contents properties index