Chapter 1: Introduction
Contents
1.1. About SVG
This specification defines the features and syntax for
Scalable Vector Graphics (SVG).
SVG is a language for describing two-dimensional graphics.
As a standalone format or when mixed with other XML, it uses the
XML syntax [XML10].
When mixed with HTML5, it uses the HTML5 syntax [HTML].
SVG allows for three types of graphic objects: vector graphic
shapes (e.g., paths consisting of straight lines and curves),
images and text. Graphical objects can be grouped, styled,
transformed and composited into previously rendered objects.
The feature set includes nested transformations, clipping
paths, alpha masks, filter effects and template objects.
SVG drawings can be interactive
and dynamic. Animations
can be defined and triggered
either declaratively (i.e., by embedding SVG animation elements
in SVG content) or via scripting.
Sophisticated applications of SVG are possible by use of a
supplemental scripting language which accesses
SVG Document Object Model (DOM), which
provides complete access to all elements, attributes and
properties. A rich set of event handlers
such as ‘onmouseover’ and ‘onclick’ can be assigned to any SVG
graphical object.
Because of its compatibility and
leveraging of other Web standards, features like
scripting can be done on HTML and SVG
elements simultaneously within the same Web page.
SVG is a language for rich graphical content. For
accessibility reasons, if there is an original source document
containing higher-level structure and semantics, it is
recommended that the higher-level information be made available
somehow, either by making the original source document
available, or making an alternative version available in an
alternative format which conveys the higher-level information,
or by using SVG's facilities to include the higher-level
information within the SVG content. For suggested techniques in
achieving greater accessibility, see
Accessibility.
1.2. SVG MIME type and file name extensions
The MIME type for SVG is "image/svg+xml
" (see
IANA Media Type Registry).
It is recommended that SVG files have the extension
".svg"
(all lowercase) on all platforms. It is
recommended that gzip-compressed
[RFC1952]
SVG files have the extension ".svgz"
(all
lowercase) on all platforms.
1.3. SVG namespace and DTD
The SVG 2 namespace is http://www.w3.org/2000/svg
,
which is the same as for earlier versions of SVG.
When using the XML syntax, a namespace declaration is required. When
using the HTML syntax, the namespace is provided automatically by the parser.
A DTD is not provided in this specification, as the use of DTDs for
validating documents is known to be problematic. In particular, DTDs
do not handle namespaces gracefully and the range of constraints they can express is limited. It is recommended that authors
do not include a DOCTYPE declaration in SVG documents.
1.4. Compatibility with other standards efforts
SVG leverages and integrates with other W3C specifications
and standards efforts, as described in the following:
1.5. Terminology
Within this specification, the key words "MUST", "MUST NOT",
"REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT",
"RECOMMENDED", "MAY", and "OPTIONAL" are to be interpreted as
described in Key words for use in RFCs to Indicate Requirement Levels
[RFC2119].
However, for readability, these words do not appear in all
uppercase letters in this specification.
At times, this specification recommends good practice for
authors and user agents. These recommendations are not
normative and conformance with this specification does not
depend on their realization. These recommendations contain the
expression "We recommend ...", "This specification recommends
...", or some similar wording.
1.6. Definitions
There should be a separate section that lists
element and attribute categories and their members.
- invalid value
- An invalid value specified for a property, either in a style sheet
or a presentation attribute, is one that is either not allowed according
to the grammar defining the property's values, or is allowed by the grammar but
subsequently disallowed in prose. A CSS declaration with an invalid value is
ignored; see Declarations
and properties ([CSS21], section 4.1.8).
- lacuna value
-
A lacuna value is a defined behavior used when an attribute or
property is not specified, or when an attribute or property has an
unsupported value.
This value is to be used for the purposes of rendering, calculating
animation values, and when accessing the attribute or property. As
opposed to an XML default value, however, the attribute
or property and its value are not visible in the DOM, and cannot be
accessed with DOM methods.
For properties, if the property is inherited and
there is no inherited value (for example, on the root element), the
lacuna value is the initial value
as specified in the definition of that property.
For non-inherited properties, the lacuna value is always the initial value.
"Unsupported value" should be a term that is linked to.
Note that a lacuna value is distinct from the XML term
default value,
which uses DTD lookup to determine whether an attribute is required
and what its value is, and inserts required attributes and their
values into the DOM
([XML10], section 3.3.2).
At the XML parser level, SVG Tiny 1.2 does not have default values;
lacunae are part of the SVG application layer, and their values are
derived from the UA.
- local URL reference
- An Internationalized Resource Identifier [RFC3987] that does
not include an <absoluteURL> or
<relativeURL> and thus
represents a reference to an element within the current
document. See References and the
‘defs’ element.
Unify this with other specifiction defintions of URL
- markable element
- A markable element is one that can have markers
painted on it either through the use of the marker properties
or by having a ‘marker’ element as a child.
The following elements are markable elements:
‘line’, ‘path’, ‘polygon’ and ‘polyline’
- non-local URL reference
- An Internationalized Resource Identifier [RFC3987] that
includes an <absoluteURL> or
<relativeURL> and thus
(usually) represents a reference to a different document or
an element within a different document. See
References and the
‘defs’ element.
Unify this with other specifiction defintions of URL. But see HTML5 refs section on URL
which is complex.
- presentation attribute
- An attribute on an SVG element which specifies a
value for a given property
for that element.
See Styling. Note that
although any property may be specified on any element,
not all properties will apply to (affect the rendering of)
a given element. The definition of each property states to what set
of elements it applies.
- property
- A parameter that helps specify how a document should be
rendered. A complete list of SVG's properties can be found in
Property Index. Properties are
assigned to elements in the SVG language either by
presentation attributes
on elements in the SVG language or by using a styling language such as CSS
[CSS21]. See
Styling.
- structural element
- The structural elements are those which define the primary
structure of an SVG document. Specifically, the following
elements are structural elements:
‘defs’, ‘g’, ‘svg’, ‘symbol’ and ‘use’.
- structurally external element
- Elements that define its structure by reference to an external resource.
Specifically, the following elements are structurally external elements when
they have an ‘xlink:href’ attribute:
‘audio’, ‘foreignObject’, ‘iframe’, ‘image’, ‘script’, ‘use’ and ‘video’.
- SVG user agent
- An SVG user agent is a user agent that is able to retrieve and
render SVG content.
- transformation
- A modification of the current transformation matrix by providing a supplemental
transformation in the form of a set of simple transformations
specifications (such as scaling, rotation or translation)
and/or one or more transformation matrices.
See Coordinate system
transformations.
- transformation matrix
- Transformation matrices define the mathematical mapping
from one coordinate system into another using a 3x3 matrix
using the equation [x' y' 1] = [x y 1] * matrix.
See current transformation matrix
and Coordinate system transformations.
- URL reference
- An URL reference is an Internationalized Resource Identifier
with an optional fragment identifier, as defined in
Internationalized Resource Identifiers
[RFC3987].
An URL reference serves as a reference to a resource or (with a
fragment identifier) to a secondary resource. See
References and
References and the
‘defs’ element.
- user agent
-
The general definition of a user agent is an application
that retrieves and renders Web content, including text,
graphics, sounds, video, images, and other content types. A
user agent may require additional user agents that handle
some types of content. For instance, a browser may run a
separate program or plug-in to render sound or video. User
agents include graphical desktop browsers, multimedia
players, text browsers, voice browsers, and assistive
technologies such as screen readers, screen magnifiers,
speech synthesizers, onscreen keyboards, and voice input
software.
A "user agent" may or may not have the ability to retrieve
and render SVG content; however, an "SVG user agent"
retrieves and renders SVG content.
- user space
- user coordinate system
- In general, a coordinate system defines locations and
distances on the current canvas.
The current user coordinate system is the coordinate system that is currently
active and which is used to define how coordinates and
lengths are located and computed, respectively, on the
current canvas. See
initial user coordinate
system and Coordinate
system transformations.
- user units
- A coordinate value or length expressed in user units
represents a coordinate value or length in the current
user coordinate system.
Thus, 10 user units represents a length of 10 units in the
current user coordinate system. If not specified otherwise, one user unit
is also equal to one CSS pixel in current
user coordinate system.
- viewport
- A rectangular region within the current
canvas onto which graphics elements are to be
rendered. See the discussion of the
SVG viewport in the
chapter on Coordinate Systems,
Transformations and Units.
- viewport space
- viewport coordinate system
- In general, a coordinate system defines locations and
distances on the current canvas.
The viewport coordinate system is the coordinate system that is active at the
start of processing of an ‘svg’ element, before
processing the optional ‘viewBox’ attribute. In the
case of an SVG document fragment that is embedded within a
parent document which uses CSS to manage its layout, then the
viewport coordinate system will have the same orientation and
lengths as in CSS, with the origin at the top-left on the
viewport. See The initial viewport and
Establishing a
new viewport.
- viewport units
- A coordinate value or length expressed in viewport units
represents a coordinate value or length in the
viewport coordinate system.
Thus, 10 viewport units represents a length of 10 units in the viewport
coordinate system.
People might mix this up with the CSS viewport which is relevant in SVG as well. We should be explicit here.
- white space characters
- The following characters are considered white space characters:
U+0009 CHARACTER TABULATION,
U+000C FORM FEED (FF),
U+000D CARRIAGE RETURN (CR),
U+000A LINE FEED (LF) and
U+0020 SPACE.
- XLink attributes
- The XLink attributes are two of the seven attributes defined in
the XML Linking Language
specification [XLINK], which are used
on various SVG elements that can reference resources. The most
important XLink attribute is ‘xlink:href’,
whose definition can be found on each element that allows it.
‘xlink:title’ is also allowed on any element that supports
the ‘xlink:href’ attribute.
The remaining five XLink attributes –
‘xlink:type’,
‘xlink:role’,
‘xlink:arcrole’,
‘xlink:show’ and
‘xlink:actuate’ –
are not used in SVG.