W3C

Mobile SVG Profiles: SVG Tiny and SVG Basic, Version 1.2

W3C Working Draft 09 December 2003

This version:
http://www.w3.org/TR/2003/WD-SVGMobile12-20031209/
Latest SVG Mobile 1.2 version:
http://www.w3.org/TR/SVGMobile12/
Latest SVG Mobile Recommendation:
http://www.w3.org/TR/SVGMobile/
Editor:
Tolga Capin (Nokia) <Tolga.Capin@nokia.com>
Authors:
See author list

Abstract

This document defines two mobile profiles of SVG 1.2. The first profile, SVG Tiny 1.2, is defined to be suitable for cellphones; the second profile, SVG Basic 1.2, is suitable for PDAs.

Status of this document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This document is the first public working draft of Version 1.2 of the SVG Mobile Profiles: SVG Basic and SVG Tiny.

This document has been produced by the W3C SVG Working Group as part of the W3C Graphics Activity within the Interaction Domain.

We explicitly invite comments on this specification. Please send them to www-svg@w3.org: the public email list for issues related to vector graphics on the Web. This list is archived and acceptance of this archiving policy is requested automatically upon first post. To subscribe to this list send an email to www-svg-request@w3.org with the word subscribe in the subject line.

The latest information regarding patent disclosures related to this document is available on the Web. As of this publication, the SVG Working Group are not aware of any royalty-bearing patents they believe to be essential to SVG.

Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

Table of contents

Sections highlighted in yellow contains new information relevant to SVG Mobile 1.2. The other sections are unmodified from SVG Mobile 1.1. 


1. Introduction

Reading Instructions:
This is the first draft of this specification and large parts of it are not updated from the 1.1 version of the specification. To facilitate for the reader the following color codes have been used to highlight relevant sections:
-Text in a green box (like this one) is used to inform the reader about open/unresolved issues and other relevant information.
-Text in light yellow boxes describes new features in SVGT1.2.
All the text outside of those boxes can possibly be out of date/wrong. 

Note that all the appendixes are up to date and contains new 1.2 information.

All the new functionality in this draft is for SVG Tiny 1.2. The Working Group has not decided what to do with regards to SVG Basic 1.2. There has so far been no demand for new SVG Basic features. The proposed solutions are either to not specify SVG Basic 1.2 at all or to specify SVG Basic 1.2 as SVG Tiny 1.2 combined with SVG Basic 1.1.

The SVG Full Working Group are considering to split the svg specification into two branches, image and application. There is still no concensus regarding this. The Mobile subgroup will follow whatever decision the entire group takes. If there will be an image/application split for SVG Full 1.2 there will be the same for the mobile profiles. The difference between image and application is that application will contain scripting functionality.

It has been established by industry demand, overwhelming support in the SVG working group and requests from the SVG developer community that some form of SVG suited to displaying vector graphics on small devices is required. Moreover, the mission statement of SVG 1.0 specifically addresses small devices as a target area for vector graphics display. In order to meet these demands the SVG Working Group has committed to a concerted effort to create a profile specification that addresses mobile devices.

A single such profile is not sufficient to deal with the variety of mobile devices, because each mobile device has different characteristics in terms of CPU speed, memory size, and color support. To address the range of different device families, two profiles are defined. The first low-level profile, SVG Tiny (SVGT) is suitable for highly restricted mobile devices; while the second profile, SVG Basic (SVGB) is targeted for higher level mobile devices.

Because of the low memory, low CPU power and limited display of mobile devices, Mobile SVG profiles introduce constraints on content, attribute types, properties, and user agent behavior. This section describes these constraints and design rationale behind them.

  1. Two profiles are designed to allow SVG to render on mobile devices with limited memory, CPU power, and bandwidth.
  2. Mobile SVG profiles attempt to maximize compatibility with SVG 1.0 to display existing content.
  3. A true subset of the SVG 1.0 imaging model is maintained.
  4. Mobile SVG is designed to facilitate export from authoring tools.
  5. Mobile SVG is designed so that SVG 1.1 can be transcoded into SVGB and SVGT preserving as much scalability as possible.
  6. To ensure interoperability between content and software tools compliant with different profiles, SVGT is specified to be a proper subset of SVGB, and SVGB to be a proper subset of SVG 1.1.

2. Mobile SVG Document Types

SVGT and SVGB consist of the following SVG 1.1 modules. For each module, a given profile might contain the Full version, the subsetted Basic version, or no version of that module. For ease of use, the relevant elements in each module are given; in modules other than Full, not all attributes may be supported and there may be restrictions on attribute values. For details, see the module definitions in the SVG 1.1 specification.

SVG Tiny

Structure
Core Attribute Module
Basic Structure Module
defs, desc, g, metadata, svg, title, use
Painting
Basic Paint Attribute Module
Basic Graphics Attribute Module
Hyperlinking
Hyperlinking
a
XLink Attribute Module
Conditional Processing
Conditional Processing Module
switch
Shapes
Shape Module
circle, ellipse, line, path, polygon, polyline, rect
Images
Image Module
image
Text
Basic Text Module
text
Fonts
Basic Font Module
font, font-face, font-face-name, font-face-src, glyph, hkern, missing-glyph
Animation
Animation Module
animate, animateColor, animateMotion, animateTransform, mpath, set
Extensibility
Extensibility Module
foreignObject

SVG Basic

Structure
Core Attribute Module
Structure Module
defs, desc, g, metadata, svg, symbol, title, use
Viewport Attribute Module
Style
Style Module
style
Painting
Paint Attribute Module
Opacity Attribute Module
Graphics Attribute Module
Hyperlinking
Hyperlinking Module
a
XLink Attribute Module
External Resources Attribute Module
Conditional Processing
Conditional Processing Module
switch
Shapes
Shape Module
circle, ellipse, line, path, polygon, polyline, rect
Images
Image Module
image
Text
Text Module
altGlyph, altGlyphDef, altGlyphItem, glyphRef, text, textPath, tref, tspan
Color Profile
Color Profile Module
color-profile
Gradients
Gradient Module
linearGradient, radialGradient, stop
Patterns
Pattern Module
pattern
Clipping
Basic Clip Module
clipPath
Masking
Mask Module
mask
Fonts
Font Module
definition-src, font, font-face, font-face-format, font-face-name, font-face-src, font-face-uri, glyph, hkern, missing-glyph, vkern
Interactivity
Document Events Attribute Module
Graphical Element Events Attribute Module
Animation Events Attribute Module
Scripting
Scripting Module
script
Views
View Module
view
Filters
Basic Filter Module
feBlend, feColorMatrix, feComponentTransfer, feComposite, feFlood, feGaussianBlur, feImage, feMerge, feMergeNode, feOffset, feTile, feFuncR, feFuncG, feFuncB, feFuncA, filter
Animation
Animation Module
animate, animateColor, animateMotion, animateTransform, mpath, set
Extensibility
Extensibility Module
foreignObject
Document Model
Basic Document Model Module

3. Data Types

Data Type Description
Number SVGT and SVGB support fixed point numbers, thus all numbers must be limited in range between -32,767.9999 to +32,767.9999 or the scientific notation equivalent.
Length SVGT only supports user units (i.e., CSS units are not supported), with the one exception that the 'width' and 'height' attributes on the outermost 'svg' element can specify values in any of the following CSS units: in, cm, mm, pt, pc, and %. SVGB supports lengths in user coordinate space and in CSS units.
Coordinate SVGT and SVGB support the coordinate data type, represented with a <length> value.
List of XXX (where XXX represents a value of some type): SVGT and SVGB support the list specification.
Angle SVGT only supports angles if specified with no CSS unit identifiers (which means all angles are in degrees). SVGB supports angles with CSS unit identifiers.
Color SVGT and SVGB support <color> in the CSS2-compatible specification for a color in the sRGB color space, and system colors. Additionally, SVGB and SVGT support 16 original color keywords from XHTML, and do not support X11 colors. SVGB also allows optional support of ICC color profiles.
Paint SVGB supports paint specification for fill and stroke operations, as well as linear and radial gradients. SVGT does not support the more general notion of paint specification and thus only supports solid color fills and strokes.
Percentage SVGB supports percentages. SVGT does not support percentage values except for the 'width' and 'height' attributes on the outermost 'svg' element.
Transform List SVGB and SVGT support transform lists.
URI SVGB and SVGT support the URI datatype.
Frequency SVGB and SVGT do not support frequency values.
Time SVGB and SVGT support time values, with unit identifiers (ms, s).

4. Document Structure

Mobile SVG Document Fragment

SVGB and SVGT content can be in the form of stand-alone SVG Documents or document fragments embedded within a parent XML document. The following is an example of an SVG document fragment embedded within an XHTML 1.1 document:

  
      <?xml version="1.0" standalone="yes"?>
      <html xmlns="http://www.w3.org/1999/xhtml"
               xmlns:svg="http://www.w3.org/2000/svg">
      <head>
          <title xml:lang="en">Sample XHTML + SVG document</title>
      </head>
      <body>
         <svg:svg width="4cm" height="8cm" version="1.1" baseProfile="tiny" >
             <svg:ellipse cx="2" cy="4" rx="2" ry="1" />
         </svg:svg>
      </body>
      </html>

The 'title', 'desc', 'metadata' Elements

SVGB and SVGT support the 'title', 'desc' and 'metadata' elements as defined in SVG 1.1.

The 'svg' Element

SVG Tiny content cannot have nested child 'svg' elements.

The 'baseProfile' attribute on the outermost 'svg' element must have the value "tiny" for SVG Tiny content, and "basic" for SVG Basic content. The 'baseProfile' attribute on nested child 'svg' elements is ignored. The SVG 1.1 specification states that the 'version' attribute of the outermost 'svg' element in SVG 1.1 content must have the value "1.1".

References and the 'defs' Element

For SVGT, all referenced objects, except on the 'image' and 'a' elements, must be internal (using the 'data:' URL scheme, and base64 encoding). SVGB does not put extra limitations on external references as defined by SVG 1.1.

The 'symbol' Element

SVGT does not support symbols.

The 'use' Element

Note that, in SVG 1.1, animations on a referenced element will cause the instances to be animated. SVGB and SVGT also support this feature.

The 'image' Element

SVGB and SVGT require support of the JPEG and PNG formats on the image element. SVGB also requires support of SVG format on the image element.

The 'switch' Element

SVGT and SVGB support the switch element, to determine which SVG 1.1 features are supported by the user agent.

The following feature strings are allowed for SVGT:

The following feature strings are allowed for SVGB:

Progressive Downloading

SVGT 1.2 supports the page and pageSet elements, and streamable attribute as defined in the SVG 1.2 draft

Progressive Rendering

SVGT 1.2 supports the externalResourcesRequired attribute to enable progressive rendering, as defined in the SVG 1.2 draft

Specification of thumbnails

SVG Tiny 1.2 allows content to specify a thumbnail. The group is investigating solutions for this feature.

The 'audio' Element

SVGT 1.2 supports the audio element as defined in the SVG 1.2 draft. SVGT 1.2 allows to switch between different audio formats but will not mandate any audio format.

5. Styling

SVGB and SVGT support subsets of SVG 1.1's presentation attributes.

SVGB allows optional support of CSS Mobile Profile 1.0. SVGT does not support styling with CSS.

SVGB and SVGT can introduce constraints on style properties. Allowed values for style properties are listed in Appendix C.

6. Coordinate Systems, Transformations and Units

SVG Tiny shall support the new transform definition type 'ref(<target>, <x>, <y>)' as defined in the SVG 1.2 specification. SVG Tiny supports only 'host' as a target.

SVGB and SVGT support SVG 1.1's notion of viewports.

SVGB and SVGT support nesting of transformations. The types of transformations that are allowed are generic transformation matrices, or simple operations such as rotation, scaling, skewing, and translation.

The 'transform' Attribute

SVGB and SVGT support the transform attribute. The following transform definition types are supported:

The 'viewBox' Attribute

SVGB and SVGT fully support the 'viewBox' attribute. SVGT has restrictions on allowed preserveAspectRatio attribute values.

The 'preserveAspectRatio' Attribute

SVGB and SVGT support the 'preserveAspectRatio' attribute for adapting the content to devices with different display aspect ratios.

In SVGT, the <align> parameter can only be either 'none' or 'XMidYMid', the <meetOrSlice> parameter can only be 'meet'.

In SVGB, the values of this parameter can be the same as in SVG 1.1.

Establishing a New Viewport

SVGB supports establishing a new viewport via additional embedded 'svg' elements. SVGT does not allow nested 'svg' elements.

Units

SVGT supports user units only, except for the 'width' and 'height' attributes on the outermost 'svg' element where CSS units are also supported. SVGB supports both user units and CSS user identifiers.

Object Bounding Box Units

SVGT does not support bounding box unit specification.

7. Shapes

Paths

SVGB and SVGT support all SVG 1.1 path commands, except the elliptical arc curve command ("A"(absolute) and "a"(relative)).

The path element data is animatable, as defined in the SVG 1.1 specification.

Basic Shapes

SVGT and SVGB support the basic shapes (rectangles, circles, ellipses, lines, polylines, and polygons) as defined in SVG 1.1.

8. Text

SVGB and SVGT represent text with Unicode characters. Mobile SVG user agents are not required to allow text selection and clipboard operations.

SVGT does not support text on a path, 'tspan' and 'tref' elements. SVGT supports the 'rotate' attribute on the 'text' element, but it should be noted that this may cause a slow down of the user agent's rendering speed, and rotation may not be supported with system fonts.

SVGT enables a block of text to be rendered inside of a rectangle, while automatically wrapping the text into lines using the flowText element.

SVG Tiny shall support the following elements, with the listed restrictions, as specified in the SVG 1.2 Working Draft:

9. Painting: Filling, Stroking and Marker Symbols

SVGB and SVGT support filling and stroking 'path' elements and basic shapes with solid colors.

SVGB supports all features of opacity as defined in SVG 1.2 specification. SVGT supports fill-opacity and stroke-opacity properties only.

SVG Tiny supports the non-scaling stroke as defined in the SVG 1.2 specification.

SVGB supports stroking on text when using outline fonts, but SVGT does not.

10. Color

SVGT and SVGB support <color> in the CSS2-compatible specification for a color in the sRGB color space, and system colors. Additionally, SVGB and SVGT support 16 original color keywords from XHTML, and do not support X11 colors.

Specifying colors using an ICC profile is not supported in SVGT; and as with SVG 1.1, it is optional in SVGB.

11. Gradients and Patterns

SVGB supports solid colors, gradient paints, patterns, and custom paints.

SVG Tiny 1.2 includes support for a subset of the linearGradient and radialGradient elements. The exact subset of linearGradient and radialGradient supported in SVG Tiny 1.2 will be defined in a subsequent version of the SVG Tiny 1.2 specification.

12. Clipping, Masking and Compositing

SVGB supports clipping, masking and compositing. SVGB does not support additive clipping paths. Also, in SVGB, clipping paths are restricted to rectangles ('rect' elements or references to 'rect' elements through 'use').

13. Filter Effects

SVGB supports a subset of filter effects. SVGT does not support filter effects.

14. Interactivity

SVGB and SVGT support the SVG 1.1 events. SVGT only allows interactivity with declarative animation.

SVG Tiny 1.2 supports interactivity through the integration of XMLEvents, as described in : the SVG 1.2 specification

SVG Tiny 1.2 also supports the focusable property, as defined in : the SVG 1.2 specification

15. Linking

SVGB and SVGT support hyperlink activation from SVG content to other Web resources through the 'a' element.

SVGB supports hyperlink into particular views of SVG content. SVGT does not support this feature.

16. Scripting

SVG Tiny 1.2 supports scripting.

If SVG is split into two branches (application/image), scripting support will only be part of the SVGT1.2-Application profile.

SVGB allows optional support of scripting, and includes all of the language features from SVG 1.1 to support scripting.

17. Animation

Both SVGB and SVGT support the full set of SVG 1.1's declarative animation features:

The language features to support animation through scripting and DOM are available in SVGB. SVGT only supports declarative animation.

SVGB and SVGT allow implicit targeting of parent elements, and targeting elements using the 'xlink:href' attribute.

SVGB and SVGT support linear, spline, paced and discrete animations.

Note: The snapShotTime attribute will be part of the next SVG1.2 full spec. The SVG Tiny spec will in future versions just point to the SVG Full spec for snapShotTime. Until the next SVG1.2 draft is published this section will however remain in the SVG Tiny draft to allow for public feedback.

snapShotTime=<time>

Indicates a moment in time which is most relevant for a still-image of the animated svg content. This time can be used as a hint to the Dynamic Svg Viewer if it needs to render a still-image of the animated SVG. SnapShotTime is an animation-related attribute that only applies to Dynamic Svg Viewers. Static Svg Viewers should ignore this attribute. This attribute will most typically be used when rendering a still-image that serves as a preview of the document. This attribute only applies to the outermost (root) svg element. Animatable: no

18. Fonts

SVGB and SVGT support a subset of SVG fonts where only the 'd' attribute on the 'glyph' and 'missing-glyph' elements is available. Arbitrary SVG within a 'glyph' is not supported.

As with Full SVG 1.1, SVGB supports downloadable fonts using WebFonts facility defined in the "Cascading Style Sheets (CSS) level 2" specification. In SVGT, an SVG font can be only embedded within the same document that uses the font.

19. Metadata

Both SVGB and SVGT support embedded metadata, as well as elements and attributes from foreign namespaces included within the SVG content.

20. Extensibility

The SVG renderer is not expected to be able to render content in foreign namespaces, but the foreignObject element allows a subtree in a foreign namespace to be assigned a width and height and passed off to another renderer.


Author List

The authors of this specification are the participants of the W3C SVG Working Group.

Acknowledgments

The SVG Working Group would like to acknowledge the great many people outside of the SVG Working Group who help with the process of developing the SVG 1.1 and Mobile SVG specification. These people are too numerous to list individually. They include but are not limited to the early implementers of the SVG 1.0 and 1.1 languages and Mobile SVG profiles (including viewers, authoring tools, and server-side transcoders), developers of SVG content, people who have contributed on the www-svg@w3.org and svg-developers@yahoogroups.com email lists, other Working Groups at the W3C, and the W3C team. Mobile SVG is truly a cooperative effort between the SVG Working Group, the rest of the W3C, and the public and benefits greatly from the pioneering work of early implementers and content developers, feedback from the public, and help from the W3C team.


References

[CSS Mobile Profile]
CSS Mobile Profile 1.0 , Ted Wugofski, Doug Dominiak, Peter Stark, editors, W3C, 24 October 2001 (W3C Candidate Recommendation) Available at http://www.w3.org/TR/css-mobile.
[MOBILE SVG Requirements]
SVG Mobile Requirements , Rick Graham, Tolga K. Capin, editors, W3C, 3 August 2001 (Working Draft). Available at http://www.w3.org/TR/SVGMobileReqs.
[RFC2119]
RFC 2119: Key words for use in RFCs to Indicate Requirement Levels Internet Engineering Task Force, 1997. Available at http://www.ietf.org/rfc/rfc2119.txt.
[SRGB]
Multimedia systems and equipment - Colour measurement and management - Part 2-1: Colour management - Default RGB colour space - sRGB , IEC. Available at http://www.iec.ch/nr1899.htm.
[SVG 1.0]
Scalable Vector Graphics (SVG) 1.0 Specification , Jon Ferraiolo, editor, W3C, 4 September 2001 (Recommendation). Available at http://www.w3.org/TR/SVG/.
[SVG 1.1/2.0 Requirements]
SVG 1.1/2.0 Requirements , Dean Jackson, editor, W3C, 3 August 2001. Available at http://www.w3.org/TR/SVG2Reqs/.
[SVG 1.1]
Scalable Vector Graphics (SVG) Version 1.1 Specification , Dean Jackson, editor, W3C, 15 February 2002. Available at http://www.w3.org/TR/SVG11/.

Appendix A. UDOM

The current UDOM proposal presented here is not the final solution for an SVG Tiny API. The WG is still discussing this and other proposals and has not reached consensus. The WG has an interest in presenting this proposal to the public and is hoping to get feedback on UDOM from everyone interested in an API for SVG Tiny.

This section concists of four parts:

Introduction

This section proposes a lightweight API for accessing SVG Tiny Content from code. The proposed API is called UDOM for Micro Document Object Model. This API has multiple features:

Features Support Summary

Feature
Support Options
Document Access
Yes
Tree Navigation (i.e., accessing individual nodes)
Limited to nodes with IDs
Element creation
Yes, but restricted to specific element types
Text Node creation
No (but see Element Creation. <text> elements can be created)
Element addition
Yes, but restricted to specific element types
Element removal
Yes, but restricted to specific element types
Attribute access (read)
Yes, string based and typed
Attribute modification (write)
Yes, string based and typed
Event dispatching
No
Event Creation
No
Event listener registration and removal
Yes
Animation
Yes, allows begin and end on 'indefinite' conditions.

Feature Details

Note: Although the examples in this section are all in java, the UDOM proposal requires no specific language.

Document Access

All proposals assume that a Document object is present and is the root for accessing other features. The way the Document object becomes available depends on the usage context. For example, for code bound to an SVG document through a <handler> element, the Document would be passed to the corresponding XMLEventHandler implementation's init method.

Example:
<svg xmlns:ev="http://www.w3.org/2001/xml-events">

<rect id="myRect" x="10" y="20" width="200" height="300" fill="red"/>

<ev:listener ev:event="click" ev:observer="myRect"
           ev:handler="#myClickHandler" />

<!-- handler would be a new SVG element -->
<handler id="myClickHandler"
     type="application/java"
     xml:base="http://fooCompany.com/myJar.jar"
     xlink:href="#com.fooCompany.MyXMLEventHandler"/>
  <param name="offset" value="10" />
</svg>
with MyXMLEventHandler being:
package com.fooCompany;

import tbd.XMLEventHandler;
import tbd.udom.Document;
import tbd.udom.Element;
import tbd.udom.events.Event;

public class MyXMLEventHandler implements XMLEventHandler {
   Document document;

   public void init(Document doc, Element handlerElement) {
        document = doc;
        // ...
   }

   public void handleEvent(Event event) {
        RectElement myRect = 
              (RectElement)document.getElementById("myRect");
        float width = myRect.getWidth();
        myRect.setWidth(width + 10);
   }
}
In the remainder of this document, the variable 'document' is assumed to be an instance of the Document interface.

Tree Navigation

Tree navigation is the ability to access individual SVG Elements in a document tree.
UDOM gives access to individual elements by identifier. It also allows some navigation of the document tree thanks to the Node's interface. From a Node, it is possible to access its parent Node and to the owner Document node:
Element myRect = document.getElementById("myRect");
Node myRectParent = myRect.getParentNode();
Document doc = myRect.getOwnerDocument();
UDOM also gives access to the Document's root element:
Element svgRoot = document.getDocumentElement();

Element Creation

UDOM allows the creation of new Elements:
Element myRect = document.createElementNS(svgNS, "rect");
Note that there is no support for creating Text nodes. This is done implicitly by setting the content on an SVG <text> element:
TextElement myText 
   = (TextElement)document.createElementNS(svgNS, "text");
myText.setData("Hello UDOM");
The type of elements which can be created through the createElementNS method is restricted to:
  1. The SVG namespace.
  2. The following elements: <rect>, <circle>, <ellipse>, <line>, <polyline>, <polygon>, <path>, <text>, <image> <anchor> and <use>

Element Addition

Node Addition is the ability to add new elements to a document tree.

UDOM allows addition and insertion and insertion of a Node:
// Create a new <rect> element
RectElement myRect 
    = (RectElement)document.createElementNS(svgNS, "rect");

// Set the various <rect> properties before appending
...

// Add element to the root of the document
Element svgRoot = document.getDocumentElement();
svgRoot.appendChild(myRect);

// Create a new <ellipse> element
EllipseElement myEllipse
    = (EllipseElement)document.createElementNS(svgNS, "ellipse");

// Set the various <ellipse> properties before insertion
...

// Insert the ellipse before the rectangle
svgRoot.insertBefore(myEllipse, myRect);
The types of nodes which can be inserted into the Document is limited to the same list specified in the Element Creation section.

Element Removal

Node removal is the ability to remove an element from a document tree.

UDOM allows the removal of Nodes:
Element myRect = ...; // See Element creation
Element myGroup = document.getElementById("myGroup");
myGroup.appendChild(myRect);
....
myGroup.removeChild(myRect);
However, the API limits the removal of nodes to nodes which were added to the document tree by a prior call to insertBefore or appendChild.

Attribute Access

Attribute access is the ability to read node properties.

Generic Access

Generic access is provided through the Element interface (a DOM subset):
Element myRect = document.getElementById("myRect");
String myRectWidth = myRect.getAttributeNS(svgNS, "width");

Typed access

UDOM offers a typed access to various element types and it is possible to access typed node specific properties.
RectElement myRect  = (RectElement)document.getElementById("myRect");
float myRectWidth = myRect.getWidth();
Notes:
  1. A possible option is to provide typed access to attributes (as with the SVG DOM) but not generic string based access.
  2. A possible alternative to specialized and typed method is to offer generic and typed method, such as getFloatAttributeNS(namespace, attributeName) / setFloatAttributeNS(namespace, attributeName, value).
  3. Specialized and typed method (such as setX() on RectElement) modify the attribute's base value, not the attribute's presentation value. This means, among other things, that animations take precedence over script modifications.

Attribute Modification

Attribute modification is the ability to modify element properties.

Generic String Access

Attributes are modified through the Element interface (a DOM subset):
Element myRect = document.getElementById("myRect");
myRect.setAttributeNS(svgNS, "width", "450");

Specialized Access

UDOM offers typed modification of the properties through specialized node types.
RectElement myRect = (RectElement)document.getElementById("myRect");
myRect.setWidth(450f);
 
Important Note:

The UDOM proposal contains the SVGT Specific Interfaces which defines all the svg specific functionality. Key interfaces are: SVGElement for all the common attributes (such as the conditional attributes) GraphicsProperties which has all the painting properties (such as fill or stroke), TextProperties which implements the text and font properties (such as font-size or text-anchor) and the TransformableElement interface for elements which can be transformed.

Event Listener Registration and Removal

Event Listener Registration and Removal is the ability to add and remove new event listeners from a Document.
UDOM allows adding and removing EventListeners:
class MyEventListener implements EventListener {
    public void handleEvent(Event evt) {
        // Do whatever is needed here
    }
}
...
EventListener l = new MyEventListener();
Element myRect = document.getElementById("myRect");

// Listen to click events during the capture phase
myRect.addEventListener("click", l, true);

// Listen to mouseover events, during the buble phase
myRect.addEventListener("mouseover", l, false);
....

// Remove the click listener
myRect.removeEventListener("click", l, true);
Refer to the DOM Events Level 2 specification or the XML Events specification introduction for an explanation of the SVG event flow and the meaning of event targets, event current target, bubble and capture.

Animation

UDOM allows code to start or end animation elements.
AnimationElement animateColor 
    = (AnimationElement) document.getElementById("myAnimation");

animateColor.beginElement();

API Definitions

The following API's are available in the UDOM:

Generic Document Interfaces
Node
Document
Element
DOMException

Event Interfaces
Event
EventListener
EventTarget

SVGT Specific Interfaces
SVGDocument
SVGElement
TextProperties
GraphicsProperties
StructureElement
TransformableElement
SVGSVGElement
AnchorElement
AnimationElement
EllipseElement
LineElement
RectElement
PathElement
GroupElement
ImageElement
UseElement
TextElement
SVGLocatable

DataTypes
SVGRect
SVGMatrix
SVGColor

Interface Node

The Node interface is the interface for all XML tree model content. This interface is a subset of the Node interface defined in the DOM Core Level 2 specification.


IDL Definition
interface Node { 
    const unsigned short DOCUMENT_NODE = 0
    const unsigned short ELEMENT_NODE = 1;

  Node appendChild ( in Node newChild ) 
        raises( DOMException);
  unsigned short getNodeType();
  Document getOwnerDocument();
  Node getParentNode();
  Node insertBefore ( in Node newChild, in Node refChild ) 
        raises( DOMException);
  Node removeChild ( in Node oldChild ) 
        raises( DOMException);
};

Defined constants
DOCUMENT_NODE The node is a Document
ELEMENT_NODE The node is an Element
Methods
appendChild
Adds newChild to the end of the children list for this node.
Parameters
in Node newChild The new Node to add.
Return Value
Node the newly added node
Exceptions
DOMException If the operation is not allowed (e.g., if the newChild node type is incompatible with this node) or if addition of the given Node type is not supported by the implementation.
insertBefore
Inserts newChild before refChild.
Parameters
in Node newChild The Node to insert.
in Node refChild The Node before which newChild is inserted
Return Value
Node the newly inserted node
Exceptions
DOMException If the operation is not allowed or not supported.
removeChild
Removes a child node.
Parameters
in Node oldChild The Node to remove.
Return Value
Node the removed node
Exceptions
DOMException See the DOM Level 2 specification.
getOwnerDocument
Get the document associated with this node.
No Parameters
Return Value
Document the Document associated with this node.
No Exceptions
getParentNode
Get the parent of this node.
No Parameters
Return Value
Node the parent node
No Exceptions
getNodeType
Get the type of this node.
No Parameters
Return Value
unsigned short the Node's type, one of the XXX_NODE constants.
No Exceptions

Interface Document

The Document interface is the interface for an XML Document model. This interface is a subset of the Document interface defined in the DOM Core Level 2 specification. Note that the getFirstChild method returns the root of the document.


IDL Definition
interface Document : Node { 
  Element createElementNS ( in DOMString namespaceURI, in DOMString qName ) 
        raises( DOMException);
  Element getDocumentElement();
  Element getElementById(in DOMString elementId);
};

No Defined constants
Methods
createElementNS
Create a new element.
Parameters
in DOMString namespaceURI The namespace uri for the newly created element.
in DOMString qName The qualified name for the newly created element.
Return Value
Element The newly created element
Exceptions
DOMException See DOM Level 2 specification. In addition, a DOMException (NOT_SUPPORTED_ERR) is thrown if the type of element is not supported by the implementation.
getDocumentElement
Get this document's root element.
No Parameters
Return Value
Element This Document's root element.
No Exceptions
getElementById
Get an element with a given id.
Parameters
in DOMString elementId The unique id of the retrieved element.
Return Value
Element The matching element or null if none.
No Exceptions

Interface Element

The Element interface represents an XML element in a Document. This interface is a subset of the Element interface defined in the DOM Core Level 2 specification. Note that in UDOM implementations which support events, Element implementations also implement the EventTarget interface. Refer to the DOM Level 2 Events for details.


IDL Definition
interface Element : Node { 
  DOMString getAttribute ( in DOMString name ); 
  DOMString getAttributeNS ( in DOMString namespaceURI, in DOMString qName );
  void removeAttribute ( in DOMString name );
  void removeAttributeNS ( in DOMString namespaceURI, in DOMString qName );
  void setAttribute ( in DOMString name, in DOMString value ) 
        raises( DOMException);
  void setAttributeNS ( in DOMString namespaceURI, 
                        in DOMString qName, in DOMString value ) 
        raises( DOMException);
};

No Defined constants
Methods
getAttribute
Convenience method for getAttributeNS(null, name).
Parameters
in DOMString name The name of the attribute to retrieve.
Return Value
DOMString The attribute value.
No Exceptions
getAttributeNS
Get the value of an attribute.
Parameters
in DOMString namespaceURI The namespace URI of the retrieved attribute.
in DOMString qName The qualified name of the attribute to set on the element.
Return Value
DOMString The attribute value.
No Exceptions
removeAttribute
Convenience method for removeAttributeNS(null, name).
Parameters
in DOMString name The name of the attribute to remove.
No Return Value
No Exceptions
removeAttributeNS
Removes an attribute.
Parameters
in DOMString namespaceURI The namespace URI of the attribute to remove.
in DOMString qName The qualified name of the attribute to remove.
No Return Value
No Exceptions
setAttribute
Convenience method for setAttributeNS(null, name, value).
Parameters
in DOMString name The name of the attribute to set on the element.
in DOMString value The new attribute value.
No Return Value
Exceptions
DOMException If the attribute value cannot be set.

setAttributeNS
Set an attribute with a given value.
Parameters
in DOMString namespaceURI The namespace URI of the retrieved attribute.
in DOMString qName The qualified name of the attribute to set on the element.
in DOMString value The new attribute value.
No Return Value
Exceptions
DOMException If the attribute value cannot be set.

Interface DOMException

The DOMException class defines a subset of the error codes defined in the DOM Core Level 2 specification.


IDL Definition
exception SVGException { 
    unsigned short code;
};
// SVGExceptionCode 
const unsigned short INVALID_ACCESS_ERR = 0; 
const unsigned short INVALID_MODIFICATION_ERR = 1; 
const unsigned short NOT_SUPPORTED_ERR = 2;
const unsigned short WRONG_DOCUMENT_ERR = 3;

Defined constants
INVALID_ACCESS_ERR If a parameter or an operation is not supported by the underlying object.
INVALID_MODIFICATION_ERR If an attempt is made to modify the type of the underlying object.
NOT_SUPPORTED_ERR If the implementation does not support the requested type of object or operation.
WRONG_DOCUMENT_ERR If a node is used in a different document than the one that created it (that doesn't support it)

Interface Event

Provides information about an event and its propagation. The interface allows listeners to stop the propagation. This interface is a subset of the Event interface defined in the DOM Level 2 Events specification. Please refer to that specification for details on what the different methods and members mean.


IDL Definition
interface Event { 
    const unsigned short AT_TARGET = 0
    const unsigned short BUBBLING_PHASE = 1;
    const unsigned short CAPTURING_PHASE = 2;

  EventTarget getCurrentTarget ( );
  unsigned short getEventPhase ( );
  EventTarget getTarget ( );
  DOMString getType ( );
  void stopPropagation ( );
};

Defined constants
AT_TARGET The event is currently being evaluated at the target EventTarget.
BUBBLING_PHASE The current event phase is the bubbling phase.
CAPTURING_PHASE The current event phase is the capturing phase.
Methods
getCurrentTarget
Gets the current EventTarget, i.e. the node on which listeners are currently being invoked.
No Parameters
Return Value
EventTarget The current EventTarget.
No Exceptions
getEventPhase
Get the event propagation phase, one of BUBBLING_PHASE, CAPTURING_PHASE or AT_TARGET.
No Parameters
Return Value
unsigned short The event propagation phase
No Exceptions
getTarget
Get the EventTarget which generated the event.
No Parameters
Return Value
EventTarget The EventTarget which generated the event.
No Exceptions
getType
Get the Event's type, e.g., 'click'.
No Parameters
Return Value
DOMString The Event's type.
No Exceptions
stopPropagation
Prevents further propagation of the event. The event will still be dispatched to all listeners on the current target before the event flow stops.
No Parameters
No Return Value
No Exceptions

Interface EventListener

Interface used to receive Events from an EventTarget This interface is a subset of the EventListener interface defined in the DOM Level 2 Events specification. Please refer to that specification for details on what the different methods and members mean.


IDL Definition
interface EventListener { 
  void handleEvent ( in Event evt);
};

No Defined constants
Methods
handleEvent
Handle event.
Parameters
in Event evt Contains contextual information about the event.
No Return Value
No Exceptions

Interface EventTarget

The interface for DOM nodes which can receive and dispatch Events to EventListeners. This interface is a subset of the EventTarget interface defined in the DOM Level 2 Events specification. Please refer to that specification for details on what the different methods and members mean.


IDL Definition
interface EventTarget { 
  void addEventListener ( in DOMString type, in EventListener listener, 
                          in boolean useCapture );
  void removeEventListener ( in DOMString type, in EventListener listener,
                             in boolean useCapture );
};

No Defined constants
Methods
addEventListener
Adds a new listener to this target, for the specified event type, during the desired phase.
Parameters
in DOMString type The type of event to listen to.
in EventListener listener Will be notified when an event of the desired type happens on this target or one of its descendant.
in boolean useCapture If true, the listener will be called during the event flow capture phase. Otherwise, the listener will be called during the bubble phase. If the event's target is this target, then the listener will be called during the 'at target' phase of event flow.
No Return Value
No Exceptions
removeEventListener
Removes a listener previously added with an addEventListener call.
Parameters
in DOMString type The type of event that was listened to.
in EventListener listener The listener that was previously registered.
in boolean useCapture If true, the listener was listening to events in the capture phase of event flow.
No Return Value
No Exceptions

Interface SVGDocument

SVGDocument provides an API to access SVG specific features, such as setting the viewport size


IDL Definition
interface SVGDocument : Document, Node { 
  boolean animationsPaused (  );
  float getPanX (  );
  float getPanY (  );
  float getViewportHeight (  );
  float getViewportWidth (  );
  float getZoom (  );
  void pauseAnimations ( );
  void setCurrentTime ( in float seconds);
  float getCurrentTime ( );
  float setPanX ( in float newPanX );
  float setPanY ( in float newPanY );
  void setViewportHeight ( in float newViewportHeight );
  void setViewportWidth ( in float newViewportWidth );
  void setZoom ( in float newZoom);
  boolean checkIntersection ( in SVGElement element, in SVGRect rect );
  void unpauseAnimations ( );
  unsigned long suspendRedraw ( in unsigned long max_wait_milliseconds ); 
  void unsuspendRedraw ( in unsigned long suspend_handle_id ) 
        raises( DOMException );
};

No Defined constants
Methods
animationsPaused
Check if animations are paused.
No Parameters
Return Value
boolean True if animations are paused.
No Exceptions
getPanX
Get the x-axis pan translation.
No Parameters
Return Value
float The x-axis pan translation.
No Exceptions
getPanY
Get the y-axis pan translation.
No Parameters
Return Value
float The y-axis pan translation.
No Exceptions
getViewportHeight
Get the viewport height.
No Parameters
Return Value
float The viewport height.
No Exceptions
getViewportWidth
Get the viewport width.
No Parameters
Return Value
float The viewport height.
No Exceptions
getZoom
Get the current scale in the zoom and pan transform.
No Parameters
Return Value
float The current scale in the zoom and pan transform.
No Exceptions
pauseAnimations
Pause all animations.
No Parameters
No Return Value
No Exceptions
setCurrentTime
Set a new document time.
Parameters
in float seconds The new document time.
No Return Value
No Exceptions
getCurrentTime
Get the current time in seconds relative to the start time for the current SVG document.
No Parameters
Return Value
float The current document time.
No Exceptions
setPanX
Set the new translation along the x-axis in the zoom and pan transform.
Parameters
in float newPanX The new translation along the x-axis in the zoom and pan transform.
No Return Value
No Exceptions
setPanY
Set the new translation along the y-axis in the zoom and pan transform.
Parameters
in float newPanY The new translation along the y-axis in the zoom and pan transform.
No Return Value
No Exceptions
setViewportHeight
Set the new viewport height.
Parameters
in float newViewportHeight The vieport height. Should be strictly positive.
No Return Value
No Exceptions
setViewportWidth
Set the new viewport width.
Parameters
in float newViewportWidth The vieport width. Should be strictly positive.
No Return Value
No Exceptions
setZoom
Set the new zoom scale factor.
Parameters
in float newZoom The new zoom scale factor.
No Return Value
No Exceptions
checkIntersection
Returns true if the rendered content of the given element intersects the supplied rectangle, honoring the 'pointer-events' property value on each candidate graphics element.
Parameters
in SVGElement element The element on which to perform the given test.
in SVGRect rect The test rectangle. The values are in the initial coordinate system for the current 'svg' element.
Return Value
boolean True or false, depending on whether the given element intersects the supplied rectangle.
No Exceptions
unpauseAnimations
Resumes animations.
No Parameters
No Return Value
No Exceptions
suspendRedraw
Takes a time-out value which indicates that redraw shall not occur until: the corresponding unsuspendRedraw(suspend_handle_id) call has been made or its timer has timed out. In environments that do not support interactivity (e.g., print media), then redraw shall not be suspended. suspend_handle_id = suspendRedraw(max_wait_milliseconds) and unsuspendRedraw(suspend_handle_id) must be packaged as balanced pairs. When you want to suspend redraw actions as a collection of SVG DOM changes occur, then precede the changes to the SVG DOM with a method call similar to suspend_handle_id = suspendRedraw(max_wait_milliseconds) and follow the changes with a method call similar to unsuspendRedraw(suspend_handle_id). Note that multiple suspendRedraw calls can be used at once and that each such method call is treated independently of the other suspendRedraw method calls.
Parameters
in unsigned long max_wait_milliseconds The amount of time in milliseconds to hold off before redrawing the device. Values greater than 60 seconds will be truncated down to 60 seconds.
Return Value
unsigned long A number which acts as a unique identifier for the given suspendRedraw() call. This value must be passed as the parameter to the corresponding unsuspendRedraw() method call.
No Exceptions
unsuspendRedraw
Cancels a specified suspendRedraw() by providing a unique suspend_handle_id.
Parameters
in unsigned long suspend_hande_id A number which acts as a unique identifier for the desired suspendRedraw() call. The number supplied must be a value returned from a previous call to suspendRedraw().
No Return Value
Exceptions
DOMException This method will raise a DOMException with value INVALID_ACCESS_ERR if an invalid value (i.e., no such suspend_handle_id is active) for suspend_handle_id is provided.

Interface SVGElement

SVGElement is the interface that all SVG elements should implement.


IDL Definition
interface SVGElement : Element, EventTarget { 
    const unsigned short SVG_A = 0
    const unsigned short SVG_CIRCLE = 1;
    const unsigned short SVG_ELLIPSE = 2;
    const unsigned short SVG_GROUP = 3;
    const unsigned short SVG_IMAGE = 4;
    const unsigned short SVG_LINE = 5;
    const unsigned short SVG_PATH = 6;
    const unsigned short SVG_POLYGON = 7;
    const unsigned short SVG_POLYLINE = 8;
    const unsigned short SVG_RECT = 9;
    const unsigned short SVG_SVG = 10;
    const unsigned short SVG_TEXT = 11;
    const unsigned short SVG_USE = 12;
    const unsigned short UNIT_CM = 13;
    const unsigned short UNIT_EMS = 14;
    const unsigned short UNIT_EXS = 15;
    const unsigned short UNIT_IN = 16;
    const unsigned short UNIT_MM = 17;
    const unsigned short UNIT_NUMBER = 18;
    const unsigned short UNIT_PC = 19;
    const unsigned short UNIT_PERCENTAGE = 20;
    const unsigned short UNIT_PT = 21;
    const unsigned short UNIT_PX = 22;

  DOMString getId ( );
  unsigned short getSVGType ( );
};

Defined constants
SVG_XXX Defines the different types of svg elements.
UNIT_XXX Defines the different types of units.
Methods
getId
Get the node's identifier.
No Parameters
Return Value
DOMString The node's id.
No Exceptions
getSVGType
Get the type of SVG element this is. One of the SVG_XXX constants.
No Parameters
Return Value
unsigned short The element type.
No Exceptions

Interface TextProperties

TextProperties is the interface that all elements which have text properties implement.

The text properties are: font-family, font-size, font-style, font-weight and text-anchor.

Setting a property means that the node has a specified value for the corresponding attribute. In order to clear an attribute, use the Element's removeAttribute[NS] method.

The initial values for the different properties are specified in the SVG 1.2 specification:

Property Initial Value
font-family User Agent Specific
font-size User Agent Specific
font-style normal
font-weight normal
text-anchor start

See Also:
SVG Text

.


IDL Definition
interface TextProperties : SVGElement { 
    const unsigned short FONT_STRETCH_CONDENSED = 0
    const unsigned short FONT_STRETCH_EXPANDED = 1;
    const unsigned short FONT_STRETCH_EXTRA_CONDENSED = 2;
    const unsigned short FONT_STRETCH_EXTRA_EXPANDED = 3;
    const unsigned short FONT_STRETCH_NORMAL = 4;
    const unsigned short FONT_STRETCH_SEMI_CONDENSED = 5;
    const unsigned short FONT_STRETCH_SEMI_EXPANDED = 6;
    const unsigned short FONT_STRETCH_ULTRA_CONDENSED = 7;
    const unsigned short FONT_STRETCH_ULTRA_EXPANDED = 8;
    const unsigned short FONT_STYLE_ITALIC = 9;
    const unsigned short FONT_STYLE_NORMAL = 10;
    const unsigned short FONT_STYLE_OBLIQUE = 11;
    const unsigned short FONT_WEIGHT_100 = 12;
    const unsigned short FONT_WEIGHT_200 = 13;
    const unsigned short FONT_WEIGHT_300 = 14;
    const unsigned short FONT_WEIGHT_400 = 15;
    const unsigned short FONT_WEIGHT_500 = 16;
    const unsigned short FONT_WEIGHT_600 = 17;
    const unsigned short FONT_WEIGHT_700 = 18;
    const unsigned short FONT_WEIGHT_800 = 19;
    const unsigned short FONT_WEIGHT_900 = 20;
    const unsigned short FONT_WEIGHT_BOLD = 21;
    const unsigned short FONT_WEIGHT_NORMAL = 22;
    const unsigned short TEXT_ANCHOR_END = 23;
    const unsigned short TEXT_ANCHOR_MIDDLE = 24;
    const unsigned short TEXT_ANCHOR_START = 25;

  DOMString[] getFontFamily ( );
  float getFontSize ( );
  unsigned short getFontStyle ( );
  unsigned short getFontWeight ( );
  unsigned short getTextAnchor ( );
  unsigned short getAnimatedTextAnchor ( );
  void setFontFamily ( in DOMString[] fontFamily);
  void setFontSize ( in float fontSize );
  void setFontStyle ( in unsigned short fontStyle);
  void setFontWeight ( in unsigned short fontWeight );
  void setTextAnchor ( in unsigned short textAnchor );  
};

Defined constants
FONT_STRETCH_XXX Refer to the CSS 2 specification for a definition of the font-stretch values.
FONT_STYLE_XXX Refer to the CSS 2 specification for a definition of the various font-styles.
FONT_WEIGHT_XXX Refer to the CSS 2 specification for a definition of the font-weights.
TEXT_ANCHOR_START Text is anchored about its starting point.
TEXT_ANCHOR_MIDDLE Text is anchored about its mid point.
TEXT_ANCHOR_END Text is anchored about its end point.
Methods
getFontFamily
Get the font family property.
No Parameters
Return Value
DOMString[] The font family property.
No Exceptions
getFontSize
Get the font size property, a positive number.
No Parameters
Return Value
float The font size.
No Exceptions
getFontStyle
Get the font style property value. Is one of FONT_STYLE_NORMAL, FONT_STYLE_ITALIC, FONT_STYLE_OBLIQUE.
No Parameters
Return Value
unsigned short The font style property.
No Exceptions
getFontWeight
Get the font weight property value. Is one of the FONT_WEIGHT_XXX values.
No Parameters
Return Value
unsigned short The font weight property.
No Exceptions
getTextAnchor
Get the text anchor property value. Is one of TEXT_ANCHOR_START, TEXT_ANCHOR_MIDDLE or TEXT_ANCHOR_END.
No Parameters
Return Value
unsigned short The text anchor property.
No Exceptions
getAnimatedTextAnchor
Get the animated text anchor property value (the value after all animations at the current document time has been applied to the attribute). Is one of TEXT_ANCHOR_START, TEXT_ANCHOR_MIDDLE or TEXT_ANCHOR_END.
No Parameters
Return Value
unsigned short The animated text anchor property.
No Exceptions
setFontFamily
Set the new font family property value. The fontFamily describes the list of names to use during font matching.
Parameters
in DOMString[] fontFamily The new font family property.
No Return Value
No Exceptions
setFontSize
Set the font size property, should be a positive number.
Parameters
in float fontSize The font size.
No Return Value
No Exceptions
setFontStyle
Get the font style property value. Should be one of FONT_STYLE_NORMAL, FONT_STYLE_ITALIC, FONT_STYLE_OBLIQUE.
Parameters
in unsigned short fontStyle The font style property.
No Return Value
No Exceptions
setFontWeight
Get the font weight property value. Should be one of the FONT_WEIGHT_XXX values.
Parameters
in unsigned short fontWeight The font weight property.
No Return Value
No Exceptions
setTextAnchor
Get the new text anchor property value. Should be one of TEXT_ANCHOR_START, TEXT_ANCHOR_MIDDLE or TEXT_ANCHOR_END.
Parameters
in unsigned short textAnchor The text anchor property.
No Return Value
No Exceptions

Interface GraphicsProperties

GraphicsProperties in the interface that all elements which have graphics properties implement.

The graphics properties are: fill, stroke, color, fill-rule, stroke-width, stroke-line-join, stroke-line-cap, stroke-miter-limit, stroke-dash-array, stroke-dash-offset, display and visibility.

Setting a property means that the node has a specified value for the corresponding attribute. In order to clear an attribute, use the Element's removeAttribute[NS] method. To set the fill or color properties to 'currentColor', use the regular DOM method setAttribute or setAttributeNS.

The initial values for the different properties are specified in the SVG 1.2 specification:

Property Initial Value
display true
visibility true
color black
fill black
stroke none (null)
fill-rule non zero
stroke-width 1
stroke-line-join miter
stroke-line-cap butt
stroke-miter-limit 4
stroke-dash-array null
stroke-dash-offset 0

See Also:
Painting, Filling and Stroking

.


IDL Definition
interface GraphicsProperties : SVGElement { 
    const unsigned short CAP_BUTT = 0
    const unsigned short CAP_ROUND = 1;
    const unsigned short CAP_SQUARE = 2;
    const unsigned short JOIN_BEVEL = 3;
    const unsigned short JOIN_MITER = 4;
    const unsigned short JOIN_ROUND = 5;
    const unsigned short WIND_EVEN_ODD = 6;
    const unsigned short WIND_NON_ZERO = 7;

  SVGColor getColor ( );
  SVGColor getAnimatedColor ( );
  boolean getDisplay ( );
  boolean getAnimatedDisplay ( );
  SVGColor getFill ( );
  SVGColor  getAnimatedFill ( );
  SVGColor getStroke ( );
  SVGColor getAnimatedStroke ( );
  unsigned short getFillRule ( );
  unsigned short getAnimatedFillRule ( );
  float[] getStrokeDashArray ( );
  float[] getAnimatedStrokeDashArray ( );
  float getStrokeDashOffset ( );
  float getAnimatedStrokeDashOffset ( );
  unsigned short getStrokeLineCap ( );
  unsigned short getAnimatedStrokeLineCap ( );
  unsigned short getStrokeLineJoin ( );
  unsigned short getAnimatedStrokeLineJoin ( );
  float getStrokeMiterLimit ( );
  float getAnimatedStrokeMiterLimit ( );
  float getStrokeWidth ( );
  float getAnimatedStrokeWidth ( );
  boolean getVisibility ( );
  boolean getAnimatedVisibility ( );
  void setColor ( in SVGColor color );
  void setDisplay ( in boolean display );
  void setFill ( in SVGColor fill );
  void setStroke ( in SVGColor stroke );
  void short setFillRule ( in unsigned short fillRule );
  void  setStrokeDashArray ( in float[] strokeDashArray );
  void setStrokeDashOffset ( in float strokeDashOffset );
  void  setStrokeLineCap ( in unsigned short strokeLineCap);
  void  setStrokeLineJoin ( in unsigned short strokeLineJoin);
  void setStrokeMiterLimit ( in float strokeMiterLimit);
  void setStrokeWidth ( in float strokeWidth);
  void setVisibility ( in boolean visibility);  
};

Defined constants
CAP_BUTT Ends unclosed subpaths and dash segments with no added decoration.
CAP_ROUND Ends unclosed subpaths and dash segments with a round decoration that has a radius equal to half of the width of the pen.
CAP_SQUARE Ends unclosed subpaths and dash segments with a square projection that extends beyond the end of the segment to a distance equal to half of the line width.
JOIN_BEVEL Joins path segments by connecting the outer corners of their wide outlines with a straight segment.
JOIN_MITER Joins path segments by extending their outside edges until they meet.
JOIN_ROUND Joins path segments by rounding off the corner at a radius of half the line width.
WIND_EVEN_ODD The even-odd rule specifies that a point lies inside the path if a ray drawn in any direction from that point to infinity is crossed by path segments an odd number of times.
WIND_NON_ZERO The non-zero rule specifies that a point lies inside the path if a ray drawn in any direction from that point to infinity is crossed by path segments a different number of times in the counter-clockwise direction than the clockwise direction.
Methods
getColor
Get the current color property value.
No Parameters
Return Value
SVGColor The current color property value.
No Exceptions
getAnimatedColor
Get the current time's animated color property value (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
SVGColor The current animated color property value.
No Exceptions
setColor
Set a new color property value.
Parameters
in SVGColor color The new color property value.
No Return Value
No Exceptions
getFill
Get the color used for fill operations.
No Parameters
Return Value
SVGColor The fill property value.
No Exceptions
getAnimatedFill
Get the animated color value (the value after all animations in the current document time has been applied to the attribute) used for fill operations.
No Parameters
Return Value
SVGColor The animated fill property value.
No Exceptions
setFill
Set the new color to use for fill operations.
Parameters
in SVGColor fill The new fill property value.
No Return Value
No Exceptions
getStroke
Get the color used for stroke operations.
No Parameters
Return Value
SVGColor The stroke property value.
No Exceptions
getAnimatedStroke
Get the animated color value (the value after all animations in the current document time has been applied to the attribute) used for stroke operations.
No Parameters
Return Value
SVGColor The animated stroke property value.
No Exceptions
setStroke
Set the new color to use for stroke operations.
Parameters
in SVGColor stroke The new stroke property value.
No Return Value
No Exceptions
getFillRule
Get the current rule used to fill shapes. One of WIND_NON_ZERO or WIND_EVEN_ODD.
No Parameters
Return Value
unsigned short The current fill rule property value.
No Exceptions
getAnimatedFillRule
Get the current animated rule used to fill shapes. One of WIND_NON_ZERO or WIND_EVEN_ODD.
No Parameters
Return Value
unsigned short The current animated fill rule property value.
No Exceptions
setFillRule
Set the new rule used to fill shapes. One of WIND_NON_ZERO or WIND_EVEN_ODD.
Parameters
in unsigned short fillRule The new sfill rule property value.
No Return Value
No Exceptions
setStrokeDashArray
Set a the new set of dashes and gaps to use for stroking operations.
Parameters
in float[] strokeDashArray The new stroke dash array.
No Return Value
No Exceptions
getAnimatedStrokeDashArray
Get the animated array of float values (the values after all animations at the current document time has been applied to the attribute) describing alternance of solid and transparent sections on stroked paths, starting with dash, followed by a gap.
No Parameters
Return Value
float[] The current animated stroke dash array.
No Exceptions
getStrokeDashArray
Get the array of float values describing alternance of solid and transparent sections on stroked paths, starting with dash, followed by a gap.
No Parameters
Return Value
float[] The current stroke dash array.
No Exceptions
setStrokeLineCap
Set a new line cap decoration style.
Parameters
in unsigned short strokeLineCap The new stroke line cap value.
No Return Value
No Exceptions
getStrokeLineCap
Get the style used to decorate the ends of unclosed path segments. One of CAP_BUTT, CAP_ROUND or CAP_SQUARE.
No Parameters
Return Value
unsigned short The current stroke line cap value.
No Exceptions
getAnimatedStrokeLineCap
Get the animated style (the style value after all animations in the current document time has been applied to the attribute) used to decorate the ends of unclosed path segments. One of CAP_BUTT, CAP_ROUND or CAP_SQUARE.
No Parameters
Return Value
unsigned short The current animated stroke line cap value.
No Exceptions
setStrokeLineJoin
Set a new line join style.
Parameters
in unsigned short strokeLineJoin The new stroke line join value.
No Return Value
No Exceptions
getStrokeLineJoin
Get the the style used to decorate line segment intersections. Can be one of JOIN_BEVEL, JOIN_MITER, JOIN_ROUND.
No Parameters
Return Value
unsigned short The current stroke line join value.
No Exceptions
getAnimatedStrokeLineJoin
Get the the animated style (the style value after all animations in the current document time has been applied to the attribute) used to decorate line segment intersections. Can be one of JOIN_BEVEL, JOIN_MITER, JOIN_ROUND.
No Parameters
Return Value
unsigned short The current animated stroke line join value.
No Exceptions
setStrokeWidth
Set a new stroke width.
Parameters
in float strokeWidth The new stroke width.
No Return Value
No Exceptions
getStrokeWidth
Get the width to use for stroking. This is expressed in user space.
No Parameters
Return Value
float The current stroke width.
No Exceptions
getAnimatedStrokeWidth
Get the animated width (the value after all animations in the current document time has been applied to the attribute) to use for stroking. This is expressed in user space.
No Parameters
Return Value
float The current animated stroke width.
No Exceptions
setStrokeMiterLimit
Set a new value for the miter limit.
Parameters
in float strokeMiterLimit The new stroke miter limit.
No Return Value
No Exceptions
getStrokeMiterLimit
Get the limit of miter joins. Line joins which exceed this value are trimmed. The miter is expressed as the ratio of the miter length (i.e, the distance between the inner and the outer elbows) to the stroke width.
No Parameters
Return Value
float The current stroke miter limit.
No Exceptions
getAnimatedStrokeMiterLimit
Get the animated limit of miter joins. Line joins which exceed this value are trimmed. The miter is expressed as the ratio of the miter length (i.e, the distance between the inner and the outer elbows) to the stroke width.
No Parameters
Return Value
float The current animated stroke miter limit.
No Exceptions
setStrokeDashOffset
Set an offset, in user space, in the stroke's dash array. This is ignored if the dash array is null.
Parameters
in float strokeDashOffset The new offset.
No Return Value
No Exceptions
getStrokeDashOffset
Get the offset in the dash array.
No Parameters
Return Value
float The current offset.
No Exceptions
getAnimatedStrokeDashOffset
Get the animated offset in the dash array.
No Parameters
Return Value
float The current animated offset.
No Exceptions
setVisibility
Set a new visibility property value.
Parameters
in boolean visibility The new visibility property value.
No Return Value
No Exceptions
getVisibility
Get the visibility property value.
No Parameters
Return Value
boolean The current visibility property value. True if the visibility is on, false otherwise.
No Exceptions
getAnimatedVisibility
Get the animated visibility property value (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
boolean The current animated visibility property value. True if the visibility is on, false otherwise.
No Exceptions
setDisplay
Set a new display property value.
Parameters
in boolean display The new display property value.
No Return Value
No Exceptions
getDisplay
Get the display property value.
No Parameters
Return Value
boolean The current display property value. True if the display is on, false otherwise.
No Exceptions
getAnimatedDisplay
Get the animated display property value (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
boolean The current animated display property value. True if the display is on, false otherwise.
No Exceptions

Interface StructureElement

StructureElement is the base interface for all the elements in the SVG structure module.


IDL Definition
interface StructureElement : TextProperties, GraphicsProperties { 
    const unsigned short ALIGN_XMAXYMAX = 0
    const unsigned short ALIGN_XMAXYMID = 1;
    const unsigned short ALIGN_XMAXYMIN = 2;
    const unsigned short ALIGN_XMIDYMAX = 3;
    const unsigned short ALIGN_XMIDYMID = 4;
    const unsigned short ALIGN_XMIDYMIN = 5;
    const unsigned short ALIGN_XMINYMAX = 6;
    const unsigned short ALIGN_XMINYMID = 7;
    const unsigned short ALIGN_XMINYMIN = 8;
};

Defined constants
ALIGN_XXX As in the SVG 1.1 specification.

Interface TransformableElement

TransformableElement is the interface that all elements which have a transform attribute implement.


IDL Definition
interface TransformableElement : SVGElement { 
  SVGMatrix getTransform (  );
  SVGMatrix getAnimatedTransform (  );
  void setTransform ( in SVGMatrix transform );
};

No Defined constants
Methods
setTransform
Set the transform for this node.
Parameters
in SVGMatrix transform The new transform for this node.
No Return Value
No Exceptions
getTransform
Get the transform for this node.
No Parameters
Return Value
SVGMatrix The transform for this node or null if none. Where applicable this should return a reference to this node's transform..
No Exceptions
getAnimatedTransform
Get the animated transform value (the value after all animations in the current document time has been applied to the attribute) for this node.
No Parameters
Return Value
SVGMatrix The animated transform for this node or null if none. Where applicable this should return a reference to this node's transform..
No Exceptions

Interface SVGSVGElement

SVGSVGElement corresponds to the <svg> element.


IDL Definition
interface SVGSVGElement : StructureElement { 
    const unsigned short ZOOM_PAN_DISABLE = 0
    const unsigned short ZOOM_PAN_MAGNIFY = 1;
    const unsigned short ZOOM_PAN_UNKNOWN = 2;
    
  unsigned short getAlign ( );
  float getHeight ( );
  unsigned short getHeightUnits ( );
  SVGRect getViewbox ( );
  SVGRect getAnimatedViewbox ( );  
  float getWidth ( );
  unsigned short getWidthUnits ( );
  int getZoomPan ( );
  void setAlign ( in unsigned short newAlign );
  void setHeight ( in float height );
  void setHeightUnits ( in unsigned short heightUnits );
  void setViewbox ( in SVGRect newViewBox );
  void setWidth ( in float width );
  void setWidthUnits ( in unsigned short widthUnits );
};

Defined constants
ZOOM_PAN_DISABLE As in the SVG 1.1 specification.
ZOOM_PAN_MAGNIFY As in the SVG 1.1 specification.
ZOOM_PAN_UNKNOWN As in the SVG 1.1 specification.
Methods
getAlign
Get this node's align property.
No Parameters
Return Value
unsigned short The align property.
No Exceptions
getHeight
Get the height of the SVG element. Note: The returned value is the value of the height attribute specified on the SVG element, not the actual viewport height value which can be obtained on the SVGDocument.
No Parameters
Return Value
float The requested height for the svg element.
No Exceptions
getHeightUnits
Get the unit for the SVG height, one of the UNIT_XXX constants.
No Parameters
Return Value
unsigned short The height unit.
No Exceptions
getViewBox
Get the current viewBox for this SVG element.
No Parameters
Return Value
SVGRect The viewBox.
No Exceptions
getAnimatedViewBox
Get the current animated viewBox for this SVG element (the viewBox value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
SVGRect The animated viewBox.
No Exceptions
getWidth
Get the width of the SVG element. Note: The returned value is the value of the width attribute specified on the SVG element, not the actual viewport width value which can be obtained on the SVGDocument..
No Parameters
Return Value
float The requested width for the svg element.
No Exceptions
getWidthUnits
Get the unit for the SVG width, one of the UNIT_XXX constants.
No Parameters
Return Value
unsigned short The height unit.
No Exceptions
getZoomPan
Get the current zoomAndPan setting, one of the ZOOM_PAN_XXX constants. Note: There is no set method as this attribute is not animatable.
No Parameters
Return Value
unsigned short The current zoomAndPan setting.
No Exceptions
setAlign
Set this node's align property.
Parameters
in unsigned short newAlign The node's align property.
No Return Value
No Exceptions
setHeight
Set the new desired height for this SVG document.
Parameters
in float height The desired height.
No Return Value
No Exceptions
setHeightUnits
Set the unit for the SVG height, one of the UNIT_XXX constants.
Parameters
in unsigned short heightUnits The new unit.
No Return Value
No Exceptions
setViewBox
Set a new viewBox for this SVG element.
Parameters
in SVGRect newViewBox The new viewBox.
No Return Value
No Exceptions
setWidth
Set the new desired width for this SVG document.
Parameters
in float width The desired width.
No Return Value
No Exceptions
setWidthUnits
Set the unit for the SVG width, one of the UNIT_XXX constants.
Parameters
in unsigned short widthUnits The new unit.
No Return Value
No Exceptions

Interface AnchorElement

AnchorElement is the interface corresponding to the <a> element.


IDL Definition
interface AnchorElement : StructureElement, TransformableElement { 
  DOMString getHref (  );
  DOMString getAnimatedHref (  );
  void setHref ( in DOMString href);
  DOMString getTarget (  );
  DOMString getAnimatedTarget (  );
  void setTarget ( in DOMString target );
};

No Defined constants
Methods
setHref
Set the anchor's href.
Parameters
in DOMString href The new href.
No Return Value
No Exceptions
getHref
Get this anchor's href, as an absolute URL or null if the href was null or if the absolute URL could not be computed. Note: This returns the absolute URI, even though the href may have been a relative URI.
No Parameters
Return Value
DOMString The current href of the anchor.
No Exceptions
getAnimatedHref
Get this anchor's animated href value (the value after all animations at the current document time has been applied to the attribute), as an absolute URL or null if the href was null or if the absolute URL could not be computed. Note: This returns the absolute URI, even though the href may have been a relative URI.
No Parameters
Return Value
DOMString The current animated href of the anchor.
No Exceptions
setTarget
Set the anchor's target . Note that the target on the anchor element is the name that a browser might use to distinguish between multiple windows.
Parameters
in DOMString target The new target.
No Return Value
No Exceptions
getTarget
Get the anchor's target. Note that the target on the anchor element is the name that a browser might use to distinguish between multiple windows.
No Parameters
Return Value
DOMString The current target of the anchor.
No Exceptions
getAnimatedTarget
Get the anchor's animated target value (the value after all animations at the current document time has been applied to the attribute). Note that the target on the anchor element is the name that a browser might use to distinguish between multiple windows.
No Parameters
Return Value
DOMString The current animated target of the anchor.
No Exceptions

Interface AnimationElement

AnimationElement models any of the SVG animation elements: <animate> <set> <animateMotion> <animateColor> <animateTransform>.


IDL Definition
interface AnimationElement : SVGElement { 
  void beginElementAt ( in float offset )
        raises( DOMException);
  boolean endElementAt ( in float offset )
        raises( DOMException);
};

No Defined constants
Methods
beginElementAt
Begin the animation element.
Parameters
in float offset The offset from the current time.
No Return Value
Exceptions
DOMException SYNTAX_ERR: The element was not defined with the appropriate syntax to allow beginElement calls.
endElementAt
End the animation element.
Parameters
in float offset The offset from the current time.
Return Value
boolean True if the element was successfully stopped. False otherwise.
Exceptions
DOMException SYNTAX_ERR: The element was not defined with the appropriate syntax to allow endElement calls.

Interface EllipseElement

EllipseElement is used to represent both <ellipse> and <circle> nodes in the document.


IDL Definition
interface EllipseElement : GraphicsProperties, TransformableElement { 
  float getCx (  );
  float getAnimatedCx (  );
  void setCx ( in float cx );
  float getCy (  );
  float getAnimatedCy (  );
  void setCy ( in float cy );
  float getRx (  );
  float getAnimatedRx (  );
  void setRx ( in float rx );
  float getRy (  );
  float getAnimatedRy (  );
  void setRy ( in float ry );
};

No Defined constants
Methods
setCx
Set this ellipse's x-axis center.
Parameters
in float cx The x-axis center.
No Return Value
No Exceptions
getCx
Get this ellipse's x-axis center.
No Parameters
Return Value
float The x-axis center.
No Exceptions
getAnimatedCx
Get this ellipse's animated x-axis center value (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
float The animated x-axis center.
No Exceptions
setCy
Set this ellipse's y-axis center.
Parameters
in float cy The y-axis center.
No Return Value
No Exceptions
getCy
Get this ellipse's y-axis center.
No Parameters
Return Value
float The y-axis center.
No Exceptions
getAnimatedCy
Get this ellipse's animated y-axis center value (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
float The animated y-axis center.
No Exceptions
setRx
Set this ellipse's x-axis radius.
Parameters
in float rx The x-axis radius.
No Return Value
No Exceptions
getRx
Get this ellipse's x-axis radius.
No Parameters
Return Value
float The x-axis radius.
No Exceptions
getAnimatedRx
Get this ellipse's animated x-axis radius value (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
float The animated x-axis radius.
No Exceptions
setRy
Set this ellipse's y-axis radius.
Parameters
in float ry The y-axis radius.
No Return Value
No Exceptions
getRy
Get this ellipse's y-axis radius.
No Parameters
Return Value
float The y-axis radius.
No Exceptions
getAnimatedRy
Get this ellipse's animated y-axis radius (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
float The animated y-axis radius.
No Exception

Interface LineElement

LineElement represents <line> elements in the document.


IDL Definition
interface LineElement : GraphicsProperties, TransformableElement { 
  float getX1 (  );
  float getAnimatedX1 (  );
  void setX1 ( in float x1 );
  float getX2 (  );
  float getAnimatedX2 (  );
  void setX2 ( in float x2 );
  float getY1 (  );
  float getAnimatedY1 (  );
  void setY1 ( in float y1 );
  float getY2 (  );
  float getAnimatedY2 (  );
  void setY2 ( in float y2 );
};

No Defined constants
Methods
setX1
Set the x-axis coordinate of the starting point.
Parameters
in float x1 The x-axis coordinate of the starting point.
No Return Value
No Exceptions
getX1
Get the x-axis coordinate of the starting point.
No Parameters
Return Value
float The x-axis coordinate of the starting point.
No Exceptions
getAnimatedX1
Get the animated x-axis coordinate value (the value after all animations at the current document time has been applied to the attribute) of the starting point.
No Parameters
Return Value
float The animated x-axis coordinate of the starting point.
No Exceptions
setX2
Set the x-axis coordinate of the ending point.
Parameters
in float x2 The x-axis coordinate of the ending point.
No Return Value
No Exceptions
getX2
Get the x-axis coordinate of the ending point.
No Parameters
Return Value
float The x-axis coordinate of the ending point.
No Exceptions
getAnimatedX2
Get the animated x-axis coordinate value (the value after all animations at the current document time has been applied to the attribute) of the ending point.
No Parameters
Return Value
float The animated x-axis coordinate of the ending point.
No Exceptions
setY1
Set the y-axis coordinate of the starting point.
Parameters
in float y1 The y-axis coordinate of the starting point.
No Return Value
No Exceptions
getY1
Get the y-axis coordinate of the starting point.
No Parameters
Return Value
float The y-axis coordinate of the starting point.
No Exceptions
getAnimatedY1
Get the animated y-axis coordinate value (the value after all animations at the current document time has been applied to the attribute) of the starting point.
No Parameters
Return Value
float The animated y-axis coordinate of the starting point.
No Exceptions
setY2
Set the y-axis coordinate of the ending point.
Parameters
in float y2 The y-axis coordinate of the ending point.
No Return Value
No Exceptions
getY2
Get the y-axis coordinate of the ending point.
No Parameters
Return Value
float The y-axis coordinate of the ending point.
No Exceptions
getAnimatedY2
Get the animated y-axis coordinate value (the value after all animations at the current document time has been applied to the attribute) of the ending point.
No Parameters
Return Value
float The animated y-axis coordinate of the ending point.
No Exceptions

Interface RectElement

RectElement is used to represent <rect> nodes in the document.


IDL Definition
interface RectElement : GraphicsProperties, TransformableElement { 
  float getHeight (  );
  float getAnimatedHeight (  );
  void setHeight ( in float height );
  float getRx (  );
  float getAnimatedRx (  );
  void setRx ( in float rx );
  float getRy (  );
  float getAnimatedRy (  );
  void setRy ( in float ry );
  float getWidth (  );
  float getAnimatedWidth (  );
  void setWidth ( in float width );
  float getX (  );
  float getAnimatedX (  );
  void setX ( in float x );
  float getY (  );
  float getAnimatedY (  );
  void setY ( in float y );
};

No Defined constants
Methods
setHeight
Set the new rectangle height. Should be strictly positive.
Parameters
in float height The new rectangle height.
No Return Value
No Exceptions
getHeight
Get this rectangle's height.
No Parameters
Return Value
float The rectangle's height.
No Exceptions
getAnimatedHeight
Get this rectangle's animated height value (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
float The rectangle's animated height.
No Exceptions
setRx
Set the new x-axis corner radius. Should be strictly positive.
Parameters
in float rx The x-axis corner radius.
No Return Value
No Exceptions
getRx
Get the x-axis corner radius.
No Parameters
Return Value
float The x-axis corner radius.
No Exceptions
getAnimatedRx
Get the x-axis animated corner radius value (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
float The x-axis animated corner radius.
No Exceptions
setRy
Set the new y-axis corner radius. Should be strictly positive.
Parameters
in float ry The y-axis corner radius.
No Return Value
No Exceptions
getRy
Get the y-axis corner radius.
No Parameters
Return Value
float The y-axis corner radius.
No Exceptions
getAnimatedRy
Get the y-axis animated corner radius value (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
float The y-axis animated corner radius.
No Exceptions
setWidth
Set the new rectangle width. Should be strictly positive.
Parameters
in float width The new rectangle width.
No Return Value
No Exceptions
getWidth
Get this rectangle's width.
No Parameters
Return Value
float The new rectangle width
No Exceptions
getAnimatedWidth
Get this rectangle's animated width value (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
float The new rectangle's animated width
No Exceptions
setX
Set the new rectangle x-axis origin.
Parameters
in float x The x-axis origin.
No Return Value
No Exceptions
getX
Get this rectangle's x-axis origin.
No Parameters
Return Value
float The x-axis origin.
No Exceptions
getAnimatedX
Get this rectangle's animated x-axis origin value (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
float The x-axis animated origin.
No Exceptions
setY
Set the new rectangle y-axis origin.
Parameters
in float y The y-axis origin
No Return Value
No Exceptions
getY
Get this rectangle's y-axis origin.
No Parameters
Return Value
float The y-axis origin
No Exceptions
getAnimatedY
Get this rectangle's animated y-axis origin value (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
float The y-axis' animated origin
No Exceptions

Interface PathElement

PathElement is used to represent <path>, <polygon> and <polyline> nodes in the document.


IDL Definition
interface PathElement : GraphicsProperties, TransformableElement { 
  SVGPath getPath (  );
  SVGPath getAnimatedPath (  );
  void setPath ( in SVGPath path );
};

No Defined constants
Methods
setPath
Set the new path for this node. Should not be null.
Parameters
in SVGPath path The new path.
No Return Value
No Exceptions
getPath
Get the Path drawn by this node.
No Parameters
Return Value
SVGPath The path.
No Exceptions
getAnimatedPath
Get the animated Path drawn by this node (the path atribute after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
SVGPath The animated path.
No Exceptions

Interface GroupElement

Group is the interface corresponding to elements which are <g> elements or a refinement of groups, such as the <a> element.


IDL Definition
interface GroupElement : TextProperties, GraphicsProperties, TransformableElement { 
};

No Defined constants
No Methods

Interface ImageElement

ImageElement models an <image> element.


IDL Definition
interface ImageElement : StructureElement, TransformableElement { 
  float getHeight (  );
  float getAnimatedHeight (  );
  void setHeight ( in float height );
  void setHref ( in DOMString href );
  DOMString getHref (  );
  DOMString getAnimatedHref (  );
  float getWidth (  );
  float getAnimatedWidth (  );
  void setWidth ( in float width );
  float getX (  );
  float getAnimatedX (  );
  void setX ( in float x );
  float getY (  );
  float getAnimatedY (  );
  void setY ( in float y );
};

No Defined constants
Methods
setHeight
Set the new image height. Should be strictly positive.
Parameters
in float height The new image height.
No Return Value
No Exceptions
getHeight
Get this image's height.
No Parameters
Return Value
float The image's height.
No Exceptions
getAnimatedHeight
Get this image's animated height value (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
float The image's animated height.
No Exceptions
setHref
Set the new image URI.
Parameters
in DOMString href The image URI.
No Return Value
No Exceptions
getHref
Get the image URI.
No Parameters
Return Value
DOMString The image URI.
No Exceptions
getAnimatedHref
Get the animated image URI value (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
DOMString The animated image URI.
No Exceptions
setWidth
Set the new image width. Should be strictly positive.
Parameters
in float width The new image width.
No Return Value
No Exceptions
getWidth
Get this image's width.
No Parameters
Return Value
float The new image width
No Exceptions
getAnimatedWidth
Get this image's animated width value (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
float The new animated image width
No Exceptions
setX
Set the new image's upper left corner position on the x-axis.
Parameters
in float x The upper left corner position on the x-axis.
No Return Value
No Exceptions
getX
Get this image's upper left corner position on the x-axis.
No Parameters
Return Value
float The upper left corner position on the x-axis.
No Exceptions
getAnimatedX
Get this image's animated upper left corner position on the x-axis (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
float The animated upper left corner position on the x-axis.
No Exceptions
setY
Set the new image's upper left corner position on the y-axis.
Parameters
in float y The upper left corner position on the y-axis.
No Return Value
No Exceptions
getY
Get this image's upper left corner position on the y-axis.
No Parameters
Return Value
float The upper left corner position on the y-axis.
No Exceptions
getAnimatedY
Get this image's animated upper left corner position on the y-axis (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
float The animated upper left corner position on the y-axis.
No Exceptions

Interface UseElement

UseElement is the interface corresponding to the <use> element.


IDL Definition
interface UseElement : StructureElement, TransformableElement { 
  void setHref ( in DOMString href );
  DOMString getHref (  );
  DOMString getAnimatedHref (  );
  float getX (  );
  float getAnimatedX (  );
  void setX ( in float x );
  float getY (  );
  float getAnimatedY (  );
  void setY ( in float y );
};

No Defined constants
Methods
setHref
Set the new use URI.
Parameters
in DOMString href The use URI.
No Return Value
No Exceptions
getHref
Get the current use URI.
No Parameters
Return Value
DOMString The use URI.
No Exceptions
getAnimatedHref
Get the current animated use URI value (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
DOMString The animated use URI.
No Exceptions
setX
Set the new x-axis origin.
Parameters
in float x The x-axis origin.
No Return Value
No Exceptions
getX
Get the x-axis origin.
No Parameters
Return Value
float The x-axis origin.
No Exceptions
getAnimatedX
Get the x-axis animated origin value (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
float The x-axis animated origin.
No Exceptions
setY
Set the new y-axis origin.
Parameters
in float y The y-axis origin.
No Return Value
No Exceptions
getY
Get the y-axis origin.
No Parameters
Return Value
float The y-axis origin.
No Exceptions
getAnimatedY
Get the y-axis animated origin value (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
float The y-axis animated origin.
No Exceptions

Interface TextElement

TextElement in the interface corresponding the the SVG <text> element.
Text content is set by adding Text nodes to the object.


IDL Definition
interface TextElement : StructureElement, TransformableElement { 
  float getAdvance (  );
  void setData ( in DOMString text );
  DOMString getData (  );
  float getX (  );
  float getAnimatedX (  );
  void setX ( in float x );
  float getY (  );
  float getAnimatedY (  );
  void setY ( in float y );
};

No Defined constants
Methods
getAdvance
Get this text's advance.
No Parameters
Return Value
float The text's advance.
No Exceptions
setData
Sets the child's Text node data. Equivalent to: ((Text)getFirstChild()).setData(data)
Parameters
in DOMString text The text data.
No Return Value
No Exceptions
getData
Get the text data. Equivalent to: ((Text)getFirstChild()).getData()
No Parameters
Return Value
DOMString The text data.
No Exceptions
setX
Set this text's new x-axis position.
Parameters
in float x The text's x-axis position.
No Return Value
No Exceptions
getX
Get this text's current x-axis position.
No Parameters
Return Value
float The text's x-axis position.
No Exceptions
getAnimatedX
Get this text's current animated x-axis position value (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
float The text's animated x-axis position.
No Exceptions
setY
Set this text's new y-axis position.
Parameters
in float y The text's y-axis position.
No Return Value
No Exceptions
getY
Get this text's current y-axis position.
No Parameters
Return Value
float The text's y-axis position.
No Exceptions
getAnimatedY
Get this text's current animated y-axis position value (the value after all animations at the current document time has been applied to the attribute).
No Parameters
Return Value
float The text's animated y-axis position.
No Exceptions

Interface SVGLocatable

SVGLocatable is the same interface as the SVGLocatable interface in the SVG 1.1 specification.
For definition see SVGLocatable.

Interface SVGRect

SVGRect is the same interface as the SVGRect interface in the SVG 1.1 specification.
For definition see SVGRect.

Interface SVGMatrix

SVGMatrix is the same interface as the SVGMatrix interface in the SVG 1.1 specification.
For definition see SVGMatrix.

Interface SVGColor

SVGColor is still to be defined. Will be a color datatype containing the color/paint functionality relevant for SVGT. Probably a subset of SVGColor for SVG 1.1 full profile.


Appendix B. Element Index


Color code
SVG1.2 New Elements Element Name
Elements supported by SVGT1.1 Module Name
Elements supported by SVGT1.2 Section Name in SVG1.2 Doc.
Disallowed in profile n/a
Element SVGT1.2
a Hyperlinking
altGlyph n/a
altGlyphDef n/a
altGlyphItem n/a
animate Animation
animateColor Animation
animateMotion Animation
animateTransform Animation
audio Multimedia enhancements
circle Shape
clipPath n/a
color-profile n/a
cursor n/a
definition-src n/a
defs Basic Structure
desc Basic Structure
deviceColor n/a
elementDef n/a
ellipse Shape
extensionDefs n/a
feBlend n/a
feColorMatrix n/a
feComponentTransfer n/a
feComposite n/a
feConvolveMatrix n/a
feDiffuseLighting n/a
feDisplacementMap n/a
feDistantLight n/a
feFlood n/a
feFuncA n/a
feFuncB n/a
feFuncG n/a
feFuncR n/a
feGaussianBlur n/a
feImage n/a
feMerge n/a
feMergeNode n/a
feMorphology n/a
feOffset n/a
fePointLight n/a
feSpecularLighting n/a
feSpotLight n/a
feTile n/a
feTurbulence n/a
filter n/a
flowDiv Text Enhancements
flowImage n/a
flowLine n/a
flowPara Text Enhancements
flowRef n/a
flowRegion Text Enhancements
flowRegionBreak n/a
flowRegionExclude n/a
flowSpan n/a
flowText Text Enhancements
flowTref n/a
font-face Basic Font
font-face-format n/a
font-face-name Basic Font
font-face-src Basic Font
font-face-uri n/a
foreignObject Extensibility
g Basic Structure
glyph Basic Font
glyphRef n/a
handler XML Events Integration
hint n/a
hkern Basic Font
image Image
line Shape
linearGradient Tiny Gradient?
marker n/a
mask n/a
metadata Basic Structure
missing-glyph Basic Font
mpath Animation
page Multiple Pages
pageSet Multiple Pages
par n/a
param n/a
path Shape
pattern n/a
polygon Shape
polyline Shape
prefetch n/a
prototype n/a
radialGradient Tiny Gradient?
rect Shape
refContent n/a
script n/a
seq n/a
set Animation
solidColor n/a
stop n/a
style n/a
svg Basic Structure
switch Conditional Processing
symbol n/a
text Basic Text
textPath n/a
title Basic Structure
transformer n/a
transition n/a
tref n/a
tspan n/a
use Basic Structure
veAffine n/a
vectorEffect n/a
veExclude n/a
veFill n/a
veIntersect n/a
veJoin n/a
veMarker n/a
vePath n/a
vePathRef n/a
veReverse n/a
veSetback n/a
veStroke n/a
veStrokePath n/a
veUnion n/a
video n/a
view n/a
vkern n/a

Appendix C. New Elements and Attributes


Color code
Elements/Attributes supported by SVGT1.2  
Section Element Attribute Values
Text Wrapping flowText PresentationAttrs
Text Wrapping flowText StyleAttrs
Text Wrapping flowRegion

Text Wrapping flowRegionExclude

Text Wrapping flowDiv PresentationAttrs
Text Wrapping flowDiv StyleAttrs
Text Wrapping flowPara PresentationAttrs
Text Wrapping flowPara StyleAttrs
Text Wrapping flowSpan PresentationAttrs
Text Wrapping flowSpan StyleAttrs
Text Wrapping flowRegionBreak

Text Wrapping flowLine PresentationAttrs
Text Wrapping flowLine StyleAttrs
Text Wrapping flowTref xlink:href %URI;
Text Wrapping flowTref PresentationAttrs
Text Wrapping flowTref StyleAttrs
Text Wrapping flowRef xlink:href %URI;
Text Wrapping flowRef PresentationAttrs
Text Wrapping flowRef StyleAttrs
Text Wrapping flowImage width %Length;
Text Wrapping flowImage height %Length;
Editable Text Fields flowDiv editable true | false
Editable Text Fields text editable true | false
Element definitions extensionDefs PresentationAttrs
Element definitions extensionDefs StyleAttrs
Element definitions elementDef PresentationAttrs
Element definitions elementDef StyleAttrs
Element definitions elementDef name CDATA
Element definitions prototype

Element definitions transformer xlink:href %URI;
Element definitions transformer type content-type
Element definitions param name CDATA
Element definitions param value CDATA
Element definitions refContent PresentationAttrs
Element definitions refContent StyleAttrs
Element definitions refContent select %XPathSelector;
Element definitions refContent transform %TransformList;
Element focus and navigation container elements and graphics elements focusable true | false | auto
Tooltips hint

The handler element handler commonAttrs
The handler element handler type %ContentType;
The handler element handler xlink:href %URI;
The handler element handler xml:base %URI;
The handler element handler ev:event CDATA
The audio element audio XLinkEmbedAttrs
The audio element audio MediaAttrs
The video element video x %Coordinate;
The video element video y %Coordinate;
The video element video width %Length;
The video element video height %Length;
The video element video preserveAspectRatio %PreserveAspectRatioSpec;
The video element video PresentationAttrs
The video element video StyleAttrs
The video element video XLinkEmbedAttrs
The video element video MediaAttrs
Transition effects transition type transition-type
Transition effects transition subtype transition-type
Transition effects transition dur CDATA
Transition effects transition startProgress %TransitionValue;
Transition effects transition endProgress %TransitionValue;
Transition effects transition direction forward | reverse
Transition effects transition fadeColor %Color;
Timing and Synchronization par

Timing and Synchronization seq

The pageSet element pageSet PresentationAttrs
The pageSet element pageSet StyleAttrs
The page element page PresentationAttrs
The page element page StyleAttrs
The page element page viewBox %ViewBoxSpec;
The page element page preserveAspectRatio %PreserveAspectRatioSpec;
The page element page page-orientation 270 | -180 | -90 | 0 | 90 | 180 | 270
The timelineBegin attribute svg, page? timelineBegin onLoad | onStart
The streamedContents attribute page? streamedContent keep | discard
Enhanced Alpha Compositing container elements and graphics elements clip-to-self true | false | inherit
Enhanced Alpha Compositing container elements enable-background accumulate | new [ x y width height ] | inherit
Enhanced Alpha Compositing container elements knock-out true | false | inherit
Enhanced Alpha Compositing container elements and graphics elements comp-op clear | src | dst | src_over | dst_over | src_in | dst_in | src_out | dst_out | src_atop | dst_atop | xor | plus | multiply | screen | overlay | darken | lighten | color_dodge | color_burn | hard_light | soft_light | difference | exclusion | inherit
Constrained Transformations container elements, use, image, feImage transform-host true | false
The solidColor Element solidColor PresentationAttrs
The solidColor Element solidColor StyleAttrs
The solidColor Element solidColor solid-color currentColor | <color> [icc-color( <name> [, <icccolorvalue>]* ) ] | inherit
The solidColor Element solidColor solid-opacity <alphavalue> | inherit
Background Fill Property viewport-creating elements background-fill <paint>
Inheritance into the shadow tree all elements that establish shadow trees shadowInherit onDefine | onUse | none | inherit
Using device colors deviceColor xlink:href %URI;
Using device colors deviceColor name
Controlling the rendering color space container elements and graphical elements rendering-color-space auto | sRGB | linearRGB | <name> | %URI; |inherit
Prefetching resources prefetch xlink:href %URI;
Prefetching resources prefetch StdAttrs
Prefetching resources prefetch mediaSize <number> | <percentage>
Prefetching resources prefetch mediaTime <clock> | <percentage>
Prefetching resources prefetch bandwidth <number> | <percentage>
The vectorEffect element vectorEffect vectorEffectUnits userSpaceOnUse | objectBoundingBox
The vectorEffect element vectorEffect compositing normal | knockout
The veStrokePath element veStrokePath result %OutputName;
The veStrokePath element veStrokePath in %SourcePath; | %InputName;
The veStrokePath element veStrokePath transform %TransformList;
The veStrokePath element veStrokePath stroke-width %StrokeWidthValue;
The veStrokePath element veStrokePath stroke-dasharray %StrokeDashArrayValue;
The veStrokePath element veStrokePath stroke-dashoffset %StrokeDashOffsetValue;
The veStrokePath element veStrokePath stroke-linejoin (miter | round | bevel | inherit)
The veStrokePath element veStrokePath stroke-linecap (butt | round | square | inherit)
The veStrokePath element veStrokePath stroke-miterlimit %StrokeMiterLimitValue;
The veSetback element veSetback result %OutputName;
The veSetback element veSetback in %SourcePath; | %InputName;
The veSetback element veSetback transform %TransformList;
The veSetback element veSetback setback-offset %Length;
The veAffine element veAffine result %OutputName;
The veAffine element veAffine in %SourcePath; | %InputName;
The veAffine element veAffine transformPath %TransformList;
The veReverse element veReverse result %OutputName;
The veReverse element veReverse in %SourcePath; | %InputName;
The veJoin element veJoin result %OutputName;
The veJoin element veJoin in %SourcePath; | %InputName;
The veJoin element veJoin in2 %SourcePath; | %InputName;
The veJoin element veJoin connect line | none
The veUnion element veUnion result %OutputName;
The veUnion element veUnion in %SourcePath; | %InputName;
The veUnion element veUnion in2 %SourcePath; | %InputName;
The veIntersect element veIntersect result %OutputName;
The veIntersect element veIntersect in %SourcePath; | %InputName;
The veIntersect element veIntersect in2 %SourcePath; | %InputName;
The veExclude element veExclude result %OutputName;
The veExclude element veExclude in %SourcePath; | %InputName;
The veExclude element veExclude in2 %SourcePath; | %InputName;
The veFill element veFill in %SourcePath; | %InputName;
The veFill element veFill fill StrokePaint | FillPaint
The veFill element veFill transform %TransformList;
The veStroke element veStroke in %SourcePath; | %InputName;
The veStroke element veStroke fill StrokePaint | FillPaint
The veStroke element veStroke transform %TransformList;
The veMarker element veMarker in %SourcePath; | %InputName;
The veMarker element veMarker marker-start ?
The veMarker element veMarker marker-mid ?
The veMarker element veMarker marker-end ?
The veMarker element veMarker transform %TransformList;
The vePath element vePath result %OutputName;
The vePathRef element vePathRef connect line | none
The vePathRef element vePathRef reverse ?
The vePathRef element vePathRef transform %TransformList;
The vePathRef element vePathRef xlink:href %URI;