A DOM application can use the hasFeature method of the
DOMImplementation
interface to determine whether the SMIL Object Model interfaces are
supported or not. The feature string for the fundamental interfaces listed
in this section is "org.w3c.dom.smil". The version of this DOM version is
"2.0".
The purpose of the SMIL Boston DOM is to provide an easy access to the attributes and functionalities of the SMIL Boston specification ([SMIL Boston]). Not all SMIL Boston attributes are accessible with the following API but the user can still use the DOM Core ([DOM Level 2]) to access them (see setAttributeNS and getAttributeNS).
A SMIL document is the root of the SMIL Hierarchy and holds the entire content. Beside providing access to the hierarchy, it also provides some convenience methods for accessing certain sets of information from the document.
interface SMILDocument : Document, ElementSequentialTimeContainer {
};
The SMILElement interface is the base for all SMIL element
types. It follows the model of the HTMLElement
in the HTML DOM, extending the base Element
class to denote SMIL-specific elements.
Note that the SMILElement interface overlaps with the
HTMLElement
interface. In practice, an integrated document profile that include HTML
and SMIL modules will effectively implement both interfaces (see also the
DOM documentation discussion of
Inheritance vs
Flattened Views of the API).
interface SMILElement : Element {
attribute DOMString id;
// raises(DOMException) on setting
};
id of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
This SMIL Boston module doesn't have a corresponding SMIL Boston DOM module.
This module includes the layout, root_layout and region elements, and associated attributes.
Declares layout type for the document. See the LAYOUT element definition.
interface SMILLayoutElement : SMILElement {
readonly attribute DOMString type;
readonly attribute boolean resolved;
};
This interface is used by SMIL elements root-layout, top-layout and region.
interface ElementLayout {
attribute DOMString title;
// raises(DOMException) on setting
attribute DOMString backgroundColor;
// raises(DOMException) on setting
attribute long height;
// raises(DOMException) on setting
attribute long width;
// raises(DOMException) on setting
};
title of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
backgroundColor of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
height of type long
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
width of type long
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
Declares layout properties for the top-layout element. See the top-layout element definition.
interface SMILTopLayoutElement : SMILElement, ElementLayout {
};
Declares layout properties for the root-layout element. See the root-layout element definition.
interface SMILRootLayoutElement : SMILElement, ElementLayout {
};
Controls the position, size and scaling of media object elements. See the region element definition.
interface SMILRegionElement : SMILElement, ElementLayout {
attribute DOMString fit;
// raises(DOMException) on setting
attribute DOMString top;
// raises(DOMException) on setting
attribute long zIndex;
// raises(DOMException) on setting
};
fit of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
top of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
zIndex of type long
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
The layout module also includes the region attribute, used in SMIL layout to associate layout with content elements. This is represented as an individual interface, that is supported by content elements in SMIL documents (i.e. in profiles that use SMIL layout).
Declares rendering surface for an element. See the region attribute definition.
interface SMILRegionInterface {
attribute SMILRegionElement region;
};
region of type SMILRegionElement
This module includes extensions for timing and synchronization.
The Time interface is a datatype that represents times
within the timegraph. A Time has a type, key values to
describe the time, and a boolean to indicate whether the values are
currently unresolved.
interface Time {
readonly attribute boolean resolved;
readonly attribute double resolvedOffset;
// TimeTypes
const unsigned short SMIL_TIME_INDEFINITE = 0;
const unsigned short SMIL_TIME_OFFSET = 1;
const unsigned short SMIL_TIME_SYNC_BASED = 2;
const unsigned short SMIL_TIME_EVENT_BASED = 3;
const unsigned short SMIL_TIME_WALLCLOCK = 4;
const unsigned short SMIL_TIME_MEDIA_MARKER = 5;
readonly attribute unsigned short timeType;
attribute double offset;
// raises(DOMException) on setting
attribute Element baseElement;
// raises(DOMException) on setting
attribute boolean baseBegin;
// raises(DOMException) on setting
attribute DOMString event;
// raises(DOMException) on setting
attribute DOMString marker;
// raises(DOMException) on setting
};
resolved of type boolean, readonlyTime has been
fully resolved to the document schedule. Note that for this to be
true, the current Time must be defined (not indefinite),
the syncbase and all Time's that the syncbase depends on
must be defined (not indefinite), and the begin Time of
all ascendent time containers of this element and all Time
elements that this depends upon must be defined (not indefinite).
Time is based upon an event, this
Time will only be resolved once the specified event has
happened, subject to the constraints of the time container.
resolvedOffset of type double, readonly
An integer indicating the type of this time value.
| SMIL_TIME_INDEFINITE |
The Time is specified to be "indefinite". The
Time may have a resolved value, if a method call is made
to activate this time (beginElement for a begin time, or endElement
for an active end time). If the Time is resolved, the
resolvedOffset will reflect the time at which the method call was
made.
The Time attributes offset, baseBegin, event and marker
are undefined for this type.
|
| SMIL_TIME_OFFSET |
The value is a simple offset from the default syncbase. The
baseElement will be the default syncbase element defined by the time
model, the baseBegin indicates whether the default syncbase is
relative to the begin or active end of the baseElement, and the
offset will be the specified offset.
The Time attributes baseElement, baseBegin, event and
marker are undefined for this type.
|
| SMIL_TIME_SYNC_BASED |
The value is relative to the begin of the specified baseElement. The
baseElement will be the specified syncbase, the baseBegin indicates
whether the default syncbase is relative to the begin or active end
of the baseElement, and the offset will be the specified offset.
Note that this includes times specified with the logical syncbases
"prev.begin" or "prev.end".
The Time attributes event and marker are undefined for
this type.
|
| SMIL_TIME_EVENT_BASED |
The value is relative to the specified event raised on the
baseElement. The baseElement will be the specified syncbase, and the
offset will be the specified offset. If the Time is
resolved, the resolvedOffset will reflect the time at which the event
was raised.
The Time attributes baseBegin and marker are undefined
for this type.
|
| SMIL_TIME_WALLCLOCK |
The value is specified as a wallclock value. If the
Time is resolved, the resolvedOffset will reflect the
wallclock time, converted to document time.
The Time attributes baseElement, baseBegin, event and
marker are undefined for this type.
|
| SMIL_TIME_MEDIA_MARKER |
The value is specified as a marker value associated with a given
media element. The baseElement will be the specified media element,
and the marker will be the name of the media marker value. If the
Time is resolved, the resolvedOffset will reflect the
time associated with the specified marker value.
The Time attributes offset, baseElement and event are
undefined for this type.
|
timeType of type unsigned short, readonly
offset of type double0.
|
NO_MODIFICATION_ALLOWED_ERR: Raised on attempts to modify this readonly attribute. |
baseElement of type Element
|
NO_MODIFICATION_ALLOWED_ERR: Raised on attempts to modify this readonly attribute. |
baseBegin of type booleantrue, indicates that a sync-based time is relative to
the begin of the baseElement. If false, indicates that a
sync-based time is relative to the active end of the baseElement.
|
NO_MODIFICATION_ALLOWED_ERR: Raised on attempts to modify this readonly attribute. |
event of type DOMStringnull.
|
NO_MODIFICATION_ALLOWED_ERR: Raised on attempts to modify this readonly attribute. |
marker of type DOMStringnull.
|
NO_MODIFICATION_ALLOWED_ERR: Raised on attempts to modify this readonly attribute. |
The TimeList interface provides the abstraction of an
ordered collection of times, without defining or
constraining how this collection is implemented.
The items in the TimeList are accessible via an
integral index, starting from 0.
interface TimeList {
Time item(in unsigned long index);
readonly attribute unsigned long length;
};
length of type unsigned long, readonlylength-1 inclusive.
itemindexth item in the collection.
If index is greater than or equal to the number
of times in the list, this returns null.
|
| Index into the collection. |
|
The time at the |
This interface defines the set of timing attributes that are common to all timed elements.
interface ElementTime {
attribute TimeList begin;
// raises(DOMException) on setting
attribute TimeList end;
// raises(DOMException) on setting
attribute float dur;
// raises(DOMException) on setting
// restartTypes
const unsigned short RESTART_ALWAYS = 0;
const unsigned short RESTART_NEVER = 1;
const unsigned short RESTART_WHEN_NOT_ACTIVE = 2;
attribute unsigned short restart;
// raises(DOMException) on setting
// fillTypes
const unsigned short FILL_REMOVE = 0;
const unsigned short FILL_FREEZE = 1;
attribute unsigned short fill;
// raises(DOMException) on setting
attribute float repeatCount;
// raises(DOMException) on setting
attribute float repeatDur;
// raises(DOMException) on setting
boolean beginElement();
boolean endElement();
void pauseElement();
void resumeElement();
void seekElement(inout float seekTo);
};
begin of type TimeList
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
end of type TimeList
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
dur of type float
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
An integer indicating the value of the restart attribute.
| RESTART_ALWAYS | |
| RESTART_NEVER | |
| RESTART_WHEN_NOT_ACTIVE |
restart of type unsigned shortRESTART_ALWAYS.
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
An integer indicating the value of the fill attribute.
| FILL_REMOVE | |
| FILL_FREEZE |
fill of type unsigned shortFILL_REMOVE.
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
repeatCount of type float
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
repeatDur of type float
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
beginElement
|
|
endElement
|
|
pauseElementresumeElementseekElement
|
| The desired position on the local timeline in milliseconds. |
This interface support use-cases commonly associated with animation.
interface ElementTimeManipulation {
attribute float speed;
// raises(DOMException) on setting
attribute float accelerate;
// raises(DOMException) on setting
attribute float decelerate;
// raises(DOMException) on setting
attribute boolean autoReverse;
// raises(DOMException) on setting
};
speed of type float1.0
(no modification of speed).
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
accelerate of type float0 to 100. Default value is
0 (no acceleration).
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
decelerate of type float0 to 100. Default value is 0 (no
deceleration).
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
autoReverse of type booleanfalse.
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
This is a placeholder - subject to change. This represents generic timelines.
interface ElementTimeContainer : ElementTime {
readonly attribute NodeList timeChildren;
NodeList getActiveChildrenAt(in float instant);
};
timeChildren of type NodeList, readonlyNodelist is empty.
getActiveChildrenAt
|
| The desired position on the local timeline in milliseconds. |
|
List of timed child-elements active at instant. |
The synchronization behavior extension.
interface ElementSyncBehavior {
readonly attribute DOMString syncBehavior;
readonly attribute float syncTolerance;
readonly attribute DOMString defaultSyncBehavior;
readonly attribute float defaultSyncTolerance;
readonly attribute boolean syncMaster;
};
syncBehavior of type DOMString, readonly
syncTolerance of type float, readonlysyncBehavior="locked".
defaultSyncBehavior of type DOMString, readonly
defaultSyncTolerance of type float, readonly
syncMaster of type boolean, readonly
A parallel container defines a simple parallel time grouping
in which multiple elements can play back at the same time.
interface ElementParallelTimeContainer : ElementTimeContainer {
attribute DOMString endSync;
// raises(DOMException) on setting
float getImplicitDuration();
};
endSync of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
getImplicitDuration
|
The implicit duration in seconds or -1 if the implicit is unknown (indefinite?). |
A seq container defines a sequence of elements in which
elements play one after the other.
interface ElementSequentialTimeContainer : ElementTimeContainer {
};
This interface defines a time container with semantics based upon par, but with the additional constraint that only one child element may play at a time.
interface ElementExclusiveTimeContainer : ElementTimeContainer {
attribute DOMString endSync;
// raises(DOMException) on setting
NodeList getPausedElements();
};
endSync of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
getPausedElements
|
All paused elements at the current time. |
The TimeEvent interface provides specific contextual
information associated with Time events.
interface TimeEvent : events::Event {
readonly attribute views::AbstractView view;
readonly attribute long detail;
void initTimeEvent(in DOMString typeArg,
in views::AbstractView viewArg,
in long detailArg);
};
initTimeEventinitTimeEvent method is used to initialize the value
of a TimeEvent created through the
DocumentEvent interface. This method may only be called
before the TimeEvent has been dispatched via the
dispatchEvent method, though it may be called multiple
times during that phase if necessary. If called multiple times, the
final invocation takes precedence.
|
| Specifies the event type. | ||
|
| Specifies the | ||
|
| Specifies the |
The different types of events that can occur are:
Time event interface supports a property
"detail" that indicates which repeat iteration is beginning. The
value is a 0-based integer, but the repeat event is not raised
for the first iteration and so the observed values will be >= 1.
of the element ?
This module includes the media elements, and associated attributes. They are all currently represented by a single interface, as there are no specific attributes for individual media elements.
Declares media content.
interface SMILMediaElement : ElementTime, SMILElement {
attribute DOMString abstractAttr;
// raises(DOMException) on setting
attribute DOMString alt;
// raises(DOMException) on setting
attribute DOMString author;
// raises(DOMException) on setting
attribute DOMString clipBegin;
// raises(DOMException) on setting
attribute DOMString clipEnd;
// raises(DOMException) on setting
attribute DOMString copyright;
// raises(DOMException) on setting
attribute DOMString longdesc;
// raises(DOMException) on setting
attribute DOMString port;
// raises(DOMException) on setting
attribute DOMString readIndex;
// raises(DOMException) on setting
attribute DOMString rtpformat;
// raises(DOMException) on setting
attribute DOMString src;
// raises(DOMException) on setting
attribute DOMString stripRepeat;
// raises(DOMException) on setting
attribute DOMString title;
// raises(DOMException) on setting
attribute DOMString transport;
// raises(DOMException) on setting
attribute DOMString type;
// raises(DOMException) on setting
};
abstractAttr of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
alt of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
author of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
clipBegin of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
clipEnd of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
copyright of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
longdesc of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
port of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
readIndex of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
rtpformat of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
src of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
stripRepeat of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
title of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
transport of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
type of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
interface SMILRefElement : SMILMediaElement {
};
This module will include interfaces associated with animation extensions.
The following interface comes from the SMIL Animation draft.
interface ElementTimeControl {
boolean beginElement()
raises(DOMException);
boolean beginElementAt(in float offset)
raises(DOMException);
boolean endElement()
raises(DOMException);
boolean endElementAt(in float offset)
raises(DOMException);
};
beginElement
|
|
|
SYNTAX_ERR: The element was not defined with the appropriate syntax
to allow |
beginElementAt
|
| The offset in seconds at which to begin the element. |
|
|
|
SYNTAX_ERR: The element was not defined with the appropriate syntax
to allow |
endElement
|
|
|
SYNTAX_ERR: The element was not defined with the appropriate syntax
to allow |
endElementAt
|
| The offset in seconds at which to end the element. Must be >= 0. |
|
|
|
SYNTAX_ERR: The element was not defined with the appropriate syntax
to allow |
This interface define the set of animation extensions for SMIL.
interface SMILAnimation : SMILElement, ElementTargetAttributes, ElementTime, ElementTimeControl {
// additiveTypes
const unsigned short ADDITIVE_REPLACE = 0;
const unsigned short ADDITIVE_SUM = 1;
attribute unsigned short additive;
// raises(DOMException) on setting
// accumulateTypes
const unsigned short ACCUMULATE_NONE = 0;
const unsigned short ACCUMULATE_SUM = 1;
attribute unsigned short accumulate;
// raises(DOMException) on setting
// calcModeTypes
const unsigned short CALCMODE_DISCRETE = 0;
const unsigned short CALCMODE_LINEAR = 1;
const unsigned short CALCMODE_PACED = 2;
const unsigned short CALCMODE_SPLINE = 3;
attribute unsigned short calcMode;
// raises(DOMException) on setting
attribute DOMString keySplines;
// raises(DOMException) on setting
attribute TimeList keyTimes;
// raises(DOMException) on setting
attribute DOMString values;
// raises(DOMException) on setting
attribute DOMString from;
// raises(DOMException) on setting
attribute DOMString to;
// raises(DOMException) on setting
attribute DOMString by;
// raises(DOMException) on setting
};
| ADDITIVE_REPLACE | |
| ADDITIVE_SUM |
additive of type unsigned shortADDITIVE_REPLACE.
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
| ACCUMULATE_NONE | |
| ACCUMULATE_SUM |
accumulate of type unsigned shortACCUMULATE_NONE.
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
| CALCMODE_DISCRETE | |
| CALCMODE_LINEAR | |
| CALCMODE_PACED | |
| CALCMODE_SPLINE |
calcMode of type unsigned short
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
keySplines of type DOMStringDOMString representing the value of the
keySplines
attribute.
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
keyTimes of type TimeList
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
values of type DOMStringDOMString representing the value of the
values attribute.
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
from of type DOMStringDOMString representing the value of the
from attribute.
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
to of type DOMStringDOMString representing the value of the
to attribute.
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
by of type DOMStringDOMString representing the value of the
by attribute.
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
This interface define the set of animation target extensions.
interface ElementTargetAttributes {
attribute DOMString attributeName;
// attributeTypes
const unsigned short ATTRIBUTE_TYPE_AUTO = 0;
const unsigned short ATTRIBUTE_TYPE_CSS = 1;
const unsigned short ATTRIBUTE_TYPE_XML = 2;
attribute unsigned short attributeType;
};
attributeName of type DOMString
| ATTRIBUTE_TYPE_AUTO | |
| ATTRIBUTE_TYPE_CSS | |
| ATTRIBUTE_TYPE_XML |
attributeType of type unsigned shortATTRIBUTE_TYPE_CODE.
This interface represents the SMIL animate element.
interface SMILAnimateElement : SMILAnimation {
};
This interface represents the set element.
interface SMILSetElement : ElementTimeControl, ElementTime, ElementTargetAttributes, SMILElement {
attribute DOMString to;
};
to of type DOMString
This interface present the animationMotion element in
SMIL.
interface SMILAnimateMotionElement : SMILAnimateElement {
attribute DOMString path;
// raises(DOMException) on setting
attribute DOMString origin;
// raises(DOMException) on setting
};
path of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
origin of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
This interface represents the SMIL animateColor element.
interface SMILAnimateColorElement : SMILAnimation {
};
This module will include interfaces associated with transition markup. This is yet to be defined.
This module includes interfaces for content control markup.
Defines a block of content control. See the switch element definition.
interface SMILSwitchElement : SMILElement {
Element getSelectedElement();
};
getSelectedElementnull if the
selected element is not yet available.
|
The selected |
Defines the test attributes interface. See the Test attributes definition.
interface ElementTest {
attribute long systemBitrate;
// raises(DOMException) on setting
attribute boolean systemCaptions;
// raises(DOMException) on setting
attribute DOMString systemLanguage;
// raises(DOMException) on setting
readonly attribute boolean systemRequired;
readonly attribute boolean systemScreenSize;
readonly attribute boolean systemScreenDepth;
attribute DOMString systemOverdubOrSubtitle;
// raises(DOMException) on setting
attribute boolean systemAudioDesc;
// raises(DOMException) on setting
};
systemBitrate of type long
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
systemCaptions of type boolean
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
systemLanguage of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
systemRequired of type boolean, readonly
systemScreenSize of type boolean, readonly
systemScreenDepth of type boolean, readonly
systemOverdubOrSubtitle of type DOMString
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |
systemAudioDesc of type boolean
|
NO_MODIFICATION_ALLOWED_ERR: Raised if this attribute is readonly. |