この付録は規定である。 This appendix is normative.
SVG Mobile 1.1 仕様 [SVGM11] の近年の開発段階の中、実装の重荷を軽減するために SVG と XML DOM のサブセット化が必要なことが明らかになってきた。 SVG Tiny 1.2 では SVG Tiny の実装に相応しくありつつ必要な機能性が可能な限り得られる新しい特色機能を uDOM に盛り込む。 During the later stages of development of the SVG Mobile 1.1 specification [SVGM11] it became obvious that there was a requirement to subset the SVG and XML DOM in order to reduce the burden on implementations. SVG Tiny 1.2 adds new features to the uDOM, allowing for as much necessary functionality as possible, still being suitable for SVG Tiny implementations.
更に、 SVG Tiny 1.1 をサポートする機器には uDOM が実装可能な筈である。 この場合、( SVG Tiny 1.1 はインラインスクリプトの利用をサポートしていないので)スクリプトは SVG 文書の外部の利用になるが。 Furthermore, it should be possible to implement the uDOM on devices that support SVG Tiny 1.1 although, in this case, the scripting would be external to the SVG document (since SVG Tiny 1.1 does not support inline scripting).
uDOM 定義の目標は、最も有用な SVG の特色機能(変換行列など)のみならず、従来の SVG DOM と比してインターフェースの数を減らし, 必要なコア XML DOM の特色機能を利用する実行時メモリ領域を節約するために、属性とプロパティの初期値と算出値へのアクセスを可能にする API を提供する所にある。 uDOM の( SVG Tiny 1.1 に対応する)サブセットはすでに JSR 226: Scalable 2D Vector Graphics API for J2ME の様々な実装により、成功裏に実装されており、その互換性は uDOM [JSR226] のもう一つの目標になる。 The goal of the uDOM definition is to provide an API that allows access to initial and computed attribute and property values, to reduce the number of interfaces compared to the traditional SVG DOM, to reduce run-time memory footprint using necessary features of the core XML DOM, as well as the most useful SVG features (such as transformation matrices). A subset of the uDOM (corresponding to SVG Tiny 1.1) is already successfully implemented by various implementations of JSR 226: Scalable 2D Vector Graphics API for J2ME, compatibility with which is another goal of the uDOM [JSR226].
uDOM は DOM Level 2 Events [DOM2EVENTS] を規範として参照し, 参考として [DOM3EVENTS] を参照する。 DOM Level 3 Events は発行時点ではまだ勧告になっていないので、 uDOM には携帯機器に現在実装されているような機能を指定する DOM Level 3 Events の最小のサブセットが含められている。 DOM Level 3 Events には現在のウェブ環境のニーズを反映するように変更が加わることが予想され、その相反する変更は後の SVG 仕様においてここに指定される機能性に取って代わることになる。 The uDOM makes normative reference to DOM Level 2 Events [DOM2EVENTS], and informative reference to DOM Level 3 Events [DOM3EVENTS]. A minimal subset of DOM Level 3 Events was included in the uDOM to specify functionality as currently implemented on mobile devices, since DOM Level 3 Events was not yet a Recommendation at the time of publication. It is anticipated that DOM Level 3 Events may change to reflect the needs of the current Web environment, and any conflicting changes will supersede the functionality specified here for later SVG specifications.
uDOM の IDL 定義 が提供されている。 The IDL definition for the uDOM is provided.
この付録は次に挙げる部分から構成される: This appendix consists of the following parts:
SVG uDOM 概観 — uDOM の参考概要。 サポートされる特色機能の要約および主要な特色機能と制約についての実例も伴う記述を含む。 Overview of the SVG uDOM — an informative introduction to the uDOM, including a summary of supported features and descriptions by topic of the key features and constraints together with examples.
SVG uDOM への適合 — 主要な特色機能についての記述のみならず SVG uDOM への適合性基準を明記した、正式な節。 Conforming to the SVG uDOM — a normative section that states conformance criteria for the SVG uDOM as well as descriptions of key features.
SVG uDOM ( DOM Core APIs, DOM Views APIs, SMIL DOM APIs, DOM Events APIs, SVG DOM APIs )のすべてのインターフェースの正式な定義。 A normative definition of all the interfaces in the SVG uDOM (DOM Core APIs, DOM Views APIs, SMIL DOM APIs, DOM Events APIs and SVG DOM APIs).
以下の節では、 SVG uDOM の主要な特色機能と制約の知識情報的概観を与える。 The following sections provides an informative overview of the SVG uDOM's key features and constraints.
注記:他の W3C DOM 定義同様、 SVG uDOM はプログラミング言語に依存しない。 この付録の例は ECMAScript と Java 言語のみからなるが、 SVG uDOM は他のプログラミング言語とも互換性がある。 Note: Like other W3C DOM definitions, the SVG uDOM is programming-language independent. Although this appendix only contains ECMAScript and Java language examples, the SVG uDOM is compatible with other programming languages.
SVG uDOM は他の機能へのアクセスの起点になる
Document
オブジェクトへのアクセスを提供する。
Document
オブジェクトが利用できるまでになる経緯は利用する文脈に依存する。
Java などの一部の言語では
Document
オブジェクトは
EventListenerInitializer2
インターフェースの実装により得られる。
SVG-UA
は一旦スクリプトが読み込まれて文書に結びつける準備が整い次第、実装の
initializeEventListeners
メソッドを呼び出す。
Document
オブジェクトへは他の手段、例えば ECMAScript のグローバルオブジェクトに存在する
AbstractView::document
メンバを通してアクセスできる場合もある。
The SVG uDOM offers access to a Document object which is the root for accessing other features. The way the Document object becomes available depends on the usage context. In some languages, such as Java, the Document object can be obtained by implementing the EventListenerInitializer2 interface. The SVG user agent will invoke the implementation's initializeEventListeners method once the script has been loaded and is ready to bind to the document. The Document object is sometimes accessible through other means, for example through the AbstractView::document member which is available on the global object in ECMAScript.
SVG uDOM では DOM 木のナビゲーションは文書ノードと要素ノードに対してのみ可能である。 要素階層のナビゲーションには2つの方法がある。 The SVG uDOM only allows navigation of the document node and the element nodes in the DOM tree. Two options are available for navigating the hierarchy of elements:
getElementById
メソッドから直接アクセスできる。
Individual element nodes with an ID value are accessible directly via the getElementById method on the Document interface.
parentNode
属性と
ElementTraversal
インターフェースの機能を利用して辿ることができる。
The hierarchy of element nodes are traversable using the facilities on the ElementTraversal interface, along with the parentNode attribute on the Node interface.
ElementTraversal
インターフェースが提供する
firstElementChild
,
lastElementChild
,
previousElementSibling
,
nextElementSibling
[ET]
は、とりわけ制約のある機器に適している。
これらのトラバースの仕組みは、空白のみからなるテキストノードなど、要素ノード間に割り込んでいるノードを飛ばす。
The ElementTraversal interface provides firstElementChild, lastElementChild, previousElementSibling and nextElementSibling, which are particularly suitable for constrained devices [ET]. These traversal mechanisms skip over intervening nodes between element nodes, such as text nodes which might only contain white space.
SVG uDOM では
Document
インターフェースの
createElementNS
メソッドを用いて新しい要素を作成できる。
The SVG uDOM allows the creation of new elements using the createElementNS method of the Document interface.
String svgNS = "http://www.w3.org/2000/svg"; Element myRect = document.createElementNS(svgNS, "rect");
要素は親になる
Node
の
appendChild
または
insertBefore
メソッドを呼び出して文書木に挿入できる。
Elements can be inserted into the document tree by calling the appendChild or insertBefore methods on the Node that is to be the parent.
var svgNS = "http://www.w3.org/2000/svg"; // 新しい <rect> 要素を作成 var myRect = document.createElementNS(svgNS, "rect"); // 追加前に種々の <rect> プロパティを設定 ... // 要素を文書のルートに追加 var svgRoot = document.documentElement; svgRoot.appendChild(myRect); // 新しい <ellipse> 要素を作成 var myEllipse = document.createElementNS(svgNS, "ellipse"); // 挿入前に種々の <ellipse> プロパティを設定 ... // 矩形の前に楕円を挿入 svgRoot.insertBefore(myEllipse, myRect);
要素は親の
Node
の
removeChild
メソッドを呼び出して文書木から除去できる。
An element can be removed from the document tree by calling the removeChild method on its parent Node.
var myRect = ...; var myGroup = document.getElementById("myGroup"); myGroup.appendChild(myRect); ... myGroup.removeChild(myRect);
SVG Tiny 1.2 uDOM は XML 属性と CSS プロパティへアクセスする2つの方法をサポートする:
Element
インターフェースの
getAttributeNS
と
setAttributeNS
を用いる標準的な方法と traits と呼ばれる新しい概念による方法がある。
The SVG Tiny 1.2 uDOM supports two ways of accessing XML attributes and CSS properties; the standard way via getAttributeNS and setAttributeNS on the Element interface, and via a new concept called traits.
trait とは、 XML 属性や CSS プロパティを介して要素に結びつけられた、型付けされた値(例えば単なる文字列ではない数値など)である。
SVG uDOM における trait の機能は、一定の属性やプロパティ値への強く型付けされたアクセスを可能にする。
例えば、
getAttributeNS
メソッドでは常に文字列が返されるのに比して
getFloatTrait
メソッドでは属性やプロパティの値を直接 float
として取得する。
SVG uDOM の trait の機能は
SVG 要素
を表現するすべての DOM オブジェクトに実装される
TraitAccess
インターフェースで利用できる。
A trait is the typed value (e.g. a number, not just a string), associated with an element by an XML attribute or a CSS property. The trait facilities in the SVG uDOM allow for strongly-typed access to certain attribute and property values. For example, there is a getFloatTrait method for getting an attribute or property value directly as a float, in contrast with the getAttributeNS method which always returns a string. The trait facilities in the SVG uDOM are available on the TraitAccess interface, which is implemented by all DOM objects representing SVG elements.
float width = myRect.getFloatTrait("width"); width += 10; myRect.setFloatTrait("width", width);
(他のすべての trait ゲッタメソッドも併せて)
getTraitNS
と
getAttributeNS
の重要な違いは
getTraitNS
が属性の算出値を返すのに対し、
getAttributeNS
は属性の指定値(
属性/プロパティの正規化
で述べるように UA による値の正規化が生じ得るので、元の指定値と一致するとは限らない)を返す所にある。
An important difference between getTraitNS (along with all other trait getter methods) and getAttributeNS is that getTraitNS returns the computed attribute value but getAttributeNS returns the specified attribute value (which might not exactly match the original specified value due to the possibility of user agent value normalization as described in Attribute/property normalization).
getTraitNS
と
getAttributeNS
の差異
<g fill="red"> <rect id="r1" x="1" y="1" width="5" height="5"/> <rect id="r2" fill="inherit" x="1" y="1" width="5" height="5"/> </g>
上の例で: In the above example:
r1.getTraitNS(null, "fill")
は "red"
を返す(あるいは等価な正規化された形式の値を返す。
属性/プロパティの正規化
を見よ)。
r1.getTraitNS(null, "fill") returns "red" (or an equivalent normalized form, see Attribute/property normalization).
r2.getTraitNS(null, "fill")
も "red"
を返す(あるいは等価な正規化された形式の値を返す。
属性/プロパティの正規化
を見よ)。
r2.getTraitNS(null, "fill") returns "red" (or an equivalent normalized form, see Attribute/property normalization).
r1.getAttributeNS(null, "fill")
は ""
を返す。
r1.getAttributeNS(null, "fill") returns "".
r2.getAttributeNS(null, "fill")
は "inherit"
を返す。
r2.getAttributeNS(null, "fill") returns "inherit".
trait のアニメーションも underlying XML 属性または
プロパティ
への適用により可能である。
trait のアニメーション値へのアクセスには、
TraitAccess
インターフェースの
getPresentationTrait
が(他の類似する名前の presentation trait ゲッタメソッドも同様に)利用できる。
Traits may also be animated, by animating the underlying XML attribute or property. To access the animated value of a trait, the getPresentationTrait, along with the other similarly named presentation trait getter methods on the TraitAccess interface, can be used.
SVG uDOM は DOM Level 2 Events の EventTarget インターフェースを利用して文書ノードへのイベントリスナの登録と除去をサポートする。 The SVG uDOM utilizes DOM Level 2 Events, using the EventTarget interface, to support the ability to add and remove event listeners to nodes in a document.
class MyEventListener implements EventListener { public void handleEvent(Event evt) { // ここに必要なコードを置く } } ... // リスナを作成 EventListener listen1 = new MyEventListener(); // 浮上過程の click イベントをリッスン SVGElement myRect = (SVGElement)document.getElementById("myRect"); myRect.addEventListener("click", listen1, false); ... // click リスナを除去 myRect.removeEventListener("click", listen1, false);
ElementTimeControl インターフェースのメソッドを用いて アニメーション要素 の始動と停止を行える。 Animation elements can be started and stopped using the methods available on the ElementTimeControl interface.
var animateColor = document.getElementById("myAnimation");
// 2.5 秒後にアニメーションを始動させる。
animateColor.beginElementAt(2.5);
ElementTimeControl と SVGTimedElement インターフェースを組み合わせて audio, video, animation 要素などのマルチメディア要素を制御できる。 一般的な制御の一部とアクセスするインターフェースメソッドを下に示す: Control of multimedia elements, such as the 'audio', 'video', and 'animation' elements is available through a combination of the ElementTimeControl and SVGTimedElement interfaces. Some common controls, and the interface methods to access them, are listed below:
SVG 1.2 Tiny は時間コンテナ要素に対する(早送りや早戻しなどの)再生速度の制御は定めていないことに注意。 この機能性は将来版に含められるものと見込まれている。 Note that SVG 1.2 Tiny does not define controlling the rate of playback (such as fast-forward or reverse) for time container elements. This functionality may be included in a future specification.
SVG uDOM の Java パッケージ名は来るべき SVG 1.2 Full DOM のものと同じである( org.w3c.dom, org.w3c.dom.events, org.w3c.dom.svg, 等々)。 これにより、特色機能を SVG uDOM に制限した Java アプリケーションでも SVG 1.2 Full DOM をサポートする実装で実行可能になる。 The SVG uDOM uses the same Java package names as the upcoming SVG 1.2 Full DOM (e.g. org.w3c.dom, org.w3c.dom.events, org.w3c.dom.svg). This allows Java applications which restrict themselves to the features in the SVG uDOM to also run in implementations that support the SVG 1.2 Full DOM.
この節と以下のすべては正式なものになる。 適合 SVG ビューアは、インターフェースが明示的にこの規則の例外を認めている部分以外は、 SVG uDOM で定義されたすべてのインターフェースのすべての内容, 属性, メソッドをサポートしなければならない。 This section and all the following are normative. Conforming SVG Viewers must support all constants, attributes and methods of all the interfaces defined in the SVG uDOM unless an interface explicitly allows for exceptions to this rule.
SVG uDOM では IDL の float
値を IEEE-754 単精度浮動小数点値
[IEEE-754]
で表現する。
非有限数値 — NaN ( Not a Number )値のセットと正と負の無限大 — これらの値は uDOM では決して用いられない。
従って、処理または属性について特別に注釈が記されている場合を除き、非有限値が処理の引数として渡されたり, float
型の属性に代入されたり, 非有限値を含む浮動小数点値の配列が sequence<float>
型の処理引数や属性に渡された場合、エラーコード NOT_SUPPORTED_ERR の
DOMException
が投げられなければならない。
The SVG uDOM uses IEEE-754 single precision floating point values to represent float values in the IDL [IEEE-754]. While such values support a number of non-finite values — a set of NaN (Not a Number) values and positive & negative infinity — these values are never used by the uDOM. Thus, unless otherwise specified in the prose for an operation or attribute, a DOMException with error code NOT_SUPPORTED_ERR must be thrown if a non-finite value is passed as an operation argument, or assigned to an attribute, whose type is float, or if a list of floating point values containing a non-finite value is passed as an operation argument, or assigned to an attribute, whose type is sequence<float>.
加えて、 uDOM のすべての処理と属性は正と負のゼロを区別しない。
負のゼロが float
または sequence<float>
型の処理引数に渡されたりその型の属性に代入される際には正のゼロとして扱わなければならない。
In addition, none of the operations or attributes in the uDOM distinguish between positive and negative zero. A negative zero must be treated as a positive zero when passed as an operation argument, or assigned to an attribute, whose type is float or sequence<float>.
uDOM の処理および属性は決して非有限値または負のゼロ値を返さない。 Operations and attributes in the uDOM will never return a non-finite or negative zero value from an operation or attribute.
uDOM を実装するビューアは、
getAttributeNS
メソッド, 種々の trait ゲッタメソッド(
getTrait
,
getTraitNS
,
getFloatTrait
, 等々), trait 表示値ゲッタメソッド(
getPresentationTrait
,
getPresentationTraitNS
,
getFloatPresentationTrait
, 等々)から
正規化された属性値
([DOM3], 1.4 節)
を返してもよい。
行い得る属性の正規化の一覧を以下に挙げる:
【表示値( presentation value )= アニメーション値(表示中の値)と思われる】
A viewer implementing the uDOM is allowed to return normalized attribute values ([DOM3], section 1.4) from getAttributeNS and the various trait getter methods (getTrait, getTraitNS, getFloatTrait, etc.) and trait presentation value getter methods (getPresentationTrait, getPresentationTraitNS, getFloatPresentationTrait, etc.). The following is a list of possible attribute normalizations:
SVG uDOM による要素のテキスト内容へのアクセスには2通りの方法がある。
TraitAccess
インターフェースを通したテキストへのアクセスはすべての
SVGElement
で利用できる。
これは SVG Tiny 1.1 uDOM でも利用できていたもので(
JSR 226
仕様
[JSR226]
で利用されている)下位互換性を保つため、依然利用できる。
SVG Tiny 1.2 uDOM の仕様では、より汎用的なテキストアクセスの仕組みとして
Node
インターフェースに
textContent
属性を導入する。
In the SVG uDOM, there are two alternative ways to access an element's textual content. Text access via the TraitAccess interface is available on all SVGElements. This was available in the SVG Tiny 1.1 uDOM (used in the JSR 226 specification [JSR226]) and is still available in order to keep backward compability. The SVG Tiny 1.2 uDOM specification introduces the textContent attribute on the Node interface as a more generic text access mechanism.
要素のテキスト文字列値へ trait を通してアクセスするには、その要素の
getTrait()
または
setTrait()
を呼び出す際に、引数の取得または設定する trait 名を #text
にする。
例えば、 MyTextElement.setTrait("#text", "Hello");
など。
テキスト内容要素
および
desc,
title,
metadata
要素は #text
の仕組みを通したテキストへのアクセスをサポートしなければならない。
この仕様で定義されている他の要素(
要素
一覧を見よ)では、テキストへのアクセスはサポートされない。
また、実装はそれらの要素のテキストを無視すべきである。
To access or set the text string value for an element via traits you invoke getTrait() or setTrait() on that element and pass #text as the name of the trait you want to get or set. For example, MyTextElement.setTrait("#text", "Hello"); Text access via the #text mechanism must be supported on text content, 'desc', 'title' and 'metadata' elements. Text access to other elements defined within this specification (see list of elements) is not supported and an implementation should ignore any text on these elements.
#text
の仕組みを通したテキスト内容の取得と設定の結果は
textContent
属性を用いた場合と同一になる。
従って利用者は、要素からテキスト文字列を取得して設定し直した場合に子の
tspan
要素(すなわち、テキスト内容を取得する要素の子の
tspan
要素)のスタイル付けが失われることに留意すべきである。
The result of getting and setting text content via the #text mechanism is exactly the same as when using the textContent attribute. Therefore the user should be aware of the fact that styling by child 'tspan' elements (i.e. 'tspan' elements that are children of the element which text content is retrieved) will be lost if a text string is retrieved from an element and then set back again.
#text
trait は
JSR 226
仕様 [JSR226]
との互換性のために含められている。
内容製作者は JSR 226 実装との互換性が要求されていない所では、適用性がより汎用的かつ DOM Level 3 Core
[DOM3]
との互換性サポートもより良い
textContent
を代わりに用いることが推奨される。
The #text trait is included for compatibility with the JSR 226 specification [JSR226]. It is recommended that where compatibility with JSR 226 implementations is not required content developers use textContent instead as it is more generally applicable and supports better compatibility with DOM Level 3 Core [DOM3].
DOM Level 3 Core
([DOM3], 1.4 節)
の
Fundamental Interfaces: Core Module
節で定められるように、DOM 操作により生じる例外。
SVG uDOM は DOM Level 3 Core のサブセットなので、
INUSE_ATTRIBUTE_ERR
や
VALIDATION_ERR
など、この例外に定められた例外コードには決して生じないものもある。
しかしながら、 uDOM と 完全な DOM Level 3 Core の両方をサポートする実装も可能にするため、これらの例外コードは取り除かれていない。
An exception that occurred due to a DOM operation, as defined in the Fundamental Interfaces: Core Module section of DOM Level 3 Core ([DOM3], section 1.4). Note that since the SVG uDOM is a subset of DOM Level 3 Core, some of the exception codes defined for this exception may never occur (such as INUSE_ATTRIBUTE_ERR, and VALIDATION_ERR). However, in the interest of facilitating implementations that support both the uDOM and the complete DOM Level 3 Core, none of the exception codes are removed.
exception DOMException { unsigned short code; }; // ExceptionCode const unsigned short INDEX_SIZE_ERR = 1; const unsigned short DOMSTRING_SIZE_ERR = 2; const unsigned short HIERARCHY_REQUEST_ERR = 3; const unsigned short WRONG_DOCUMENT_ERR = 4; const unsigned short INVALID_CHARACTER_ERR = 5; const unsigned short NO_DATA_ALLOWED_ERR = 6; const unsigned short NO_MODIFICATION_ALLOWED_ERR = 7; const unsigned short NOT_FOUND_ERR = 8; const unsigned short NOT_SUPPORTED_ERR = 9; const unsigned short INUSE_ATTRIBUTE_ERR = 10; const unsigned short INVALID_STATE_ERR = 11; const unsigned short SYNTAX_ERR = 12; const unsigned short INVALID_MODIFICATION_ERR = 13; const unsigned short NAMESPACE_ERR = 14; const unsigned short INVALID_ACCESS_ERR = 15; const unsigned short VALIDATION_ERR = 16; const unsigned short TYPE_MISMATCH_ERR = 17;
INDEX_SIZE_ERR
参照。
DOMSTRING_SIZE_ERR
参照。
HIERARCHY_REQUEST_ERR
参照。
WRONG_DOCUMENT_ERR
参照。
INVALID_CHARACTER_ERR
参照。
NO_DATA_ALLOWED_ERR
参照。
NO_MODIFICATION_ALLOWED_ERR
参照。
NOT_FOUND_ERR
参照。
NOT_SUPPORTED_ERR
参照。
INUSE_ATTRIBUTE_ERR
参照。
INVALID_STATE_ERR
参照。
SYNTAX_ERR
参照。
INVALID_MODIFICATION_ERR
参照。
NAMESPACE_ERR
参照。
INVALID_ACCESS_ERR
参照。
VALIDATION_ERR
参照。
TYPE_MISMATCH_ERR
参照。
Node インターフェースは SVG 文書木の一般ノードを記述する。 The Node interface describes generic nodes in an SVG document tree.
このインターフェースは DOM Level 3 Core ([DOM3], 1.4 節) で定義されている Node インターフェースのサブセットである。 uDOM でサポートされなければならない Node タイプは Element ノードと Document ノードになる。 This interface is a subset of the Node interface defined in DOM Level 3 Core ([DOM3], section 1.4). Node types that must be supported in the uDOM are Element nodes and Document nodes.
このサブセットは NodeType と DocumentPosition 定義グループをサポートしない。 nodeType フィールドと compareDocumentPosition メソッドが、サブセット化されたインターフェースのメンバではないので。 This subset does not support the NodeType and DocumentPosition definition groups, since the nodeType field and the compareDocumentPosition method are not members of the subsetted interface.
textContent
については、このサブセットには Text ノードを表現するインターフェースが存在しないので、テキスト設定時にも Text ノードの作成は要求されない。
しかしながら
textContent
は、 DOM Level 3 Core の
textContent
の定義に従う Text ノードが実際に作成されたかのようにふるまわなければならない。
Concerning textContent, there is no requirement to create a Text node on setting since this subset has no interface representing Text nodes. However, the behaviour of textContent must be as if the Text node described in the the definition of textContent had indeed been created.
SVG 仕様で定義された要素のテキスト内容へアクセスする別の方法には
#text
trait
の利用がある。
An alternate way of accessing text content on elements defined within the SVG specification is with the use of the #text trait.
interface Node { readonly attribute DOMString namespaceURI; readonly attribute DOMString localName; readonly attribute Node parentNode; readonly attribute Document ownerDocument; attribute DOMString textContent; Node appendChild(in Node newChild) raises(DOMException); Node insertBefore(in Node newChild, in Node refChild) raises(DOMException); Node removeChild(in Node oldChild) raises(DOMException); Node cloneNode(in boolean deep); };
namespaceURI
参照。
localName
参照。
parentNode
参照。
ownerDocument
参照。
textContent
参照。
appendChild
参照。
insertBefore
参照。
removeChild
参照。
cloneNode
参照。
Element インターフェースは SVG 文書木の一般要素を記述する。 The Element interface describes generic elements in an SVG document tree.
このインターフェースは DOM Level 3 Core ([DOM3], 1.4 節) で定義されている Element インターフェースのサブセットである。 This interface is a subset of the Element interface defined in DOM Level 3 Core ([DOM3], section 1.4)
setAttributeNS
に関しては、 prefix
フィールドも Attr
インターフェースもサポートされていないので、 prefix
を考慮に入れることは要求されない。
Concerning setAttributeNS, there is no requirement to take the prefix into account since neither the prefix field nor the Attr interface are supported.
interface Element : Node, ElementTraversal { DOMString getAttributeNS(in DOMString namespaceURI, in DOMString localName) raises(DOMException); void setAttributeNS(in DOMString namespaceURI, in DOMString qualifiedName, in DOMString value) raises(DOMException); DOMString getAttribute(in DOMString name); void setAttribute(in DOMString name, in DOMString value) raises(DOMException); };
getAttributeNS
参照。
setAttributeNS
参照。
getAttribute
参照。
setAttribute
参照。
Document インターフェースは XML 文書を表現する。 The Document interface represents XML documents.
このインターフェースは DOM Level 3 Core ([DOM3], 1.4 節) で定義されている Document インターフェースのサブセットである。 This interface is a subset of the Document interface defined in DOM Level 3 Core ([DOM3], section 1.4).
interface Document : Node { Element createElementNS(in DOMString namespaceURI, in DOMString qualifiedName) raises(DOMException); readonly attribute Element documentElement; Element getElementById(in DOMString elementId); };
documentElement
参照。
createElementNS
参照。
getElementById
参照。
このインターフェースは、 uDOM 木内の要素を辿る手段を提供する。 SVG Tiny uDOM は文字データノードを公開しないのでこれが必要になる。 外部名前空間の要素も含め、 SVG Tiny 文書木内の各要素はこのインターフェースを実装する。 このインターフェースの正式な定義は ElementTraversal specification [ET] を参照のこと。 単に情報のために下に再掲する。 This interface provides a way to traverse elements in the uDOM tree. It is needed mainly because SVG Tiny uDOM does not expose character data nodes. Each element in the SVG Tiny document tree implements this interface, including elements in foreign namespaces. For the normative definition of this interface see the ElementTraversal specification [ET]; it is only repeated informatively below.
interface ElementTraversal { readonly attribute Element firstElementChild; readonly attribute Element lastElementChild; readonly attribute Element nextElementSibling; readonly attribute Element previousElementSibling; readonly attribute unsigned long childElementCount; };
firstElementChild
参照。
【要素( nodeType 1 のノード)の(文書内の出現順で)最初の(直接の)子要素を返す。無ければ null を返す。】
lastElementChild
参照。
【最後の子要素を返す。無ければ null を返す。】
nextElementSibling
参照。
【次の要素を返す。無ければ null を返す。】
previousElementSibling
参照。
【前の要素を返す。無ければ null を返す。】
childElementCount
参照。
【子要素の個数を返す。】
Location オブジェクトは文書のアドレス表現を提供する。 Location objects provide a representation of their document's address.
interface Location { void assign(in DOMString iri); void reload(); };
このメソッドが呼び出された際には UA は与えられた
IRI
へ移動しなければならない。
追跡の結果は
target
属性を '_replace' に設定した
a
のハイパーリンクによる移動と同一でなければならない。
違いは
a
のハイパーリンクが利用者との対話により発動されるのに対し、
assign
はスクリプトから発動される所になる。
現在の文書ロケーションは
AbstractView.document
フィールドが指す
Document
オブジェクトの IRI である。
相対
IRI 参照
は現在の文書の基底 IRI を基に解決される。
基底 IRI が現在の文書のそれと異なる場合、現在の文書は破棄され, 指定された IRI の文書の読み込みとパースが開始される。
これにより新規の文書の読み込みが生じた場合、時間軸は再始動され, load イベントも新たに発火される。
注記: HTTP においては
pragma:no-cache
([RFC2616], 14.32 節)
は発行されず、キャッシュが存在する場合、サーバからの新規複製は強制されない。
When this method is invoked, the user agent must navigate to the given IRI. The result of the traversal must be identical to the traversal caused by an 'a' hyperlink with the 'target' attribute set to '_replace'. The difference is that the 'a' hyperlink is activated on user interaction but assign is activated from script. The current document location is the IRI of the Document object pointed to by the AbstractView.document field. Relative IRI references are resolved based on the base IRI of the current document. If the base IRI differs from that of the current document, the current document is discarded, and loading and parsing of the document at the specified IRI then begins. If the previous step resulted in loading of a new document, the timeline is restarted and a new load event is fired. Note: For HTTP, a pragma:no-cache ([RFC2616], section 14.32) is not issued and thus a fresh copy from the server is not forced if there is a cache.
このメソッドが呼び出される際は UA は
Location
で特定されるリソースの再読み込みを強制される。
現在の文書ロケーションは
AbstractView.document
フィールドが指す
Document
オブジェクトの
IRI
になる。
When this method is invoked, the user agent is forced to reload the resource identified by the Location. The current document location is the IRI of the Document object pointed to by the AbstractView.document field.
これは事実上の標準として多数のブラウザが実装している Window インターフェースのサブセットになる。 この分野で進行中の [WINDOW, HTML5] が書かれた時点現在での標準化の努力については Window Object 1.0 と HTML 5 の default view を参照のこと。 This is a subset of the de facto standard Window interface that many browsers implement. See Window Object 1.0 and The default view in HTML 5 for ongoing standardization efforts in this area at the time of writing [WINDOW, HTML5].
Window
インターフェースは文書の
デフォルトビュー
([DOM2VIEWS], 1.1 節)
を表現するオブジェクトに実装されなければならない。
このオブジェクトは
AbstractView
も実装する。
ECMAScript 言語束縛においては、グローバルスクリプトオブジェクトが
Window
を実装する。
文書の
Window
オブジェクトは
DocumentView::defaultView
を通してでも取得できる。
The Window interface must be implemented by the object that represents the default view of the document ([DOM2VIEWS], section 1.1). This object also implements AbstractView. Thus, in the ECMAScript language binding, the global script object implements Window. The Window object for a document can also be obtained through DocumentView::defaultView.
interface Window { readonly attribute Window parent; readonly attribute Location location; };
この文書のデフォルトビューの親ビューになる
Window
オブジェクト。
Window
に親が存在しない場合(文書がビューアでトップレベルの文書として表示されているときなど)、この属性の値は null
になる。
The Window object that is the parent view of this document's default view. If the Window has no notion of parent (e.g. if the document is displayed as the top level document in a viewer), then the value of this attribute is null.
Window オブジェクトのアクティブな文書を指す Location オブジェクト。 The Location object that is for that Window object's active document.
SVG Tiny 1.2 では AbstractView と DocumentView インターフェース [DOM2VIEWS] を含む DOM Level 2 Views の完全なサポートが要求される。 SVG Tiny 1.2 requires complete DOM Level 2 Views support, which includes the AbstractView and DocumentView interfaces [DOM2VIEWS].
SVG Tiny 1.2 uDOM は文書のデフォルトビュー以外のビューへのアクセスは提供しない。
デフォルトビューへは
DocumentView::defaultView
を通してアクセスできる。
デフォルトビューには
SVGGlobal
インターフェースの実装も要求されることに注意。
ECMAScript 言語束縛においては、グローバルスクリプトオブジェクトがデフォルトビューも表現するオブジェクトでなければならない。
The SVG Tiny 1.2 uDOM does not provide access to any views of the document other than the default view. The default view is accessible through DocumentView::defaultView. Note that the default view is required to also implement the SVGGlobal interface. In the ECMAScript language binding, the global script object must also be the object that represents the default view.
このインターフェースは DOM Level 2 Views ([DOM2VIEWS], 1.2 節) の AbstractView インターフェースの複製であり、文書の デフォルトビュー を表現するオブジェクトで実装されなければならない。 ECMAScript 言語束縛においては、グローバルスクリプトオブジェクトがこのインターフェースを実装しなければならない。 This interface is a copy of the AbstractView interface from DOM Level 2 Views ([DOM2VIEWS], section 1.2), and must be implemented by the object that represents the the default view of the document. In the ECMAScript language binding, the global script object must implement this interface.
interface AbstractView { readonly attribute DocumentView document; };
AbstractView::document
を参照のこと。
The document that this SVGGlobal is associated with, as a DocumentView. Note that this object is also a Document. See AbstractView::document in DOM Level 2 Views ([DOM2VIEWS], section 1.2).
このインターフェースは DOM Level 2 Views ([DOM2VIEWS], 1.2 節) の DocumentView インターフェースの複製であり、すべての Document オブジェクトで実装されなければならない。 This interface is a copy of the DocumentView interface from DOM Level 2 Views ([DOM2VIEWS], section 1.2), and must be implemented by all Document objects.
interface DocumentView { readonly attribute AbstractView defaultView; };
null
。
この属性の値は文書に結びつけられた
SVGGlobal
オブジェクトになる。
DOM Level 2 Views
([DOM2VIEWS], 1.2 節)
の
DocumentView::defaultView
を参照のこと。
The default AbstractView for this Document, or null if none available. The value of this attribute is the SVGGlobal object associated with the document. See DocumentView::defaultView in DOM Level 2 Views ([DOM2VIEWS], section 1.2).
EventTarget インターフェースはイベントをリスナへ通知し得るオブジェクトに実装され、 EventListener オブジェクトの登録と除去を可能にする。 The EventTarget interface is implemented by objects that can notify listeners about events and allows registration and removal of EventListener objects.
このインターフェースは DOM Level 2 Events ([DOM2EVENTS], 1.3.1 節) で定義されている EventTarget インターフェースのサブセットである。 This interface is a subset of the EventTarget interface defined in DOM Level 2 Events ([DOM2EVENTS], section 1.3.1).
SVG Tiny 1.2 UA には捕獲過程のサポートは要求されておらず、適合 SVG Tiny 1.2 内容はそれを利用してはならないことに注意。
捕獲過程をサポートしない SVG Tiny UA においては、捕獲過程のイベント処理が指定されていた場合、 UA は addEventListener
が呼び出されなかったかのように無視しなければならない。
(詳細は
イベントフロー
を見よ。)
Please note that SVG Tiny 1.2 user agents are not required to support the capture phase, and conformant SVG Tiny 1.2 content must not make use of it. If an attempt to specify event operations on the capture phase is made an SVG Tiny user agent that does not support it must ignore them as if addEventListener had not been called. (See Event flow for details.)
DOM Level 2 Events による EventTarget の定義から示されるように、このインターフェースはすべての Node に実装される。 As indicated in the DOM Level 2 Events definition for EventTarget, this interface is implemented by all Nodes.
SVG イベントフローの説明や、イベントの標的, イベントの現在の標的, 浮上, 捕獲の意味する所は、 DOM Events Level 2 仕様 [DOM2EVENTS] または XML Events [XML-EVENTS] 仕様概要を参照のこと。 Refer to the DOM Events Level 2 specification [DOM2EVENTS] or the XML Events [XML-EVENTS] specification introduction for an explanation of the SVG event flow and the meaning of event targets, event current target, bubble and capture.
interface EventTarget { void addEventListener(in DOMString type, in EventListener listener, in boolean useCapture); void removeEventListener(in DOMString type, in EventListener listener, in boolean useCapture); };
addEventListener
参照。
removeEventListener
参照。
EventListener
インターフェースはイベント処理のためにスクリプトにより実装される。
このインターフェースは ECMAScript においては Function オブジェクトを用いて(またはオブジェクトの handleEvent
プロパティを用いて)実装できる。
Java においてはインターフェースを直接実装する。
しかる後、
EventTarget::addEventListener
を用いて
EventListener
オブジェクトをリスナとして登録できる。
The EventListener interface is implemented by script to handle an event. The interface can be implemented in ECMAScript by using a Function object (or by using an object with a handleEvent property), and in Java by implementing the interface directly. The EventListener object can then be registered as a listener using EventTarget::addEventListener.
このインターフェースは DOM Level 2 Events ([DOM2EVENTS], 1.3.1 節) で定義されている EventListener インターフェースと同一である。 This interface is identical to the EventListener interface defined in DOM Level 2 Events ([DOM2EVENTS], section 1.3.1).
interface EventListener { void handleEvent(in Event evt); };
handleEvent
参照。
Event インターフェースはイベントの文脈情報をイベント処理を行うハンドラに提供するために利用される。 The Event interface is used to provide contextual information about an event to the handler processing the event.
このインターフェースは
DOM Level 2 Events
([DOM2EVENTS, 1.4 節)
で定義されている
Event
インターフェースのサブセットに
defaultPrevented
属性を追加したものである。
このサブセットは PhaseType 定義グループをサポートしない。
This interface is a subset of the Event interface defined in DOM Level 2 Events ([DOM2EVENTS, section 1.4), with one addition: the defaultPrevented attribute. This subset does not support the PhaseType definition group.
サポートされているイベント型については、対話性の章の サポートされるイベントの完全な一覧 の節を見よ。 For a list of supported event types see the Complete list of supported events section of the Interactivity chapter.
interface Event { readonly attribute EventTarget target; readonly attribute EventTarget currentTarget; readonly attribute DOMString type; readonly attribute boolean cancelable; readonly attribute boolean defaultPrevented; void stopPropagation(); void preventDefault(); };
target
参照。
currentTarget
参照。
type
参照。
cancelable
参照。
Event.preventDefault()
が呼ばれたかどうかの指示に用いられる。
Used to indicate whether Event.preventDefault() has been called for this event.
stopPropagation
参照。
preventDefault
参照。
ポインタ装置のイベント特有の文脈情報を提供する Event 。 Event that provides specific contextual information associated with pointing device events.
MouseEvent になる Event 型は click, mousedown, mouseup, mouseover, mousemove, mouseout 。 Event types that are MouseEvents: click, mousedown, mouseup, mouseover, mousemove, mouseout.
このインターフェースは DOM Level 2 Events ([DOM2EVENTS, 1.6.2 節) で定義されている MouseEvent インターフェースのサブセットになる。 This interface is a subset of the MouseEvent interface defined in DOM Level 2 Events ([DOM2EVENTS, section 1.6.2).
interface MouseEvent : UIEvent { readonly attribute long screenX; readonly attribute long screenY; readonly attribute long clientX; readonly attribute long clientY; readonly attribute unsigned short button; };
マウスホイールイベント特有の文脈情報を提供する Event 。 Event that provides specific contextual information associated with mouse wheel events.
MouseWheelEvent になる Event 型は: mousewheel 。 Event types that are MouseWheelEvents: mousewheel.
このインターフェースは DOM Level 3 Events ([DOM3EVENTS], 1.7.6 節) で定義されている MouseWheelEvent インターフェースのサブセットになり、 DOM Level 2 Events ([DOM2EVENTS], 1.6.2 節) で定義されている MouseEvent インターフェースの属性を継承する。 This interface is a subset of the MouseWheelEvent interface defined in DOM Level 3 Events ([DOM3EVENTS], section 1.7.6), and inherits attributes from the MouseEvent interface defined in DOM Level 2 Events ([DOM2EVENTS], section 1.6.2).
interface MouseWheelEvent : MouseEvent { readonly attribute long wheelDelta; };
TextEvent
になる
Event
イベント型は:
textInput
。
Event type that is a TextEvent: textInput.
このインターフェースは DOM Level 3 Events ([DOM3EVENTS], 1.7.2 節) で定義されている TextEvent インターフェースのサブセットになる。 This interface is a subset of the TextEvent interface defined in DOM Level 3 Events ([DOM3EVENTS], section 1.7.2).
interface TextEvent : UIEvent { readonly attribute DOMString data; };
data
。
これは1個の Unicode 文字または空でない Unicode 文字
[UNICODE]
の連なりになる。
文字は
Unicode Normalization Forms
[UAX15]
に定義されている Unicode 正規化形式 NFC に正規化されるべきである。
この属性は null
や空文字列にはならない。
data holds the value of the characters generated by the character device. This may be a single Unicode character or a non-empty sequence of Unicode characters [UNICODE]. Characters should be normalized to Unicode normalization form NFC, defined in Unicode Normalization Forms [UAX15]. This attribute will not be null or contain an empty string.
キーボード特有の文脈情報を提供する。 それぞれの KeyboardEvent は識別子を用いてキーを参照する。 Provides specific contextual information associated with keyboard devices. Each KeyboardEvent references a key using an identifier.
KeyboardEvents
になる
Event
型は:
keydown
,
keyup
。
Event types that are KeyboardEvents: keydown, keyup.
このインターフェースは DOM Level 3 Events ([DOM3EVENTS], 1.7.3 節) で定義されている KeyboardEvent インターフェースのサブセットになる。 This interface is a subset of the KeyboardEvent interface defined in DOM Level 3 Events ([DOM3EVENTS], section 1.7.3).
interface KeyboardEvent : UIEvent { readonly attribute DOMString keyIdentifier; };
keyIdentifier
はキーの識別子を保持する。
キー識別子は下の
キー識別子集合
に定義される。
実装は特定できないキーについてはキー識別子 "Unidentified"
を用いなければならない。
keyIdentifier holds the identifier of the key. The key identifiers are defined in the Key identifiers set, below. Implementations that are unable to identify a key must use the key identifier "Unidentified".
これは DOM Level 3 Events, ([DOM3EVENTS], A.2 節) で定義されている キー識別子 のサブセットであり、現在携帯機器に実装されている機能のスナップショットを定める。 This is a subset of the key identifiers defined in DOM Level 3 Events, and defines a snapshot of functionality currently implemented on mobile devices ([DOM3EVENTS], section A.2).
この節に含まれるキー識別子の一覧は完全なものではなく、入力装置が独自のキー識別子を定義する必要も生じ得る。 DOM Level 3 Events ではどのキー識別子を用いるかを決定するアルゴリズムが定義されることが予期されている。 将来版の SVG 仕様ではキーボードイベントとキー識別子の確実な扱いについては DOM Level 3 Events を待つことになる。 The list of key identifiers contained in this section is not exhaustive and input devices may have to define their own key identifiers. It is expected that DOM Level 3 Events will define an algorithm to determine which key identifier to use. Future SVG specifications will defer to DOM Level 3 Events for a definitive treatment of keyboard events and key identifiers.
"U+0000"
, "U+0001"
, ..., "U+10FFFF"
は Unicode
[UNICODE]
を基にしたキー識別子になる。
UA はキー識別の目的においては内容に含まれる文字列リテラルを Unicode 符号位置として扱ってもよい。
"U+0000", "U+0001", ..., "U+10FFFF" are Unicode-based key identifiers [UNICODE]. A user agent may treat string literal characters in content as Unicode codepoints for the purpose of key identification.
UIEvent インターフェースは UI イベントに関する文脈情報を提供する。 The UIEvent interface provides specific contextual information associated with user interface events.
UIEvents
になる
Event
型は:
DOMFocusIn
,
DOMFocusOut
,
DOMActivate
,
MouseEvent,
TextEvent,
KeyboardEvent
。
Event types that are UIEvents: DOMFocusIn, DOMFocusOut, DOMActivate, MouseEvent, TextEvent, KeyboardEvent,
このインターフェースは DOM Level 2 Events ([DOM2EVENTS, 1.6.1 節) で定義されている UIEvent インターフェースのサブセットになる。 This interface is a subset of the UIEvent interface defined in DOM Level 2 Events ([DOM2EVENTS, section 1.6.1).
interface UIEvent : Event { readonly attribute long detail; };
detail
参照。
ここでの progress イベントは Progress Events 1.0 [PROGRESSEVENTS] で定義されているもののサブセットになるべく定められている。 The progress events defined here are intended to be a subset of those defined in Progress Events 1.0 [PROGRESSEVENTS].
ラスター画像, 動画, 複雑な SVG 内容などの多くのリソースは相当量のダウンロードを要する。 文書作成者は内容表示やアニメーションの開始をファイルの内容全体がダウンロードされるまで遅延させることを望む場合もあれば、ビューアがダウンロードの進捗状況を示すことを望む場合もある(例えば読み込みの進捗状況のスクリーン表示)。 Many resources, such as raster images, movies and complex SVG content can take a substantial amount of time to download. In some use cases the author would prefer to delay the display of content or the beginning of an animation until the entire content of a file has been downloaded. In other cases, the author may wish to give the viewer some feedback that a download is in progress (e.g. a loading progress screen).
ProgressEvent は UA による xlink:href 属性から参照されるリソース(外部)読み込みの進捗において生じる。 The ProgressEvent occurs when the user agent makes progress loading a resource (external) referenced by an 'xlink:href' attribute.
UA は読み込み処理の開始時に(リソースへのアクセスの直前に)
ProgressEvent
を配送しなければならない。
このイベントの型は
loadstart
になる。
The user agent must dispatch a ProgressEvent at the beginning of a load operation (i.e. just before starting to access the resource). This event is of type loadstart.
UA は読み込み処理の完了時に(読み込みが完了しリソースの描画準備が整い次第)
ProgressEvent
を配送しなければならない。
このイベントの型は
loadend
になる。
The user agent must dispatch a ProgressEvent at the end of a load operation (i.e. after load is complete and the user agent is ready to render the corresponding resource). This event is of type loadend.
UA は
loadstart
イベントと
loadend
イベントの間に
ProgressEvent
を配送してもよい。
それらのイベントの型は
progress
になる。
The user agent may dispatch ProgressEvents between the loadstart event and the loadend events. Such events are of type progress.
ProgressEvents
になる
Event
型は:
progress
,
loadstart
,
loadend
。
Event types that are ProgressEvents: progress, loadstart, loadend.
interface ProgressEvent : Event { readonly attribute boolean lengthComputable; readonly attribute unsigned long loaded; readonly attribute unsigned long total; };
loadstart
と
loadend
イベントでは無視される。
Specifies the number of bytes downloaded since the beginning of the download. This value is ignored for a loadstart or loadend event.
progress
イベントでは予期されている全バイト数を指定すべきである。
Specifies the expected total number of bytes expected in a load operation. For a progress event, it should specify the total number of bytes expected.
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" version="1.2" baseProfile="tiny" width="300" height="430"> <script><![CDATA[ function showImage(imageHref) { var image = document.getElementById('myImage'); image.setTraitNS("http://www.w3.org/1999/xlink", "href", imageHref); } function imageLoadStart(evt) { var progressBar = document.getElementById('progressBar'); var loadingAnimation = document.getElementById('loadingAnimation'); progressBar.setFloatTrait("width", 0); loadingAnimation.beginElement(); } function imageLoadProgress(evt) { if (evt.lengthComputable) { var progressBar = document.getElementById('progressBar'); progressBar.setFloatTrait("width", 100 * (evt.loaded / evt.total)); progressBar.setTrait("display", "inline"); } } function imageLoadComplete(evt) { var progressBar = document.getElementById('progressBar'); var loadingAnimation = document.getElementById('loadingAnimation'); progressBar.setTrait("display", "none"); loadingAnimation.endElement(); } ]]></script> <image xml:id="myImage" xlink:href="imageA.png" width="300" height="400"> <handler ev:event="loadstart"> imageLoadStart(evt); </handler> <handler ev:event="progress"> imageLoadProgress(evt); </handler> <handler ev:event="loadend"> imageLoadComplete(evt); </handler> </image> <rect rx="4" x="50" y="400" width="200" height="30" cursor="pointer"> <handler ev:event="click"> showImage('imageB.png'); </handler> </rect> <text x="150" y="420" font-size="15" fill="white" text-anchor="middle" text-decoration="underline" pointer-events="none"> Load other image </text> <g display="none"> <rect x="100" y="300" height="10" width="100" fill="black"/> <rect xml:id="progressBar" x="100" y="300" width="50" height="10" fill="lime"/> </g> <text x="150" y="330" font-size="15" text-anchor="middle" display="none"> Loading... <animate xml:id="loadingAnimation" attributeName="display" begin="indefinite" dur="2s" repeatDur="indefinite" calcMode="discrete" values="inline; none"/> </text> </svg>
SMIL API からサブセット化された単一のインターフェースを含む。 Contains a single subsetted interface from the SMIL APIs.
このインターフェースはアニメーションのふるまいを定義する要素に共通の、 SMIL ( timed 要素 と svg 要素)と互換性のあるメソッドを定義する。 This interface defines common methods for elements which define animation behaviors compatible with SMIL (timed elements and the 'svg' element).
このインターフェースは SMIL Animation [SMILANIM] で定義されている ElementTimeControl インターフェースのサブセットになる。 This interface is a subset of the ElementTimeControl interface defined in SMIL Animation [SMILANIM].
注記:一時停止機能については SVGTimedElement インターフェースを見よ。 Note: See the SVGTimedElement interface for pause functionality.
interface ElementTimeControl { void beginElementAt(in float offset); void beginElement(); void endElementAt(in float offset); void endElement(); };
in float offset | 要素開始への秒単位の時間差。 The offset in seconds at which to begin the element. |
beginElementAt(0)
と等価である。
Creates a begin instance time for the current time. The new instance time is added to the begin instance times list. This is equivalent to beginElementAt(0).
in float offset | 要素停止への秒単位の時間差。 The offset in seconds at which to end the element. |
endElementAt(0)
と等価である。
Creates an end instance time for the current time. The new instance time is added to the end instance times list. This is equivalent to endElementAt(0).
TimeEvent インターフェースは文書のアニメーションにより発火されたイベントの文脈情報を提供するために利用される。 これは SMIL Animation ([SMILANIM], 6.2 節) で定義されている TimeEvent interface のサブセットになる。 TimeEvent is an interface used to provide contextual information for events fired by animations in the document. It is a subset of the TimeEvent interface defined in SMIL Animation ([SMILANIM], section 6.2).
Event はすべての timed 要素 から発火される。 Event that is fired by all timed elements.
TimeEvents
になる
Event
型は
beginEvent
,
endEvent
,
repeatEvent
。
Event types that are TimeEvents: beginEvent, endEvent, repeatEvent.
interface TimeEvent : Event { readonly attribute long detail; };
beginEvent
と
endEvent
においては
detail
フィールドは利用されない。
repeatEvent
の
detail
フィールドには現在の反復回数が含まれる。
Specifies detailed information about the TimeEvent, the information depends on the type of event. For beginEvent and endEvent the detail field is not used. For repeatEvent the detail field contains the current repeat iteration.
投げられる例外のうち SVG 特有のもの。 An exception thrown for SVG-specific errors.
このインターフェースは SVG 1.1 ([SVG11], B.3 節) の SVGException インターフェースと同一である。 This interface is identical to SVGException interface defined in SVG 1.1 ([SVG11], section B.3).
exception SVGException { unsigned short code; }; // ExceptionCode const unsigned short SVG_WRONG_TYPE_ERR = 0; const unsigned short SVG_INVALID_VALUE_ERR = 1; const unsigned short SVG_MATRIX_NOT_INVERTABLE = 2;
interface SVGDocument : Document, EventTarget { };
このインターフェースは use 要素を表現する。 SVG 1.2 Tiny においては、このインターフェースには継承されるもの以外に追加のメソッドは存在しない。 これは他の SVG のプロファイルとアーキテクチャの一貫性を保つために含められている。 This interface represents the 'use' element. In SVG 1.2 Tiny this interface has no additional methods to those it inherits; it is included for architectural consistency with other profiles of SVG.
interface SVGUseElement : SVGLocatableElement { };
uDOM は各 use 要素の参照先の内容を SVGElementInstance オブジェクトの shadow 木 で表現する。 For each 'use' element, the uDOM represents the referenced content with a shadow tree of SVGElementInstance objects.
このインターフェースは SVG 1.1 ([SVG11], 5.17 節) で定義されている SVGElementInstance インターフェースのサブセットになる。 This interface is a subset of the SVGElementInstance interface defined in SVG 1.1 ([SVG11], section 5.17).
interface SVGElementInstance : EventTarget { readonly attribute SVGElement correspondingElement; readonly attribute SVGUseElement correspondingUseElement; };
correspondingElement
参照。
correspondingUseElement
参照。
下の例で、3つの
use
要素が同じ
rect
要素を参照している。
各
use
は異なる
fill
プロパティを持ち、利用される
rect
へ継承される。
その結果、3つの
rect
は異なる色の
fill
になる。
これら3つの
rect
のどれでも1つをクリックすると4番目の
rect
の色がクリックされたものと同じになる。
注意すべきは、参照先の
rect
が
defs
要素内で定義されていなかった場合、その
rect
がクリックされたときにスクリプトが例外を投げることである。
これは
currentTarget
属性が
correspondingUseElement
属性を持たない
SVGElement
を返すことになるからである。
In the example below, three 'use' elements use the same 'rect' element. Each 'use' has different 'fill' properties that are inherited down to the used 'rect'. The result is three 'rect' elements with different 'fill' colors. Clicking one of these three 'rect' elements will cause a fourth 'rect' to change color to match the clicked one. Worth noticing is that if the original 'rect' had not been in the 'defs' element the script would throw an exception when the original 'rect' is clicked. This is because the currentTarget attribute would return an SVGElement that doesn't have the correspondingUseElement attribute.
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" version="1.2" baseProfile="tiny" width="640" height="480" viewBox="0 0 640 480"> <defs> <rect xml:id="r1" width="90" height="65"/> </defs> <use xlink:href="#r1" x="50" y="200" fill="red"/> <use xlink:href="#r1" x="250" y="200" fill="blue"/> <use xlink:href="#r1" x="450" y="200" fill="green"/> <rect xml:id="r2" x="250" y="50" width="90" height="65"/> <ev:listener observer="r1" event="ev:click" handler="#handler"/> <handler xml:id="handler" type="application/ecmascript">changeColor(evt);</handler> <script type="application/ecmascript"> var target = document.getElementById("r2"); function changeColor(evt) { var useElement = evt.currentTarget.correspondingUseElement; target.setRGBColorTrait("fill", useElement.getRGBColorTrait("fill")); } </script> </svg>
このインターフェースは SVG 文書木の svg 要素を表現する。 This interface represents the 'svg' element in the SVG document tree.
uDOM 属性
currentScale
,
currentRotate
,
currentTranslate
は組み合わせられて、 SVG 文書の最も外側のレベル(すなわち
svg
要素の外側)に適用される UA 変換を形成する。
これらの値は「拡大縮小表示」が有効の場合(すなわち
zoomAndPan
属性が magnify に設定されている)、 UA 固有の UI により変更され得る。
UA 変換は次の行列の積により得られる:
The uDOM attributes currentScale, currentRotate and currentTranslate are combined to form a user agent transformation which is applied at the outermost level on the SVG document (i.e. outside the 'svg' element). Their values can potentially be modified through user agent specific UI, if "magnification" is enabled (i.e., 'zoomAndPan' attribute is set to magnify). User agent transformation can be obtained by multiplying the matrix
[currentScale 0 currentTranslate.x] [cos(currentRotate) -sin(currentRotate 0] [ 0 currentScale currentTranslate.y] by [sin(currentRotate) cos(currentRotate) 0] [ 0 0 1 ] [ 0 0 1]
すなわち、並進, 拡縮, 回転の順に座標系変換が行われる。 拡縮と回転の基準点は原点 (0, 0) になる。 That is, translate, then scale, then rotate the coordinate system. The reference point for scale and rotate operations is the origin (0, 0).
interface SVGSVGElement : SVGLocatableElement, SVGTimedElement { const unsigned short NAV_AUTO = 1; const unsigned short NAV_NEXT = 2; const unsigned short NAV_PREV = 3; const unsigned short NAV_UP = 4; const unsigned short NAV_UP_RIGHT = 5; const unsigned short NAV_RIGHT = 6; const unsigned short NAV_DOWN_RIGHT = 7; const unsigned short NAV_DOWN = 8; const unsigned short NAV_DOWN_LEFT = 9; const unsigned short NAV_LEFT = 10; const unsigned short NAV_UP_LEFT = 11; attribute float currentScale; attribute float currentRotate; readonly attribute SVGPoint currentTranslate; readonly attribute SVGRect viewport; float getCurrentTime(); void setCurrentTime(in float seconds); SVGMatrix createSVGMatrixComponents(in float a, in float b, in float c, in float d, in float e, in float f); SVGRect createSVGRect(); SVGPoint createSVGPoint(); SVGPath createSVGPath(); SVGRGBColor createSVGRGBColor(in float red, in float green, in float blue) raises(SVGException); void moveFocus(in unsigned short motionType) raises(DOMException); void setFocus(in EventTarget theObject) raises(DOMException); EventTarget getCurrentFocusedObject(); };
currentScale
の初期値は 1 。
The current user agent scale (zoom) coefficient. The initial value for currentScale is 1.
currentRotate
の初期値は 0 。
The current user agent rotation angle in degrees. The initial value for currentRotate is 0.
x
や
y
成分に値を設定すると UA による並進も変化する。
currentTranslate
の初期値は値 (0, 0) の
SVGPoint
オブジェクト。
The current user agent translation used for scrolling or panning. The returned SVGPoint object is "live" and setting its x and y components will change the user agent's translation. The initial for currentTranslate is an SVGPoint object with the value (0, 0).
この svg 要素に対応する(暗黙または明示的な) ビューポート の位置とサイズ。 UA が内容を実際に描画する際、位置とサイズ値は描画の際の実際の値を表現する。 The position and size of the viewport (implicit or explicit) that corresponds to this 'svg' element. When the user agent is actually rendering the content, then the position and size values represent the actual values when rendering.
この SVG 文書が( HTML の object 要素などにより)他の文書に埋め込まれている場合、位置とサイズは親の文書の座標系に対応する単位の無い値になる(親が CSS または XSL によるレイアウトを用いている場合、 CSS 2 仕様に従い、単位の無い値は現在の CSS または XSL のビューポートの画素単位になる)。 親の要素が座標系を持っていない場合、 UA はこの属性に適切な既定値を与えるべきである。 If this SVG document is embedded as part of another document (e.g., via the HTML 'object' element), then the position and size are unitless values in the coordinate system of the parent document. (If the parent uses CSS or XSL layout, then unitless values represent pixel units for the current CSS or XSL viewport, as described in the CSS 2 specification.) If the parent element does not have a coordinate system, then the user agent should provide reasonable default values for this attribute.
独立 SVG 文書に対しては、
'x'
と
'y'
いずれも0でなければならず,
'width'
と
'height'
はそれぞれホスト環境から内容描画域として
SVG-UA
に提供されたビューポートの幅と高さでなければならない。
すべての値はホスト環境からの画素座標系の値を表す。
この画素座標系は、 HTML の画素座標系と一致し,
CSS 2
仕様に述べられている画素座標系のモデルに合致することが好ましい。
「画素座標系」はホスト固有なのに注意。
ホストは画素座標系に実際の機器の画素を利用することもあれば, (特に高解像度機器においては) SVG と CSS の "px" に一致する疑似的な機器画素も利用し得る。
For stand-alone SVG documents, both 'x' and 'y' must be zero, the 'width' must be the width of the viewport which the host environment provides to the SVG-UA into which it can render its content, and the 'height' must be the height of the viewport, with all values expressed in the pixel coordinate system from the host environment, preferably such that this pixel coordinate system matches the same pixel coordinate system presented to HTML and matches the model for pixel coordinates described in the CSS 2 specification. Note that "pixel coordinate systems" are host-specific. Two possible approaches that hosts might use for pixel coordinate systems are actual device pixels or (particularly for high-resolution devices) pseudo device pixels which exactly match SVG and CSS's "px" coordinates.
オブジェクト自身とその内容はいずれも読み取り専用になる。
それらへの変更はエラーコード NO_MODIFICATION_ALLOWED_ERR の
DOMException
を生じさせる。
返される
SVGRect
オブジェクトは「生きて」おり、すなわち、
x
,
y
,
width
,
height
属性はビューポートのサイズと位置が変化した際に自動的に更新される。
The object itself and its contents are both readonly. A DOMException with error code NO_MODIFICATION_ALLOWED_ERR is raised if an attempt is made to modify it. The returned SVGRect object is "live", i.e. its x, y, width and height attributes are automatically updated if the viewport size or position changes.
文書時刻 を秒単位で返す。 Returns the document time in seconds.
文書時間軸が開始される前に getCurrentTime
が呼び出された場合(例えば、
playbackOrder
が 'onLoad' に設定された
最も根元の 'svg' 要素
の
load
イベントが配送される前に、実行中の
script
要素から)、 0 が返される。
If getCurrentTime is called before the document timeline has begun (for example, by script running in a 'script' element before the rootmost 'svg' element's load event is dispatched, when 'playbackOrder' is set to 'onLoad'), then 0 is returned.
float | 秒単位の現在の 文書時刻 、または文書時間軸がまだ開始されていない場合は 0 。 The current document time, in seconds, or 0 if the document timeline has not yet begun. |
文書時刻 (秒)を設定する。 この API は時間軸での前後への移行をサポートするために要求される。 移行後は、アニメーションは新たな時刻から(未来方向への)再生を継続する。 seconds が負の場合、文書は時刻 0 秒へ移行する。 Sets the document time (in seconds). This API is required to support seeking forwards and backwards in the timeline. After a seek, animation continues to play (forwards) from the new time. If seconds is negative, then the document will seek to time 0s.
文書の時間軸が開始される前に setCurrentTime
が呼び出された場合(例えば、
playbackOrder
が 'onLoad' に設定された
最も根元の 'svg' 要素
の
load
イベントが配送される前に、実行中の
script
要素から)、文書時間軸が開始された際に、このメソッドの最も最新の呼び出しによる seconds の値の時刻へ文書時刻が移行する。
If setCurrentTime is called before the document timeline has begun (for example, by script running in a 'script' element before the rootmost 'svg' element's load event is dispatched, when 'playbackOrder' is set to 'onLoad'), then the value of seconds in the most recent invocation of the method gives the time that the document time will be seeked to once the document timeline has begun.
in float seconds | 文書時刻 が移行する時刻(秒)。 The document time to seek to, in seconds. |
setMatrixTrait
メソッドを用いて
SVGMatrix
型と互換性のある trait の値の変更に利用できる。
行列の内部表現は次のようになる:
Creates a new SVGMatrix object. This object can be used to modify the value of traits which are compatible with the SVGMatrix type using the setMatrixTrait method. The internal representation of the matrix is as follows:
[ a c e ] [ b d f ] [ 0 0 1 ]
in float a | 設定する行列の a 成分。 The a component of the matrix to be set. |
in float b | 設定する行列の b 成分。 The b component of the matrix to be set. |
in float c | 設定する行列の c 成分。 The c component of the matrix to be set. |
in float d | 設定する行列の d 成分。 The d component of the matrix to be set. |
in float e | 設定する行列の e 成分。 The e component of the matrix to be set. |
in float f | 設定する行列の f 成分。 The f component of the matrix to be set. |
setRectTrait
メソッドを用いて
SVGRect
型と互換性のある trait の値の変更に利用できる。
作成された
SVGRect
の
x
,
y
,
width
,
height
の初期値は 0 。
Creates a new SVGRect object. This object can be used to modify the value of traits which are compatible with the SVGRect type using the setRectTrait method. The initial values for x, y, width and height of this new SVGRect are zero.
x
と
y
の初期値は 0 。
Creates a new SVGPoint object. The initial values for x and y of this new SVGPoint are zero.
setPathTrait
メソッドを用いて
SVGPath
型と互換性のある trait の値の変更に利用できる。
Creates a new SVGPath object. This object can be used to modify the value of traits which are compatible with the SVGPath type using the setPathTrait method.
setRGBColorTrait
メソッドを用いて
SVGRGBColor
型と互換性のある trait の値の変更に利用できる。
パラメタは各色成分ごとに1個の浮動小数点数になる。
値 0.0 は色成分の明度 0, 255.0 は色成分の最大明度を表現する。
rgb(%,%,%) の構文による色は成分が小数になり得る。
色域外の成分は 0.0 より小さいか 255.0 より大きい値になり得る。
Creates a new SVGRGBColor object. This object can be used to modify the value of traits which are compatible with the SVGRGBColor type using the setRGBColorTrait method. The parameters are floats, one per color component. 0.0 represents zero intensity and 255.0 represents full intensity of a given color component. Colors originally in the rgb(%,%,%) syntax may have fractional components. Out of gamut colors may have component values less than 0.0 or greater than 255.0.
in float red | SVGRGBColor の赤成分。 The red component of the SVGRGBColor. |
in float green | SVGRGBColor の緑成分。 The green component of the SVGRGBColor. |
in float blue | SVGRGBColor の青成分。 The blue component of the SVGRGBColor. |
SVGRGBColor | 作成された SVGRGBColor 。 The created SVGRGBColor. |
このメソッドが成功した場合: If this method succeeds:
DOMFocusOut
イベントが配送されなければならない。
A DOMFocusOut event must be dispatched which has the previously focused object as the event target.
DOMFocusIn
イベントが配送されなければならない。
After that, a DOMFocusIn event must dispatched which has the the new focused object as the event target.
新たにフォーカスを得たオブジェクトへの参照は、生成された
DOMFocusIn
イベントの
EventTarget
インターフェースを用いて取得できる。
A reference to the new focused object can be obtained using the EventTarget interface of the generated DOMFocusIn event.
ナビゲーションがどのように管理されるかについては ナビゲーション の節を見よ。 このメソッドのふるまいは、スクリプトからでなく末端利用者から等価な動きがなされた場合と同じでなければならない(例えばジョイスティックの利用や Tab キーの押し下げなど)。 Refer to the navigation section for a description of how navigation is managed. The behavior for this method must be the same as if an equivalent move was done by the end user (for example by using a joystick or pressing the Tab key) and not by scripting.
メソッドが失敗した場合(すなわち
DOMException
が生じる)、フォーカスは現在フォーカスを得ているオブジェクトに留まらなければならず、
DOMFocusOut
,
DOMFocusIn
イベントは配送されない。
Whenever the method fails (that is, when a DOMException is raised), focus must stay on the currently focused object and no DOMFocusOut/DOMFocusIn event is dispatched.
注記:独立 SVG 文書に対しては、 UA は常にフォーカスを得ているオブジェクトを持っていなければならない。 初期状態では SVGDocument がフォーカスを得る。 Note: For stand-alone SVG documents, the user agent must always have a currently focused object. At the beginning, the SVGDocument has focus.
in short motionType | 移動の型。 The type of motion. |
DOMException | NOT_SUPPORTED_ERR: 要請された移動の型がサポートされてない(インターフェースの定数でない)際にレイズされる。 NOT_SUPPORTED_ERR: Raised if the requested motion type is not supported (i.e. not one of the interface constants). |
DOMException |
INVALID_ACCESS_ERR: 現在フォーカスを得ているオブジェクトが要請された移動の型に対応する
ナビゲーション属性
値を持っていない場合にレイズされる。
例えば、
nav-up
属性を持たない要素に対し moveFocus(NAV_UP) が呼び出されたときなど。
INVALID_ACCESS_ERR: Raised if the currently focused object doesn't have a navigation attribute value corresponding to the requested motion type. For instance, if a moveFocus(NAV_UP) is called on an element which has no 'nav-up' attribute.
|
DOMException |
INVALID_STATE_ERR: 現在フォーカスを得ているオブジェクトが要請された移動の型に対応する
ナビゲーション属性
値を持ってはいるが、属性が指す対象が存在しない場合やフォーカスされ得ないオブジェクトだった場合にレイズされる。
例えば、
nav-up
属性を持つ要素に対し moveFocus(NAV_UP) が呼び出されたが、この属性の値がフォーカスされ得ないオブジェクトを参照しているときなど。
INVALID_STATE_ERR: Raised if the currently focused object has a navigation attribute value corresponding to the requested motion type but the target indicated in this attribute can not be found or is not a focusable object. For instance, if a moveFocus(NAV_UP) is called on an object which has a 'nav-up' attribute but the value of this attribute references an element which is not focusable.
|
このメソッドが成功した場合: If this method succeeds:
DOMFocusOut
イベントが配送されなければならない。
A DOMFocusOut event must be dispatched which has the previously focused object as the event target.
DOMFocusIn
イベントが配送されなければならない。
After that, a DOMFocusIn event must be dispatched which has the the new focused object as the event target.
新たにフォーカスを得たオブジェクトへの参照は、生成された
DOMFocusIn
イベントの
EventTarget
インターフェースを用いて取得できる。
A reference to the newly focused object can be obtained using the EventTarget interface of the generated DOMFocusIn event.
メソッドが失敗した場合(すなわち
DOMException
が生じる)、フォーカスは現在フォーカスを得ているオブジェクトに留まらなければならず、
DOMFocusOut
,
DOMFocusIn
イベントは配送されない。
Whenever the method fails (that is, when a DOMException is raised), focus must stay on the currently focused object and no DOMFocusOut or DOMFocusIn event is dispatched.
注記:独立 SVG 文書に対しては、 UA は常にフォーカスを得ているオブジェクトを持っていなければならない。 初期状態では SVGDocument がフォーカスを得る。 Note: For stand-alone SVG documents, the user agent must always have a currently focused object. At the beginning, the SVGDocument has focus.
in EventTarget theObject | フォーカスを得るべきオブジェクト。 The object which should receive focus. |
DOMException | NOT_SUPPORTED_ERR: パラメタ in が Node または SVGElementInstance でない場合、あるいは、要請された要素がフォーカスされ得ない場合(すなわち、 focusable 属性にそのように指示されている)、レイズされる。 NOT_SUPPORTED_ERR: Raised if the in parameter is not a Node or SVGElementInstance, or if the requested element is not focusable (i.e. its 'focusable' attribute indicates that the element is not focusable). |
EventTarget object | 現在フォーカスを得ているオブジェクト。 The currently focused object. |
このインターフェースは赤, 緑, 青成分からなる色値を表現する。
fill,
stroke,
color
などの色値を格納する trait の読み書きに利用できる(
getRGBColorTrait
を用いるなど)。
This interface represents a color value made up of red, green, and blue components. It can be used to read and write traits that store color values (using getRGBColorTrait) such as 'fill', 'stroke', and 'color'.
interface SVGRGBColor { attribute unsigned long red; attribute unsigned long green; attribute unsigned long blue; };
このインターフェースは、最小の x, 最小の y, 幅, 高さの値からなる SVGRect データ型を表現する。 This interface represents an SVGRect datatype, consisting of a minimum x, minimum y, width and height values.
このインターフェースは SVG 1.1 ([SVG11], 4.3 節) で定義されている SVGRect インターフェースと同一である。 This interface is identical to SVGRect interface defined in SVG 1.1 ([SVG11], section 4.3).
interface SVGRect { attribute float x; attribute float y; attribute float width; attribute float height; };
x と y 成分で同定される SVGPoint データ型を表現する。 Represents an SVGPoint datatype, identified by its x and y components.
このインターフェースは SVG 1.1 ([SVG11], 4.3 節) で定義されている SVGPoint インターフェースと同一である。 This interface is identical to SVGPoint interface defined in SVG 1.1 ([SVG11], section 4.3).
interface SVGPoint { attribute float x; attribute float y; SVGPoint matrixTransform(in SVGMatrix matrix); };
matrixTransform
参照。
このインターフェースはパスの幾何を定義する SVGPath データ型を表現する。 This interface represents an SVGPath datatype used to define path geometry.
このインターフェースを用いて作成または変更されたパスデータは パスの正規化 で定められた規則に従って正規化されなければならない。 しかしながら、クエリ目的のパスデータは正規化されている必要は無い。 【クエリ目的("just queried"):引数として渡す場合?】 Path data created or modified using this interface must be normalized as per the rules given in Path Normalization. However, path data that is just queried need not be normalized.
interface SVGPath { const unsigned short MOVE_TO = 77; const unsigned short LINE_TO = 76; const unsigned short CURVE_TO = 67; const unsigned short QUAD_TO = 81; const unsigned short CLOSE = 90; readonly attribute unsigned long numberOfSegments; unsigned short getSegment(in unsigned long cmdIndex) raises(DOMException); float getSegmentParam(in unsigned long cmdIndex, in unsigned long paramIndex) raises(DOMException); void moveTo(in float x, in float y); void lineTo(in float x, in float y); void quadTo(in float x1, in float y1, in float x2, in float y2); void curveTo(in float x1, in float y1, in float x2, in float y2, in float x3, in float y3); void close(); };
in unsigned long cmdIndex | 取得する区分の命令インデックス。 The command index for the segment command to retrieve. |
unsigned short |
区分の命令。
MOVE_TO ,
LINE_TO ,
CURVE_TO ,
QUAD_TO ,
CLOSE
のいずれか。
The segment command. One of MOVE_TO, LINE_TO, CURVE_TO, QUAD_TO or CLOSE .
|
DOMException | INDEX_SIZE_ERR: 区分のインデックスが範囲外の場合にレイズされる。 INDEX_SIZE_ERR: Raised if the segment index is out of bounds. |
in unsigned long cmdIndex | 区分の命令インデックス。 The command index for the segment command. |
in unsigned long paramIndex | 取得するパラメタのパラメタインデックス。 The parameter index to retrieve. |
float | 区分パラメタ。 The segment parameter. |
DOMException | INDEX_SIZE_ERR: 区分インデックスが範囲外の場合、またはパラメタインデックスが指定された区分の型の範囲外の場合にレイズされる。 INDEX_SIZE_ERR: Raised if the segment index is out of bounds, or the parameter index is out of bounds for the specified segment's type. |
in float x | 指定された点のX座標。 The x-axis coordinate for the specified point. |
in float y | 指定された点のY座標。 The y-axis coordinate for the specified point. |
in float x | 指定された点のX座標。 The x-axis coordinate for the specified point. |
in float y | 指定された点のY座標。 The y-axis coordinate for the specified point. |
in float x1 | 第一制御点のX座標。 The x-axis coordinate of the first control point. |
in float y1 | 第一制御点のY座標。 The y-axis coordinate of the first control point. |
in float x2 | 終端点のX座標。 The x-axis coordinate of the final end point. |
in float y2 | 終端点のY座標。 The y-axis coordinate of the final end point. |
in float x1 | 第一制御点のX座標。 The x-axis coordinate of the first control point. |
in float y1 | 第一制御点のY座標。 The y-axis coordinate of the first control point. |
in float x2 | 第二制御点のX座標。 The x-axis coordinate of the second end point. |
in float y2 | 第二制御点のY座標。 The y-axis coordinate of the second end point. |
in float x3 | 終端点のX座標。 The x-axis coordinate of the final end point. |
in float y3 | 終端点のY座標。 The y-axis coordinate of the final end point. |
このインターフェースはアフィン変換を表現する行列である。 transform 属性の値の読み取りと変更に利用できる。 This interface is a matrix, as is used to represent an affine transform. It can be used to read and modify the values of the 'transform' attribute.
注記:このインターフェースの
mTranslate
,
inverse
,
mMultiply
,
mScale
,
mRotate
メソッドは
SVGMatrix
オブジェクトを変更し、必要な行列操作を行った後に
SVGMatrix
インスタンス自身への参照を返す。
Note: The mTranslate, inverse, mMultiply, mScale and mRotate methods in this interface mutate the SVGMatrix object and return a reference to the SVGMatrix instance itself, after performing the necessary matrix operation.
この行列は、元の座標 (x, y) を縦ベクトルとみなして次のように座標ベクトルと行列の積をとり、行き先の座標 (x', y') へ変換する: This matrix transforms source coordinates (x, y) into destination coordinates (x', y') by considering them to be a column vector and multiplying the coordinate vector by the matrix according to the following process:
[ x' ] [ a c e ] [ x ] [ a.x + c.y + e ] [ y' ] = [ b d f ] [ y ] = [ b.x + d.y + f ] [ 1 ] [ 0 0 1 ] [ 1 ] [ 1 ]
interface SVGMatrix { float getComponent(in unsigned long index) raises(DOMException); SVGMatrix mMultiply(in SVGMatrix secondMatrix); SVGMatrix inverse() raises(SVGException); SVGMatrix mTranslate(in float x, in float y); SVGMatrix mScale(in float scaleFactor); SVGMatrix mRotate(in float angle); };
getComponent(0)
は a, getComponent(1)
は b, 等々。
Returns a component of the matrix by the component's zero-based index. getComponent(0) is a, getComponent(1) is b, etc.
in unsigned long index | 取得する行列成分のインデックス。 The index of the matrix component to retrieve. |
float | 行列成分。 The matrix component. |
DOMException |
INDEX_SIZE_ERR: index が無効(すなわち [0, 5] の範囲外)の場合にレイズされる。
INDEX_SIZE_ERR: Raised if the index is invalid (i.e., outside the range [0, 5]).
|
in SVGMatrix secondMatrix | 後置積をとる行列。 The matrix to post-multiply with. |
SVGMatrix | 結果の現在の行列。 The resulting current matrix. |
SVGMatrix | 現在の行列の逆行列。 The inverse of the current matrix. |
SVGException | SVG_MATRIX_NOT_INVERTABLE: この行列の行列式が0の場合にレイズされる。 SVG_MATRIX_NOT_INVERTABLE: Raised when the determinant of this matrix is zero. |
T
として mMultiply(T)
を呼び出すことに等しい:
Post-multiplies a translation transformation on the current matrix and returns the resulting current matrix. This is equivalent to calling mMultiply(T), where T is an SVGMatrix object represented by the following matrix:
[ 1 0 x ] [ 0 1 y ] [ 0 0 1 ]
in float x | 並進変換による座標のX軸方向の移動距離。 The distance by which coordinates are translated in the x-axis direction. |
in float y | 並進変換による座標のY軸方向の移動距離。 The distance by which coordinates are translated in the y-axis direction. |
SVGMatrix | 結果の現在の行列。 The resulting current matrix. |
S
として mMultiply(S)
を呼び出すことに等しい:
Post-multiplies a uniform scale transformation on the current matrix and returns the resulting current matrix. This is equivalent to calling mMultiply(S), where S is an SVGMatrix object represented by the following matrix:
[ scaleFactor 0 0 ] [ 0 scaleFactor 0 ] [ 0 0 1 ]
in float scaleFactor | 座標をX軸Y軸に沿って拡縮させる倍率。 The factor by which coordinates are scaled along the x- and y-axis. |
SVGMatrix | 結果の現在の行列。 The resulting current matrix. |
R
として mMultiply(R)
を呼び出すことに等しい:
Post-multiplies a rotation transformation on the current matrix and returns the resulting current matrix. This is equivalent to calling mMultiply(R), where R is an SVGMatrix object represented by the following matrix:
[ cos(angle) -sin(angle) 0 ] [ sin(angle) cos(angle) 0 ] [ 0 0 1 ]
in float angle | 回転角(度)。 The angle of rotation in degrees. |
SVGMatrix | 結果の現在の行列。 The resulting current matrix. |
要素の位置情報を取得するためのインターフェース。 Interface for getting information about the location of elements.
interface SVGLocatable { SVGRect getBBox(); SVGMatrix getScreenCTM(); SVGRect getScreenBBox(); };
SVGRect | 包含ボックス 。 返されるオブジェクトは現在の包含ボックス値の複製であり、元の包含ボックスが変化しても、変化しない。 The bounding box. The returned object is a copy of the current bounding box value and will not change if the corresponding bounding box changes. |
clientX
と
clientY
は初期のビューポート座標系に属する。
この要素が文書木に掛かっていない場合【 "hooked" :描画木も含めて?】、 null
が返されることに注意。
このメソッドは getClientCTM
と命名した方が適切だったが、歴史的な理由から getScreenCTM
の名前が維持されている。
また、 getScreenCTM
は現在のアニメーション状態を反映することに注意。
すなわち、 getScreenCTM
が呼び出された要素に関わる変換がアニメーションされている場合、返される変換行列の計算にも現在アニメーションされているそれぞれの変換の状態が反映される。
Returns the transformation matrix from current user units to the initial viewport coordinate system. The clientX and clientY coordinates of a MouseEvent are in the initial viewport coordinate system. Note that null is returned if this element is not hooked into the document tree. This method would have been more aptly named as getClientCTM, but the name getScreenCTM is kept for historical reasons. Also note that getScreenCTM reflects a snapshot of the current animated state, i.e. if one or several transforms that affect the element that getScreenCTM is called upon are animated then the returned transformation matrix reflects the current state of each such animated transform when calculating the returned matrix.
SVGMatrix | 変換行列。 返されるオブジェクトは現在の screen CTM 値の複製であり、元の screen CTM が変化しても、変化しない。 The transformation matrix. The returned object is a copy of the current screen CTM value and will not change if the corresponding screen CTM changes. |
SVGLocatable::getScreenCTM
メソッドから返された行列により現在の利用座標空間と結びつけられる。
Returns the bounding box of the element in screen coordinate space. The box coordinates are in the initial viewport coordinate system, which is connected to the current user coordinate space by the matrix returned by the SVGLocatable::getScreenCTM method.
SVGRect | スクリーン座標空間での 包含ボックス 。 返されるオブジェクトは現在のスクリーン包含ボックス値の複製であり、元のスクリーン包含ボックスが変化しても、変化しない。 The bounding box in screen coordinate space. The returned object is a copy of the current screen bounding box value and will not change if the corresponding screen bounding box changes. |
以下の例で
getBBox()
メソッドのふるまいをより明らかにする。
例には短い説明と SVG 素片に続いて次の書式で表記される一連の包含ボックス値が含まれる:
The following examples further clarify the behavior of the getBBox() method. The examples have a short explanation, an SVG fragment and are followed by a set of bounding box values which have the following format:
[elementId] : {x, y, width, height} | {null}
[elementId] : {x, y, width, height} | {null}
ここで x, y, width, height は、指定された ID の要素に対する
getBBox
呼び出しから返された
SVGRect
オブジェクトの値になる。
包含ボックスが null
になり得る少数の場合がある(Example 6 を見よ)。
where x, y, width and height define the values of the SVGRect objects returned from a getBBox call on the element with the specified ID. There are a few cases where the bounding box may be null (see example 6).
getBBox
メソッド呼び出しの返り値を示す。
特に、要素に対する変換はその利用空間における包含ボックス値を変えないことを示している。
Example #1: Simple groups and bounds<g xml:id="group1" transform="translate(10, 20)" fill="red"> <rect xml:id="rect1" transform="scale(2)" x="10" y="10" width="50" height="50"/> <rect xml:id="rect2" x="10" y="10" width="100" height="100"/> <g xml:id="group2" transform="translate(10, 20)"> <rect xml:id="rect3" x="0" y="10" width="150" height="50"/> <circle xml:id="circle1" cx="20" cy="20" r="100" /> </g> </g>
結果: [group1] : {-70.0, -60.0, 230.0, 200.0}
[rect1] : {10.0, 10.0, 50.0, 50.0}
[rect2] : {10.0, 10.0, 100.0, 100.0}
[group2] : {-80.0, -80.0, 230.0, 200.0}
[rect3] : {0.0, 10.0, 150.0, 50.0}
[circle1] : {-80.0, -80.0, 200.0, 200.0}
<g xml:id="group1" transform="translate(10, 20)" fill="red"> <rect xml:id="rect2" x="10" y="10" width="400" height="0"/> <g xml:id="group2" transform="translate(10, 20)"> <rect xml:id="rect3" x="0" y="10" width="150" height="50"/> </g> </g>
結果: [group1] : {10.0, 10.0, 400.0, 70.0}
[rect2] : {10.0, 10.0, 400.0, 0.0}
[group2] : {0.0, 10.0, 150.0, 50.0}
[rect3] : {0.0, 10.0, 150.0, 50.0}
<svg xml:id="mySVG" version="1.2" baseProfile="tiny" width="10" height="20"> <g xml:id="group1" transform="translate(10, 20)" fill="red"> <rect xml:id="rect1" x="10" y="10" width="100" height="100"/> <ellipse xml:id="ellipse1" cx="20" cy="20" rx="0" ry="70" /> </g> </svg>
結果: [mySVG] : {20.0, -30.0, 100.0, 160.0}
[group1] : {10.0, -50.0, 100.0, 160.0}
[rect1] : {10.0, 10.0, 100.0, 100.0}
[ellipse1] : {20.0, -50.0, 0.0, 140.0}
<svg xml:id="mySVG" version="1.2" baseProfile="tiny" width="0" height="50"> <g xml:id="group1" transform="translate(10, 20)" fill="red" > <rect xml:id="rect1" x="10" y="10" width="50" height="50"/> <g xml:id="group2" transform="translate(10, 20)"> <rect xml:id="rect2" x="0" y="10" width="150" height="0"/> <circle xml:id="circle1" cx="20" cy="20" r="500"/> </g> </g> </svg>
結果: [mySVG] : {-460.0, -440.0, 1000.0, 1000.0}
[group1] : {-470.0, -460.0, 1000.0, 1000.0}
[rect1] : {10.0, 10.0, 50.0, 50.0}
[group2] : {-480.0, -480.0, 1000.0, 1000.0}
[rect2] : {0.0, 10.0, 150.0, 0.0}
[circle1] : {-480.0, -480.0, 1000.0, 1000.0}
<svg version="1.2" baseProfile="tiny"> <defs> <rect xml:id="myRect" x="0" y="0" width="60" height="40"/> </defs> <use xml:id="myUse" xlink:href="#myRect" x="-30" y="-20"/> </svg>
結果: [myRect] : {0.0, 0.0, 60.0, 40.0}
[myUse] : {-30.0, -20.0, 60.0, 40.0}
null
になることを示す。
同様に
SVGPath
が空の
path
(例えば
createElementNS
を呼び出して新たに作成されたものなど、パス命令を持たない
path
要素)の包含ボックスも null
になる。
Example #6: Empty groupnull
.
<g xml:id="emptyG"/>
結果: [emptyG] : {null}
<g xml:id="g1"> <g xml:id="g1.1.display.none" display="none"> <rect xml:id="rect1" x="10" y="10" width="40" height="40"/> </g> <rect xml:id="rect2.visibility.hidden" visibility="hidden" x="30" y="60" width="10" height="20"/> </g>
結果: [g1] : {30.0, 60.0, 10.0, 20.0}
[g1.1.display.none] : {10.0, 10.0, 40.0, 40.0}
[rect1] : {10.0, 10.0, 40.0, 40.0}
[rect2.visibility.hidden] : {30.0, 60.0, 10.0, 20.0}
<g xml:id="g1"> <line xml:id="line1" x2="100" y2="100" transform="rotate(-45)"/> </g>
結果: [g1] : {0.0, 0.0, 141.42136, 0}
[line1] : {0.0, 0.0, 100.0, 100.0}
<g> <line xml:id="thickLine" stroke-width="10" x2="100" y2="0"/> </g>
結果: [thickLine] : {0.0, 0.0, 100.0, 0.0}
<svg xml:id="rootSvg" version="1.2" baseProfile="tiny" width="500" height="300" viewBox="0 0 200 100"> <rect x="-100" y="-200" width="500" height="100"/> </svg>
結果: [rootSVG] : {-100, -200, 500, 100}
<g xml:id="g1"> <linearGradient xml:id="MyGradient"/> <stop offset="0.05" stop-color="#F60"/> <stop offset="0.95" stop-color="#FF6"/> </linearGradient> </g>
結果: [g1] : {null}
このインターフェースは要素のスクリーン上の実際の位置を表現する。 This interface represents an element that has a physical location on the screen.
このインターフェースは次の要素に実装される: rect, circle, ellipse, line, path, use, image, text, textArea, tspan, svg, a, video, animation, switch, foreignObject, polygon, polyline, g This interface is implemented by: 'rect', 'circle', 'ellipse', 'line', 'path', 'use', 'image', 'text', 'textArea', 'tspan', 'svg', 'a', 'video', 'animation', 'switch', 'foreignObject', 'polygon', 'polyline' and 'g'.
interface SVGLocatableElement : SVGElement, SVGLocatable { };
trait を操作するインターフェース。 このインターフェースは SVGElement に結びつけられた "trait" の値の読み取りと操作に利用される。 それぞれの trait は1つの属性またはプロパティに対応し、要素からパースされ, 解釈され, ほとんどの場合はアニメーションも可能になる。 属性と異なり、各要素は明確に trait のセットを持ち、 サポートされない trait へのアクセスが試みられた場合は例外が投げられなければならない。 また、属性と異なり、 traits には型があり、値は正規化される:例えば path 要素に指定されたパスデータは パースされ, すべてのパス命令は絶対版に変換され、 trait の値からは元のパス命令が絶対版だったか相対版だったかは判別し得ない。 trait 値の取得や設定の際には正しい型のアクセサが用いられなければならず、そうでなかった場合は例外が投げられなければならない。 Trait manipulation interface. This interface is used to read and manipulate the value of "traits" associated with an SVGElement. Each trait corresponds to an attribute or property, which is parsed and understood by the element and in most cases animatable. Unlike attributes, each element has a well-defined set of traits and attempting to access an unsupported trait must throw an exception. Also, unlike attributes, traits are typed and their values are normalized; for instance path data specified on a 'path' element is parsed and all path commands are converted to their absolute variants, and it is not possible to determine from the value of the trait if a path command was absolute or relative. When getting and setting trait values, an accessor of the correct type must be used or an exception will be thrown.
プロパティに対応する trait においては算出値が用いられる:要素にプロパティの値が指定されていない場合、プロパティが継承されるならば値には親の値が利用される。 値が継承されない場合やルート要素においては、プロパティの初期値が利用される。 For a trait corresponding to a property, the computed value is used: if the value of a given property is not specified on that element, then for inherited properties the value on the parent is used. For non-inherited values, or on the root element, the initial value of the property is used.
非プロパティ属性に対応する trait に対しては、継承される属性の場合(
xml:lang
など)、親の値が利用される。
継承されない属性やルート要素においては、その属性の
省略値
が既知であればそれが利用される。
そうでない場合(例えば未知の属性や既定の値が規定されていない既知の属性)、 null
が返される。
For a trait corresponding to a non-property attribute, if the attribute is inherited (such as 'xml:lang') the value of the parent is used. If the attribute is not inherited, or on the root element, the lacuna value for the attribute is used, if known. If not known (for example, for an unknown attribute, or a known attribute with no specified default), null is returned.
TraitAccess インターフェースを木の外の要素の trait の取得に、例えば作成または除去されたばかりの要素に対し利用した場合、返り値は UA に依存することに注意。 Note that when using the TraitAccess interface for getting traits on elements outside of the tree, for example on elements just created or removed, what values are returned is user agent dependent.
trait ゲッタメソッド(
getTrait
,
getTraitNS
,
getFloatTrait
, 等々)は基底値( base value - アニメーションが適用される前の値)を返す。
これは静的な内容でもアニメーションされる内容でも成立する。
しかしながら、属性がアニメーションされている親要素の値から
継承
される場合、アニメーションされた値を継承することになる。
trait 表示値ゲッタメソッド(
getPresentationTrait
,
getPresentationTraitNS
,
getFloatPresentationTrait
, 等々)は trait が現在アニメーションされている場合は現在のアニメーション値を返し、そうでない場合は基底値を返す。
一部の属性は trait からはアクセスできない — 詳細は
サポートされる属性の一覧
を見よ。
The trait getter methods (getTrait, getTraitNS, getFloatTrait, etc.) return base values (i.e., before animation is applied), and this is true for both static and animated content. Note however that if the attribute is inherited from an animated parent value, it will inherit the animated value. The trait presentation value getter methods (getPresentationTrait, getPresentationTraitNS, getFloatPresentationTrait, etc.) return either the current animated value if the given trait is currently being animated or the base value if the given trait is not currently being animated. Not all attributes are accessible by traits — see the table of supported attributes for details.
trait 値の設定は対応する属性値を変更することと同義になるが、 trait セッタは型付きの値を操作できる。 変更された値は常に基底値になる。 プロパティに対応する継承可能な trait に対しては、常に trait 値を inherit に設定できる(ただし、値を取得する際は上で述べたように常に実際に継承された値を返す)。 Setting a trait value has the same effect as changing a corresponding attribute, but trait setters can operate on typed values. The value which is modified is always a base value. For inheritable traits corresponding to properties, the trait value can always be set to inherit (but querying the value will always return the actual inherited value as explained above).
無効な/サポート外の trait 値についての注記:
種々の trait セッタメソッド(
setTrait
,
setFloatTrait
,
setPathTrait
メソッドなど)が値を無効とみなしてコード INVALID_ACCESS_ERR の
DOMException
を投げる2つの状況がある。
一つは値がその trait の定義上無効な場合(例えば
stroke-linejoin
trait に値 'foo' を設定しようとするとこの例外が投げられる)。
trait メソッドは
サポート外の値
を無効なものと見なす。
しかしながら
IRI 参照
の場合は別で(
fill
プロパティに
<FuncIRI>
値を設定したり、
image
要素の
xlink:href
属性を設定するなど)、
SVG-UA
は、設定された trait 値が構文的に正しいならば無効なものと見なしてはならない(構文的に不正ならば
無効な IRI 参照
になる)。
よってこの場合はコード INVALID_ACCESS_ERR の
DOMException
を投げてはならない。
これはもっぱら、 trait の設定の際に
SVG-UA
が
無効な IRI 参照
かどうかを決定するために
IRI
へアクセスに行く必要を無くすものである。
Note about invalid/unsupported trait values: There are two situations where the various trait setter methods (such as the setTrait, setFloatTrait and setPathTrait methods) consider a value invalid and throw a DOMException with the INVALID_ACCESS_ERR code. The first situation is when the trait value is invalid with regards to its definition. (For example, trying to set the 'stroke-linejoin' trait to 'foo' would result in this exception being thrown). The trait methods will consider the value to be invalid if it is an unsupported value. However, if the trait value being set is an IRI reference, such as when setting a <FuncIRI> value on the 'fill' property or when setting the 'xlink:href' attribute on an 'image' element, an SVG user agent must not consider that trait value invalid if it is syntactically correct but is otherwise an invalid IRI reference. Thus, the DOMException with code INVALID_ACCESS_ERR must not be thrown in this case. This obviates the need for an SVG user agent to fetch the IRI upon setting the trait solely to determine whether it is an invalid IRI reference.
二つ目は trait に現在アニメーションが適用されている状況において trait 値が無効になるものである。 アニメーション、従って文書をエラー状態にするような値は無効なものと見なされる。 例えば path 要素の d 属性がアニメーションされているときに、 d 属性をアニメーションと互換性の無い値に変えようとした場合、例外が生じることになる。 The second situation is when the trait value is invalid with regards to animations currently applied to the trait. The value is considered invalid because it would put the animation, and therefore the document, in an error state. For example, if a 'path' element has animations on its 'd' attribute, trying to change the 'd' attribute to a value incompatible with the animations will cause the exception to happen.
interface TraitAccess { DOMString getTrait(in DOMString name) raises(DOMException); DOMString getTraitNS(in DOMString namespaceURI, in DOMString name) raises(DOMException); float getFloatTrait(in DOMString name) raises(DOMException); sequence<float> getFloatListTrait(in DOMString name) raises(DOMException); SVGMatrix getMatrixTrait(in DOMString name) raises(DOMException); SVGRect getRectTrait(in DOMString name) raises(DOMException); SVGPath getPathTrait(in DOMString name) raises(DOMException); SVGRGBColor getRGBColorTrait(in DOMString name) raises(DOMException); DOMString getPresentationTrait(in DOMString name) raises(DOMException); DOMString getPresentationTraitNS(in DOMString namespaceURI, in DOMString name) raises(DOMException); float getFloatPresentationTrait(in DOMString name) raises(DOMException); sequence<float> getFloatListPresentationTrait(in DOMString name) raises(DOMException); SVGMatrix getMatrixPresentationTrait(in DOMString name) raises(DOMException); SVGRect getRectPresentationTrait(in DOMString name) raises(DOMException); SVGPath getPathPresentationTrait(in DOMString name) raises(DOMException); SVGRGBColor getRGBColorPresentationTrait(in DOMString name) raises(DOMException); void setTrait(in DOMString name, in DOMString value) raises(DOMException); void setTraitNS(in DOMString namespaceURI, in DOMString name, in DOMString value) raises(DOMException); void setFloatTrait(in DOMString name, in float value) raises(DOMException); void setFloatListTrait(in DOMString name, in sequence<float> value) raises(DOMException); void setMatrixTrait(in DOMString name, in SVGMatrix matrix) raises(DOMException); void setRectTrait(in DOMString name, in SVGRect rect) raises(DOMException); void setPathTrait(in DOMString name, in SVGPath path) raises(DOMException); void setRGBColorTrait(in DOMString name, in SVGRGBColor color) raises(DOMException); };
namespaceURI
を null
にした
getTraitNS
呼び出しと正確に一致する。
Returns the trait value (possibly normalized) as a DOMString. SVG Tiny only certain traits can be obtained as a DOMString value. Syntax of the returned DOMString matches the syntax of the corresponding attribute.
This method is exactly equivalent to getTraitNS with namespaceURI set to null.
in DOMString name | 取得する trait の名前。 The name of the trait to retrieve. |
DOMString | trait の値。 The trait value. |
DOMException |
NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていないか null だった場合にレイズされる。
NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element or null.
|
DOMException | TYPE_MISMATCH_ERR: 要請された trait の算出値が DOMString に変換できない場合にレイズされる( SVG Tiny のみ)。 TYPE_MISMATCH_ERR: Raised if requested trait's computed value cannot be converted to a DOMString (SVG Tiny only). |
getTrait
と同じだが、名前空間のある trait に対するもの。
パラメタ name は非修飾 trait 名でなければならない。
すなわち接頭辞は付けない。
Same as getTrait, but for namespaced traits. Parameter name must be a non-qualified trait name, i.e. without prefix.
in DOMString namespaceURI | 取得する trait の名前空間。 The namespace of the trait to retrieve. |
in DOMString name | 取得する trait の名前。 The name of the trait to retrieve. |
DOMString | The trait value. The trait value. |
DOMException |
NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていないか null だった場合にレイズされる。
NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element or null.
|
DOMException | TYPE_MISMATCH_ERR: 要請された trait の算出値が DOMString に変換できない場合にレイズされる( SVG Tiny のみ)。 TYPE_MISMATCH_ERR: Raised if requested trait's computed value cannot be converted to a DOMString (SVG Tiny only). |
float
の trait 値を取得する。
パラメタ name は非修飾 trait 名でなければならない。
すなわち接頭辞は付けない。
Get the trait value as a float. Parameter name must be a non-qualified trait name, i.e. without prefix.
in DOMString name | 取得する trait の名前。 The name of the trait to retrieve. |
float |
float の trait 値。
The trait value as a float.
|
DOMException |
NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていないか null だった場合にレイズされる。
NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element or null.
|
DOMException |
TYPE_MISMATCH_ERR: 要請された trait の算出値が非数値 float の場合にレイズされる(例えば width 属性に百分率を与えた
最も根元の 'svg' 要素
に対し、 getFloatTrait("width") を呼び出した場合など)。
TYPE_MISMATCH_ERR: Raised if requested trait's computed value is a non-numeric float (for example, when calling getFloatTrait("width") on the rootmost 'svg' element whose width attribute uses a percentage).
|
sequence<float>
の trait 値を取得する。
パラメタ name は非修飾 trait 名でなければならない。
すなわち接頭辞は付けない。
Get the trait value as a sequence<float>. Parameter name must be a non-qualified trait name, i.e. without prefix.
in DOMString name | 取得する trait の名前。 The name of the trait to retrieve. |
sequence<float> |
sequence<float> の trait 値。
The trait value as a sequence<float>.
|
DOMException |
NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていないか null だった場合にレイズされる。
NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element or null.
|
DOMException |
TYPE_MISMATCH_ERR: 要請された trait の算出値が sequence<float> に変換できない場合にレイズされる。
TYPE_MISMATCH_ERR: Raised if requested trait's computed value cannot be converted to a sequence<float>.
|
in DOMString name | 取得する trait の名前。 The name of the trait to retrieve. |
DOMException |
NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていないか null だった場合にレイズされる。
NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element or null.
|
DOMException | TYPE_MISMATCH_ERR: 要請された trait の算出値が SVGMatrix に変換できない場合にレイズされる。 TYPE_MISMATCH_ERR: Raised if requested trait's computed value cannot be converted to an SVGMatrix. |
null
を返すことになる。
パラメタ name は非修飾 trait 名でなければならない。
すなわち接頭辞は付けない。
Returns the trait value as an SVGRect. The returned object is a copy of the actual trait value and will not change if the corresponding trait changes. If the actual trait value is not an SVGRect , e.g. the 'none' value on the 'viewBox' attribute, this method will return null. Parameter name must be a non-qualified trait name, i.e. without prefix.
in DOMString name | 取得する trait の名前。 The name of the trait to retrieve. |
DOMException |
NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていないか null だった場合にレイズされる。
NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element or null.
|
DOMException | TYPE_MISMATCH_ERR: 要請された trait の算出値が SVGRect に変換できない場合にレイズされる。 TYPE_MISMATCH_ERR: Raised if requested trait's computed value cannot be converted to an SVGRect. |
in DOMString name | 取得する trait の名前。 The name of the trait to retrieve. |
DOMException |
NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていないか null だった場合にレイズされる。
NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element or null.
|
DOMException | TYPE_MISMATCH_ERR: 要請された trait の算出値が SVGPath に変換できない場合にレイズされる。 TYPE_MISMATCH_ERR: Raised if requested trait's computed value cannot be converted to an SVGPath. |
null
を返さなければならない。
パラメタ name は非修飾 trait 名でなければならない。
すなわち接頭辞は付けない。
Returns the trait value as an SVGRGBColor. The returned object is a copy of the trait value and will not change if the corresponding trait changes. If the actual trait value is not an SVGRGBColor , i.e. 'none' or a link to a paint server (e.g. to a gradient or a 'solidColor'), this method must return null. Parameter name must be a non-qualified trait name, i.e. without prefix.
in DOMString name | 取得する trait の名前。 The name of the trait to retrieve. |
SVGRGBColor | SVGRGBColor の trait 値。 The trait value as an SVGRGBColor. |
DOMException |
NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていないか null だった場合にレイズされる。
NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element or null.
|
DOMException | TYPE_MISMATCH_ERR: 要請された trait の算出値が SVGRGBColor に変換できない場合にレイズされる。 TYPE_MISMATCH_ERR: Raised if requested trait's computed value cannot be converted to an SVGRGBColor. |
namespaceURI
を null
にした
getPresentationTraitNS
呼び出しと正確に一致する。
Returns the trait presentation value as a DOMString. SVG Tiny only certain traits can be obtained as a DOMString value. Syntax of the returned DOMString matches the syntax of the corresponding attribute.
This method is exactly equivalent to getPresentationTraitNS with namespaceURI set to null.
in DOMString name | 取得する trait の名前。 The name of the trait to retrieve. |
DOMString | trait 表示値。 The trait presentation value. |
DOMException |
NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていないか null だった場合にレイズされる。
NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element or null.
|
DOMException | TYPE_MISMATCH_ERR: 要請された trait の算出値が DOMString に変換できない場合にレイズされる( SVG Tiny のみ)。 TYPE_MISMATCH_ERR: Raised if requested trait's computed value cannot be converted to a DOMString (SVG Tiny only). |
getPresentationTrait
と同じだが、名前空間のある trait に対するもの。
パラメタ name は非修飾 trait 名でなければならない。
すなわち接頭辞は付けない。
Same as getPresentationTrait, but for namespaced traits. The parameter name must be a non-qualified trait name, i.e. without prefix.
in DOMString namespaceURI | 取得する trait の名前空間。 The namespace of the trait to retrieve. |
in DOMString name | 取得する trait の名前。 The name of the trait to retrieve. |
DOMString | trait 表示値。 The trait presentation value. |
DOMException |
NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていないか null だった場合にレイズされる。
NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element or null.
|
DOMException | TYPE_MISMATCH_ERR: 要請された trait の算出値が DOMString に変換できない場合にレイズされる( SVG Tiny のみ)。 TYPE_MISMATCH_ERR: Raised if requested trait's computed value cannot be converted to a DOMString (SVG Tiny only). |
float
の trait 表示値を取得する。
パラメタ name は非修飾 trait 名でなければならない。
すなわち接頭辞は付けない。
Get the trait presentation value as a float. Parameter name must be a non-qualified trait name, i.e. without prefix.
in DOMString name | 取得する trait の名前。 The name of the trait to retrieve. |
float |
float の trait 表示値。
The trait presentation value as a float.
|
DOMException |
NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていないか null だった場合にレイズされる。
NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element or null.
|
DOMException |
TYPE_MISMATCH_ERR: 要請された trait の算出値が非数値 float (例えば width 属性に百分率を与えた
最も根元の 'svg' 要素
に対し、 getFloatPresentationTrait("width") を呼び出した場合など)。
TYPE_MISMATCH_ERR: Raised if requested trait's computed value is a non-numeric float (for example, when calling getFloatTrait("width") on the rootmost 'svg' element whose width attribute uses a percentage).
|
sequence<float>
の trait 表示値を取得する。
パラメタ name は非修飾 trait 名でなければならない。
すなわち接頭辞は付けない。
Get the trait presentation value as a sequence<float>. Parameter name must be a non-qualified trait name, i.e. without prefix.
in DOMString name | 取得する trait の名前。 The name of the trait to retrieve. |
sequence<float> |
sequence<float> の trait 表示値。
The trait presentation value as a sequence<float>.
|
DOMException |
NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていないか null だった場合にレイズされる。
NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element or null.
|
DOMException |
TYPE_MISMATCH_ERR: 要請された trait の算出値が sequence<float> に変換できない場合にレイズされる。
TYPE_MISMATCH_ERR: Raised if requested trait's computed value cannot be converted to a sequence<float>.
|
in DOMString name | 取得する trait の名前。 The name of the trait to retrieve. |
DOMException |
NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていないか null だった場合にレイズされる。
NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element or null.
|
DOMException | TYPE_MISMATCH_ERR: 要請された trait の算出値が SVGMatrix に変換できない場合にレイズされる。 TYPE_MISMATCH_ERR: Raised if requested trait's computed value cannot be converted to an SVGMatrix. |
null
を返すことになる。
パラメタ name は非修飾 trait 名でなければならない。
すなわち接頭辞は付けない。
Returns the trait presentation value as an SVGRect. The returned object is a copy of the actual trait value and will not change if the corresponding trait changes or as animation continue to affect the trait presentation value. If the actual trait value is not an SVGRect, e.g. the 'none' value on the 'viewBox' attribute, this method will return null. Parameter name must be a non-qualified trait name, i.e. without prefix.
in DOMString name | 取得する trait の名前。 The name of the trait to retrieve. |
DOMException |
NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていないか null だった場合にレイズされる。
NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element or null.
|
DOMException | TYPE_MISMATCH_ERR: 要請された trait の算出値が SVGRect に変換できない場合にレイズされる。 TYPE_MISMATCH_ERR: Raised if requested trait's computed value cannot be converted to an SVGRect. |
in DOMString name | 取得する trait の名前。 The name of the trait to retrieve. |
DOMException |
NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていないか null だった場合にレイズされる。
NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element or null.
|
DOMException | TYPE_MISMATCH_ERR: 要請された trait の算出値が SVGPath に変換できない場合にレイズされる。 TYPE_MISMATCH_ERR: Raised if requested trait's computed value cannot be converted to an SVGPath. |
null
を返さなければならない。
パラメタ name は非修飾 trait 名でなければならない。
すなわち接頭辞は付けない。
Returns the trait presentation value as an SVGRGBColor. The returned object is a copy of the trait value and will not change if the corresponding trait changes or as animation continue to affect the trait presentation value. If the actual trait value is not an SVGRGBColor , i.e. 'none' or a link to a paint server (e.g. to a gradient or a 'solidColor'), this method must return null. Parameter name must be a non-qualified trait name, i.e. without prefix.
in DOMString name | 取得する trait の名前。 The name of the trait to retrieve. |
SVGRGBColor | SVGRGBColor の trait 表示値。 The trait presentation value as an SVGRGBColor. |
DOMException |
NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていないか null だった場合にレイズされる。
NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element or null.
|
DOMException | TYPE_MISMATCH_ERR: 要請された trait の算出値が SVGRGBColor に変換できない場合にレイズされる。 TYPE_MISMATCH_ERR: Raised if requested trait's computed value cannot be converted to an SVGRGBColor. |
namespaceURI
を null
にした
setTraitNS
呼び出しと正確に一致する。
Set the trait value as a DOMString. In SVG Tiny only certain traits can be set through a DOMString value. The syntax of the DOMString that should be given as a value must be the same as syntax of the corresponding XML attribute value. Exactly equivalent to setTraitNS with the namespaceURI attribute set to null.
in DOMString name | 設定する trait の名前。 The name of the trait to be set. |
in DOMString value | trait の値。 The value of the trait. |
DOMException | NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていない場合にレイズされる。 NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element. |
DOMException | TYPE_MISMATCH_ERR: 要請された trait の値を DOMString として指定できない場合にレイズされる。 TYPE_MISMATCH_ERR: Raised if the requested trait's value cannot be specified as a DOMString . |
DOMException |
INVALID_ACCESS_ERR: 入力が trait に対し無効な値であったか、 null が指定された場合にレイズされる。
INVALID_ACCESS_ERR: Raised if the input value is an invalid value for the given trait or null is specified.
|
DOMException | NO_MODIFICATION_ALLOWED_ERR: 読み出し専用の trait への変更を試みた場合にレイズされる。 NO_MODIFICATION_ALLOWED_ERR: Raised if attempt is made to change a readonly trait. |
setTrait
と同じだが、名前空間のある trait に対するもの。
パラメタ name は非修飾 trait 名でなければならない。
すなわち接頭辞は付けない。
Same as setTrait, but for namespaced traits. The parameter name must be a non-qualified trait name, i.e. without prefix.
in DOMString namespaceURI | 設定する trait の名前空間。 The namespace of the trait to be set. |
in DOMString name | 設定する trait の名前。 The name of the trait to be set. |
in DOMString value | trait の値。 The value of the trait. |
DOMException | NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていない場合にレイズされる。 NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element. |
DOMException | TYPE_MISMATCH_ERR: 要請された trait の値を DOMString として指定できない場合にレイズされる。 TYPE_MISMATCH_ERR: Raised if the requested trait's value cannot be specified as a DOMString . |
DOMException |
INVALID_ACCESS_ERR: 入力が trait に対し無効な値であったか、 null が指定された場合にレイズされる。
INVALID_ACCESS_ERR: Raised if the input value is an invalid value for the given trait or null is specified.
|
DOMException | NO_MODIFICATION_ALLOWED_ERR: 読み出し専用の trait への変更を試みた場合にレイズされる。 NO_MODIFICATION_ALLOWED_ERR: Raised if attempt is made to change a readonly trait. |
float
を設定する。
パラメタ name は非修飾 trait 名でなければならない。
すなわち接頭辞は付けない。
Set the trait value as a float. Parameter name must be a non-qualified trait name, i.e. without prefix.
in DOMString name | 設定する trait の名前。 The name of the trait to be set. |
in float
value |
trait の値。 The value of the trait. |
DOMException | NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていない場合にレイズされる。 NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element. |
DOMException |
TYPE_MISMATCH_ERR: 要請された trait の値を float として指定できない場合( NaN など)にレイズされる。
TYPE_MISMATCH_ERR: Raised if the requested trait's value cannot be specified as a numeric float (e.g. NaN).
|
DOMException |
INVALID_ACCESS_ERR: 入力が trait に対し無効な値であったか、 null が指定された場合にレイズされる。
INVALID_ACCESS_ERR: Raised if the input value is an invalid value for the given trait or null is specified.
|
sequence<float>
を設定する。
パラメタ name は非修飾 trait 名でなければならない。
すなわち接頭辞は付けない。
Set the trait value as a sequence<float>. Parameter name must be a non-qualified trait name, i.e. without prefix.
in DOMString name | 設定する trait の名前。 The name of the trait to be set. |
in sequence<float>
value |
trait の値。 The value of the trait. |
DOMException | NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていない場合にレイズされる。 NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element. |
DOMException |
TYPE_MISMATCH_ERR: 要請された trait の値を sequence<float> として指定できない場合にレイズされる。
TYPE_MISMATCH_ERR: Raised if the requested trait's value cannot be specified as a sequence<float>).
|
DOMException |
INVALID_ACCESS_ERR: 入力が trait に対し無効な値であったか、 null が指定された場合にレイズされる。
INVALID_ACCESS_ERR: Raised if the input value is an invalid value for the given trait or null is specified.
|
in DOMString name | 設定する trait の名前。 The name of the trait to be set. |
in SVGMatrix value | trait の値。 The value of the trait. |
DOMException | NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていない場合にレイズされる。 NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element. |
DOMException | TYPE_MISMATCH_ERR: 要請された trait の値を SVGMatrix として指定できない場合にレイズされる。 TYPE_MISMATCH_ERR: Raised if the requested trait's value cannot be specified as an SVGMatrix. |
DOMException |
INVALID_ACCESS_ERR: 入力値が null だった場合にレイズされる。
INVALID_ACCESS_ERR: Raised if the input value is null.
|
in DOMString name | 設定する trait の名前。 The name of the trait to be set. |
in SVGRect value | trait の値。 The value of the trait. |
DOMException | NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていない場合にレイズされる。 NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element. |
DOMException | TYPE_MISMATCH_ERR: 要請された trait の値を SVGRect として指定できない場合にレイズされる。 TYPE_MISMATCH_ERR: Raised if the requested trait's value cannot be specified as an SVGRect. |
DOMException |
INVALID_ACCESS_ERR: 入力が trait に対し無効な値であったか、 null が指定された場合にレイズされる。
幅または高さの値が負の
SVGRect
は無効になる。
INVALID_ACCESS_ERR: Raised if the input value is an invalid value for the given trait or null is specified. An SVGRect is invalid if the width or height values are set to negative.
|
in DOMString name | 設定する trait の名前。 The name of the trait to be set. |
in SVGPath value | trait の値。 The value of the trait. |
DOMException | NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていない場合にレイズされる。 NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element. |
DOMException | TYPE_MISMATCH_ERR: 要請された trait の値を SVGPath として指定できない場合にレイズされる。 TYPE_MISMATCH_ERR: Raised if the requested trait's value cannot be specified as an SVGPath. |
DOMException |
INVALID_ACCESS_ERR: 入力が trait に対し無効な値であったか、 null が指定された場合にレイズされる。
MOVE_TO 区分以外の区分から開始される
SVGPath
は無効になる。
注記: 空の SVGPath は有効。 INVALID_ACCESS_ERR: Raised if the input value is an invalid value for the given trait or null is specified. An SVGPath is invalid if it begins with any segment other than MOVE_TO segment. Note: An empty SVGPath is still a valid value. |
in DOMString name | 設定する trait の名前。 The name of the trait to be set. |
in SVGRGBColor value | trait の値。 The value of the trait. |
DOMException | NOT_SUPPORTED_ERR: 要請された trait がこの要素でサポートされていない場合にレイズされる。 NOT_SUPPORTED_ERR: Raised if the requested trait is not supported on this element. |
DOMException | TYPE_MISMATCH_ERR: 要請された trait の値を SVGRGBColor として指定できない場合にレイズされる。 TYPE_MISMATCH_ERR: Raised if the requested trait's value cannot be specified as an SVGRGBColor. |
DOMException |
INVALID_ACCESS_ERR: 入力値が null だった場合にレイズされる。
INVALID_ACCESS_ERR: Raised if the input value is null.
|
trait アクセスはすべての SVG Tiny 1.2 の属性とプロパティ には要求されていない。 下の一覧表に SVG Tiny 1.2 uDOM 実装が trait アクセスをサポートしなければならない属性とプロパティを掲げる。 各行に属性に可能なゲッタとセッタを挙げる。 「省略値」の列にそれぞれの属性またはプロパティに利用しなければならない 省略値 が指定される。 「省略値」の列が空のものには 省略値 が存在しない。 特に「コメント」の列に明記されていない限り、サポートされる属性はそれが属せるすべての要素においてアクセス可能になる。 属性の一覧および、属性がどの要素に属せるかについては 属性一覧 を見よ。 Trait access is not required on all of the SVG Tiny 1.2 attributes and properties. The table below shows the attributes and properties that SVG Tiny 1.2 uDOM implementations must support trait access to. Each attribute row lists the allowed getters and setters. The "Lacuna Value" column specifies the lacuna value that must be used for each attribute or property. If a "Lacuna Value" column entry is empty, there is no lacuna value. Unless explicitly stated in the "Comments" column, a supported attribute is accessible on all elements it can belong to. See the attribute table for a list of attributes and which elements they belong to.
複数のバージョンの SVG をサポートする実装は、最も広範なセットの trait アクセスをサポートしなければならない。 各 trait でサポートされる型についても最も広範なセットをサポートしなければならない。 しかしながら、将来版で利用できる trait や trait の型に依存する内容がすべての適合 SVG Tiny 1.2 uDOM 実装で動作するとは限らない。 Implementations that support multiple versions of SVG must allow trait access to the most extensive set and support the types supported by each trait in the most extensive set. However, content relying on traits or trait types available in future versions may not work in all conformant SVG Tiny 1.2 uDOM implementations.
UA はサポートしない trait に対する trait メソッドの利用が試みられた際には、 NOT_SUPPORTED_ERR をレイズしなければならない。 The user agent must raise a NOT_SUPPORTED_ERR whenever there is an attempt to use trait methods for traits which are not supported by the user agent.
一部の属性とデータ型には 追加規則 が適用される。 これらの規則は一覧表の下で定義される。 For some of the attributes and data types additional rules apply. These rules are defined below the table.
注記: 下の表で: Note: In the table below:
getTrait
メソッドをサポートしなければならない旨が示されている所では常に
getTraitNS
,
getPresentationTrait
,
getPresentationTraitNS
メソッドもサポートしなければならない。
Wherever the table indicates that a user agent must support the getTrait method, it must also support the getTraitNS, getPresentationTrait , and getPresentationTraitNS methods.
getTraitNS
メソッドをサポートしなければならない旨が示されている所では常に
getPresentationTraitNS
メソッドもサポートしなければならない。
Wherever the table indicates that a user agent must support the getTraitNS method, it must also support the getPresentationTraitNS method.
getFloatTrait
など)をサポートしなければならない旨が示されている所では常に、対応する trait presentation ゲッタメソッド(
getFloatPresentationTrait
など)もサポートしなければならない。
Wherever the table indicates that a user agent must support one of the typed (i.e., non-string) trait getter methods (e.g., getFloatTrait), it must also support the corresponding trait presentation getter method (e.g., getFloatPresentationTrait).
setTrait
メソッドをサポートしなければならない旨が示されている所では常に
setTraitNS
メソッドもサポートしなければならない。
Wherever the table indicates that a user agent must support the setTrait method, it must also support the setTraitNS method.
trait の対象 | trait ゲッタ [返り値] |
trait セッタ [引数] |
省略値 | コメント |
---|---|---|---|---|
要素の テキスト内容 |
getTrait("#text") [The element text content] |
setTrait("#text", ...) [New element text content] |
テキスト内容へのアクセス を見よ。 | |
accumulate 属性 |
getTrait("accumulate") [none | sum] |
setTrait("accumulate", ...) [none | sum] |
"none" | |
additive 属性 |
getTrait("additive") [replace | sum] |
setTrait("additive", ...) [replace | sum] |
"replace" | |
attributeName 属性 |
getTrait("attributeName") |
setTrait("attributeName", ...) |
||
audio-level プロパティ |
getFloatTrait("audio-level") [0 ≤ value ≤ 1] |
setFloatTrait("audio-level", ...) [0 ≤ value ≤ 1] setTrait("audio-level", ...) [inherit] |
1.0 | |
baseProfile 属性 |
getTrait("baseProfile") |
setTrait("baseProfile", ...) |
"none" | |
begin 属性 |
N/A | setTrait("begin", ...) |
||
calcMode 属性 |
getTrait("calcMode") [discrete | linear | paced | spline] |
setTrait("calcMode", ...) [discrete | linear | paced | spline] |
animateMotion 要素にアクセスした場合は "paced", 他の場合は "linear" | |
color プロパティ |
getRGBColorTrait("color") [null,
SVGRGBColor] |
setRGBColorTrait("color, ...") setTrait("color", ...) [inherit |
<color>] |
rgb(0,0,0) | |
cx 属性 |
getFloatTrait("cx") |
setFloatTrait("cx", ...) |
radialGradient 要素にアクセスした場合は 0.5, 他の場合は 0.0 | |
cy 属性 |
getFloatTrait("cy") |
setFloatTrait("cy", ...) |
radialGradient 要素にアクセスした場合は 0.5, 他の場合は 0.0 | |
d 属性 |
getPathTrait("d") [SVGPath] |
setPathTrait("d", ...) [SVGPath] |
パス区分の無い SVGPath オブジェクト | パス属性へのアクセス規則 を見よ。 |
display プロパティ |
getTrait("display") [inline | none] |
setTrait("display", ...) [inline | none | inherit] |
"inline" | display プロパティへのアクセス規則 を見よ。 |
dur 属性 |
N/A | setTrait("dur", ...) |
||
editable 属性 |
getTrait("editable") [simple | none] |
setTrait("editable", ...) [simple | none] |
"none" | |
end 属性 |
N/A | setTrait("end", ...) |
||
fill プロパティ |
getRGBColorTrait("fill") [null,
SVGRGBColor] getTrait("fill") |
setRGBColorTrait("fill", ...) setTrait("fill", ...) |
rgb(0,0,0) | アニメーション要素の fill 属性への trait アクセサは存在しない。 |
fill-opacity プロパティ |
getFloatTrait("fill-opacity") [0 ≤ value ≤ 1] |
setFloatTrait("fill-opacity", ...) [0 ≤ value ≤ 1] setTrait("fill-opacity", ...) [inherit] |
1.0 | |
fill-rule プロパティ |
getTrait("fill-rule") [nonzero | evenodd] |
setTrait("fill-rule", ...) [nonzero | evenodd | inherit] |
"nonzero" | |
focusable 属性 |
getTrait("focusable") [true | false] |
setTrait("focusable", ...) [true | false | auto] |
"auto" | |
focusHighlight 属性 |
getTrait("focusHighlight") [auto | none] |
setTrait("focusHighlight", ...) [auto | none] |
"auto" | |
font-family プロパティ |
getTrait("font-family") |
setTrait("font-family", ...) [<font-family-value>
| inherit] |
UA 依存 | フォントプロパティへのアクセス規則 を見よ。 |
font-size プロパティ |
getFloatTrait("font-size") [value ≥ 0] |
setFloatTrait("font-size", ...) [value ≥ 0] setTrait("font-size", ...) [xx-small | x-small | small | medium | large | x-large | xx-large | larger | smaller | inherit] |
UA 依存 | |
font-style プロパティ |
getTrait("font-style") [normal | italic | oblique] |
setTrait("font-style", ...) [normal | italic | oblique | inherit] |
"normal" | フォントプロパティへのアクセス規則 を見よ。 |
font-weight プロパティ |
getTrait("font-weight") [100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900] |
setTrait("font-weight", ...) [normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit] |
"normal" | フォントプロパティへのアクセス規則 を見よ。 |
from 属性 |
N/A | setTrait("from", ...) |
||
gradientUnits 属性 |
getTrait("gradientUnits") [userSpaceOnUse | objectBoundingBox] |
setTrait("gradientUnits", ...) [userSpaceOnUse | objectBoundingBox] |
"objectBoundingBox" | |
height 属性 |
getFloatTrait("height") [value ≥ 0] getTrait("height") ["auto"] |
setFloatTrait("height", ...) [value ≥ 0] setTrait("height", ...) ["auto"] |
textArea 要素にアクセスした場合は "auto", 他の場合は 0.0 | width と height 属性へのアクセス規則 を見よ。 |
id 属性 |
getTrait("id") |
setTrait("id", ...) |
||
keyPoints 属性 |
N/A | setTrait("keyPoints", ...) |
||
keySplines 属性 |
N/A | setTrait("keySplines", ...) |
||
keyTimes 属性 |
N/A | setTrait("keyTimes", ...) |
||
max 属性 |
N/A | setTrait("max", ...) |
||
min 属性 |
N/A | setTrait("min", ...) |
||
nav-right 属性 |
getTrait("nav-right") [auto | self |
<FuncIRI>] |
setTrait("nav-right", ...) [auto | self |
<FuncIRI>] |
"auto" | |
nav-next 属性 |
getTrait("nav-next") [auto | self |
<FuncIRI>] |
setTrait("nav-next", ...) [auto | self |
<FuncIRI>] |
"auto" | |
nav-up 属性 |
getTrait("nav-up") [auto | self |
<FuncIRI>] |
setTrait("nav-up", ...) [auto | self |
<FuncIRI>] |
"auto" | |
nav-up-right 属性 |
getTrait("nav-up-right") [auto | self |
<FuncIRI>] |
setTrait("nav-up-right", ...) [auto | self |
<FuncIRI>] |
"auto" | |
nav-up-left 属性 |
getTrait("nav-up-left") [auto | self |
<FuncIRI>] |
setTrait("nav-up-left", ...) [auto | self |
<FuncIRI>] |
"auto" | |
nav-prev 属性 |
getTrait("nav-prev") [auto | self |
<FuncIRI>] |
setTrait("nav-prev", ...) [auto | self |
<FuncIRI>] |
"auto" | |
nav-down 属性 |
getTrait("nav-down") [auto | self |
<FuncIRI>] |
setTrait("nav-down", ...) [auto | self |
<FuncIRI>] |
"auto" | |
nav-down-right 属性 |
getTrait("nav-down-right") [auto | self |
<FuncIRI>] |
setTrait("nav-down-right", ...) [auto | self |
<FuncIRI>] |
"auto" | |
nav-down-left 属性 |
getTrait("nav-down-left") [auto | self |
<FuncIRI>] |
setTrait("nav-down-left", ...) [auto | self |
<FuncIRI>] |
"auto" | |
nav-left 属性 |
getTrait("nav-left") [auto | self |
<FuncIRI>] |
setTrait("nav-left", ...) [auto | self |
<FuncIRI>] |
"auto" | |
offset 属性 |
getFloatTrait("offset") [0 ≤ value ≤ 1] |
setFloatTrait("offset", ...) [0 ≤ value ≤ 1] |
0.0 | |
opacity プロパティ |
getFloatTrait("opacity") [0 ≤ value ≤ 1] |
setFloatTrait("opacity", ...) [0 ≤ value ≤ 1] setTrait("opacity", ...) [inherit] |
1.0 | |
path 属性 |
getPathTrait("path") [SVGPath] |
setPathTrait("path", ...) [SVGPath] |
パス区分の無い SVGPath オブジェクト | パス属性へのアクセス規則 を見よ。 |
points 属性 |
getFloatListTrait("points") |
setFloatListTrait("points", ...) |
||
r 属性 |
getFloatTrait("r") [value ≥ 0] |
setFloatTrait("r", ...) [value ≥ 0] |
radialGradient 要素にアクセスした場合は 0.5, 他の場合は 0.0 | |
repeatCount 属性 |
N/A | setTrait("repeatCount", ...) |
||
repeatDur 属性 |
N/A | setTrait("repeatDur", ...) |
||
restart 属性 |
getTrait("restart") [always | whenNotActive | never] |
setTrait("restart", ...) [always | whenNotActive | never] |
"always" | |
rx 属性 |
getFloatTrait("rx") [value ≥ 0] |
setFloatTrait("rx", ...) [value ≥ 0] |
0.0 | |
ry 属性 |
getFloatTrait("ry") [value ≥ 0] |
setFloatTrait("ry", ...) [value ≥ 0] |
0.0 | |
snapshotTime 属性 |
getFloatTrait("snapshotTime") [value ≥ 0] |
setFloatTrait("snapshotTime", ...) [value ≥ 0] |
0.0 | |
solid-color プロパティ |
getRGBColorTrait("solid-color") [null,
SVGRGBColor] |
setRGBColorTrait("solid-color", ...) setTrait("solid-color", ...) [<color>
| inherit] |
rgb(0,0,0) | |
solid-opacity プロパティ |
getFloatTrait("solid-opacity") [0 ≤ value ≤ 1] |
setFloatTrait("solid-opacity", ...) [0 ≤ value ≤ 1] setTrait("solid-opacity") [inherit] |
1.0 | |
stop-color プロパティ |
getRGBColorTrait("stop-color") [null,
SVGRGBColor] getTrait("stop-color") [none |
<color>] |
setRGBColorTrait("stop-color", ...) setTrait("stop-color") [none | currentColor |
<color>
| inherit] |
rgb(0,0,0) | |
stop-opacity プロパティ |
getFloatTrait("stop-opacity") [0 ≤ value ≤ 1] |
setFloatTrait("stop-opacity", ...) [0 ≤ value ≤ 1] setTrait("stop-opacity", ...) [inherit] |
1.0 | |
stroke プロパティ |
getRGBColorTrait("stroke") [null,
SVGRGBColor] getTrait("stroke") |
setRGBColorTrait("stroke", ...) setTrait("stroke", ...) |
"none" | |
stroke-dasharray プロパティ |
getFloatListTrait("stroke-dasharray") getTrait("stroke-dasharray") [none, inherit] |
setFloatListTrait("stroke-dasharray", ...) setTrait("stroke-dasharray", ...) [none, inherit] |
"none" | |
stroke-dashoffset プロパティ |
getFloatTrait("stroke-dashoffset") |
setFloatTrait("stroke-dashoffset", ...) |
0.0 | |
stroke-linecap プロパティ |
getTrait("stroke-linecap") [butt | round | square] |
setTrait("stroke-linecap", ...) [butt | round | square | inherit] |
"butt" | |
stroke-linejoin プロパティ |
getTrait("stroke-linejoin") [miter | round | bevel] |
setTrait("stroke-linejoin", ...) [miter | round | bevel | inherit] |
"miter" | |
stroke-miterlimit プロパティ |
getFloatTrait("stroke-miterlimit") [value ≥ 1] |
setFloatTrait("stroke-miterlimit") [value ≥ 1] setTrait("stroke-miterlimit", ...) [inherit]
|
4.0 | |
stroke-opacity プロパティ |
getFloatTrait("stroke-opacity") [0 ≤ value ≤ 1] |
setFloatTrait("stroke-opacity", ...) [0 ≤ value ≤ 1] setTrait("stroke-opacity", ...) [inherit] |
1.0 | |
stroke-width プロパティ |
getFloatTrait("stroke-width") [value ≥ 0] |
setFloatTrait("stroke-width", ...) [value ≥ 0] setTrait("stroke-width", ...) [inherit] |
1.0 | |
target 属性 |
getTrait("target") |
setTrait("target", ...) |
"_self" | |
text-anchor プロパティ |
getTrait("text-anchor") [start | middle | end] |
setTrait("text-anchor", ...) [start | middle | end | inherit] |
"start" | |
to 属性 |
N/A | setTrait("to", ...) |
||
transform 属性 |
getMatrixTrait("transform") getTrait("transform") |
setMatrixTrait("transform", ...) setTrait("transform", ...) [<transform-list>
|
<transform-ref>
| none] |
単位行列 (1,0,0,1,0,0) | transform 属性へのアクセス規則 を見よ。 |
type 属性 |
getTrait("type") [translate | scale | rotate | skewX | skewY] |
setTrait("type", ...) [translate | scale | rotate | skewX | skewY] |
animateTransform 要素の 'type' 属性には trait アクセサが存在する。 audio, handler, image, script, video いずれの要素の 'type' 属性にも trait アクセサは存在しない。 | |
values 属性 |
N/A | setTrait("values", ...) |
||
vector-effect プロパティ |
getTrait("vector-effect") [none | non-scaling-stroke] |
setTrait("vector-effect", ...) [none | non-scaling-stroke | inherit] |
"none" | |
version 属性 |
getTrait("version") |
setTrait("version", ...) |
UA 依存 | |
viewBox 属性 |
getRectTrait("viewBox") [ null |
SVGRect] |
setRectTrait("viewBox", ...) [SVGRect] setTrait("viewBox", ...) [none] |
null |
viewBox
属性が値 'none' の場合、
getRectTrait
メソッド は null を返す。
|
viewport-fill プロパティ |
getRGBColorTrait("viewport-fill") [null,
SVGRGBColor] getTrait("viewport-fill") [none |
<color>] |
setRGBColorTrait("viewport-fill", ...) setTrait("viewport-fill", ...) [none | currentColor |
<color>
| inherit] |
"none" | |
viewport-fill-opacity プロパティ |
getFloatTrait("viewport-fill-opacity") [0 ≤ value ≤ 1] |
setFloatTrait("viewport-fill-opacity", ...) [0 ≤ value ≤ 1] setTrait("viewport-fill-opacity", ...) [inherit] |
1.0 | |
visibility プロパティ |
getTrait("visibility") [visible | hidden] |
setTrait("visibility", ...) [visible | hidden | inherit] |
"visible" | |
width 属性 |
getFloatTrait("width") [value ≥ 0] getTrait("width") ["auto"]
|
setFloatTrait("width", ...) [value ≥ 0] setTrait("width", ...) ["auto" ] |
textArea 要素にアクセスした場合は "auto", 他の場合は 0.0 | width と height 属性へのアクセス規則 を見よ。 |
x 属性 |
getFloatTrait("x") getFloatListTrait("x") |
setFloatTrait("x", ...) setFloatListTrait("x", ...) |
0.0 | x と y 属性へのアクセス規則 を見よ。 |
x1 属性 |
getFloatTrait("x1") |
setFloatTrait("x1", ...) |
0.0 | |
x2 属性 |
getFloatTrait("x2") |
setFloatTrait("x2", ...) |
linearGradient 要素にアクセスした場合は 1.0, 他の場合は 0.0 | |
xlink:href 属性 |
getTraitNS("http://www.w3.org/1999/xlink", "href") [absolute IRI] |
setTraitNS("http://www.w3.org/1999/xlink", "href", ...) |
"" | |
y 属性 |
getFloatTrait("y") getFloatListTrait("y") |
setFloatTrait("y", ...) setFloatListTrait("y", ...) |
0.0 | x と y 属性へのアクセス規則 を見よ。 |
y1 属性 |
getFloatTrait("y1") |
setFloatTrait("y1", ...) |
0.0 | |
y2 属性 |
getFloatTrait("y2") |
setFloatTrait("y2", ...) |
0.0 | |
zoomAndPan 属性 |
getTrait("zoomAndPan") [disable | magnify] |
setTrait("zoomAndPan", ...) [disable | magnify] |
"magnify" |
SVG Tiny 1.2 の
transform
属性が取り得る値の型は3種類になる:「通常の」変換リスト(拡縮, 並進, 回転, 行列, 等々), 新たに導入された 'ref(svg)' 型, 'none' 。
いずれの場合においても
getMatrixTrait
は現在の行列の評価を返す。
利用者が
transform
属性の値が 'ref' または 'none' だったかどうか知る必要がある場合、
getTrait
を用いなければならない。
利用者は
setTrait
用いて
transform
属性を 'ref(svg)' や 'none' に設定できる。
The 'transform' attribute in SVG Tiny 1.2 can have three types of values. The "normal" transformation list (e.g. scale, translate, rotate, matrix, etc.), the newly introduced 'ref(svg)' type or 'none'. getMatrixTrait returns the current evaluated matrix in all cases. If the user needs to know that the 'transform' attribute value was a 'ref' or a 'none', getTrait must be used. By using setTrait the user can set the 'transform' attribute to 'ref(svg)' or 'none'.
下位互換性の理由から trait の仕組みによる
display
値へのアクセスは 'none' と 'inline' に限定される。
他のすべての値は 'none' または 'inline' に変換される。
display
値に可能なすべての値の一覧は
可視性の制御
を見よ。
)
他の
display
値を扱うためには、例えば利用者が display を 'block' に設定することを望む場合、より汎用の
getAttributeNS
/
setAttributeNS
を用いなければならない。
しかしながら、 SVG Tiny 1.2 UA には
display の正規化
に述べたように、その属性データの正規化が許容されていることに注意。
Due to backward compatibility reasons the 'display' values accessible via the trait mechanism are limited to 'none' and 'inline', all other values are translated into 'none' or 'inline'. (For a list of all possible 'display' values, see Controlling visibility.) If other 'display' values are of interest, e.g. the user want to set display to 'block', the more generic getAttributeNS/setAttributeNS must be used. Note however that an SVG Tiny 1.2 user agent is allowed to normalize its attribute data as described in Display normalization.
以下の規則が SMIL アニメーション要素( animate, animateTransform, animateColor, animateMotion, set, discard )に適用される。 The following rule applies to SMIL animation elements ('animate', 'animateTransform', 'animateColor', 'animateMotion', 'set' , 'discard').
これらの要素は木への挿入や木からの除去はできるが、一旦木に挿入された後は
TraitAccess
メソッドでは変更できない。
そのような試みが行われた場合、
TraitAccess
メソッドは NOT_SUPPORTED_ERR の
DOMException
を投げる。
Element
インターフェースの
setAttribute
や
setAttributeNS
メソッドにより要素を変更した場合、文書は変化するが、アニメーションには効果を及ぼさない。
These elements can be inserted and removed from the tree but they cannot be modified using the TraitAccess methods once inserted into the tree. If an attempt is made to do so, the TraitAccess method will throw a DOMException with code NOT_SUPPORTED_ERR. Modifying the element using the setAttribute and setAttributeNS methods of the Element interface will change the document, but will have no effect on the animation.
この制約は文書作成者がスクリプトを通したアニメーションの追加を望む場合、アニメーション要素の属性は木へ挿入される前に変更されなければならないことを意味する。 下に関連の属性を挿入前に設定して文書へアニメーションを追加する例を示す。 This restriction means that if the author wishes to add animations via script, the attributes of the animation elements must be modified before being inserted into the tree. The following is an example of adding an animation to the document, setting the relevant attributes prior to insertion.
<svg version="1.2" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xml:id="svg-root" width="100%" height="100%" viewBox="0 0 480 360"> <rect xml:id="myRect" fill="green" x="10" y="10" width="200" height="100" stroke="black" stroke-width="2"/> </svg>
SVGElement newAnimate = (SVGElement)document.createElementNS(svgNS, "animate"); newAnimate.setTrait("attributeName", "fill"); newAnimate.setTrait("from", "red"); newAnimate.setTrait("to", "blue"); newAnimate.setTrait("dur", "5"); newAnimate.setTrait("repeatCount", "10"); Element myRect = document.getElementById("myRect"); myRect.appendChild(newAnimate);
getFloatTrait
が
text
要素の
x
や
y
属性の取得に用いられる際に、属性値に複数の
<coordinate>
が含まれている場合、エラーコード TYPE_MISMATCH_ERR の
DOMException
がレイズされなければならない。
属性値が1つだけの座標成分を持つ場合、これは
getFloatTrait
から返される値になる。
If getFloatTrait is used to retrieve the value of the 'x' or 'y' attribute on a 'text' element, where the attribute value has more than one <coordinate>, a DOMException with error code TYPE_MISMATCH_ERR must be raised. When the attribute value has only one coordinate, this is the value returned by getFloatTrait.
getFloatListTrait
または
setFloatListTrait
が
text
要素以外の要素に用いられる場合、エラーコード TYPE_MISMATCH_ERR の
DOMException
がレイズされなければならない。
If getFloatListTrait or setFloatListTrait are used on elements other than a 'text' element, a DOMException with error code TYPE_MISMATCH_ERR must be raised.
getFloatTrait
が
svg
要素の
width
や
height
属性の取得に用いられる際に、属性値が百分率もしくは単位付きで指定されていた場合、エラーコード TYPE_MISMATCH_ERR の
DOMException
がレイズされなければならない。
If getFloatTrait is used to retrieve the value of the 'width' or 'height' attribute on an 'svg' element, where the value is specified as a percentage or unit value, a DOMException with error code TYPE_MISMATCH_ERR must be raised.
font-face 要素の font-family, font-style, font-weight プロパティの取得や設定に trait アクセサが用いられた場合、エラーコード NOT_SUPPORTED_ERR の DOMException がレイズされなければならない。 If trait accessors are used to get or set the 'font-family', 'font-style' or 'font-weight' properties on a 'font-face' element, a DOMException with error code NOT_SUPPORTED_ERR must be raised.
getPathTrait メソッドが SVGPath の取得に利用される際に、パス属性内のどこかに構文上の誤りがあった場合、返り値は誤りが生じた手前までの有効なパス区分すべてを含む SVGPath でなければならない。 If the getPathTrait method is used to get an SVGPath and the path attribute was syntactically invalid at some point, the return value must be an SVGPath containing all valid path segments until the point of the error.
以下の規則がマルチメディア要素( audio, video, animation )に適用される。 The following rule applies to multimedia elements ('audio', 'video', 'animation').
一旦木へ挿入後は
TraitAccess
メソッドを利用した
SVG タイミング属性
の変更はできない。
そのような試みが行われた場合、
TraitAccess
メソッドはコード NOT_SUPPORTED_ERR の
DOMException
を投げることになる。
Element
インターフェースの
setAttribute
や
setAttributeNS
メソッドによりこれらの属性を変更した場合、文書は変化するが、要素には効果を及ぼさない。
SVG timing attributes cannot be modified using the TraitAccess methods once inserted into the tree. If an attempt is made to do so, the TraitAccess method will throw a DOMException with code NOT_SUPPORTED_ERR. Modifying these attributes using the setAttribute and setAttributeNS methods of the Element interface will change the document, but will have no effect on the element.
このインターフェースは文書木内の SVG 要素 を表現する。 これは uDOM 木内で要素を辿るメソッドを提供し、要素の id の設定や取得を可能にする。 This interface represents an SVG element in the document tree. It provides methods to traverse elements in the uDOM tree and allows setting and getting the 'id' of an element.
注記: id と xml:id の扱い方の規則については id と xml:id の定義 を見よ。 Note: See the definition of 'id' and 'xml:id' for the rules of how to treat 'id' and 'xml:id'.
interface SVGElement : Element, EventTarget, TraitAccess { attribute DOMString id; };
読み取り時は
文書構造の章
で定められる規則に従い、要素の
xml:id
または
id
属性を返す。
あるいは ID が指定されていない場合は null
を返す。
On read, returns the element's 'xml:id' or 'id' attribute according to the rules defined in the Structure chapter, or null if no ID specified.
書き込み時は 文書構造の章 で定められる規則に従い、要素の xml:id または id 属性を設定する。 On write, sets the element's 'xml:id' or 'id' attributes according to the rules defined in the Structure chapter.
interface SVGTimedElement : SVGElement, smil::ElementTimeControl { void pauseElement(); void resumeElement(); readonly attribute boolean isPaused; };
true
。
そうでない場合は false
。
一時停止状態の要素と活動持続時間
([SMIL21], 10.4.3 節)
を参照のこと。
停止状態にある(活動持続時間の終端まで到達した)要素は一時停止状態ではないことに注意。
true if the timed element is paused. false otherwise. See Paused element and the active duration ([SMIL21], section 10.4.3). Note that an element that is stopped (has reached the end of its active duration) is not paused.
このインターフェースは次の SMIL アニメーション要素: animate, animateTransform, animateColor, animateMotion, set に実装される。 これは歴史的な理由により含まれているものであり、廃止予定にある。 このインターフェースは animation 要素とは無関係なことに注意。 This interface is implemented by the following SMIL animation elements: 'animate', 'animateTransform', 'animateColor', 'animateMotion' and 'set'. It is included for historical reasons and has been deprecated. Note that this interface is unrelated to the new 'animation' element.
interface SVGAnimationElement : SVGTimedElement { };
interface SVGVisualMediaElement : SVGLocatableElement, SVGTimedElement { };
SVGTimer
インターフェースは1つの時刻または相対イベントのスケジュールを組む API を提供する。
SVGTimer
オブジェクトは常に実行中( running :属性
running
が true
)または待機中( waiting :属性
running
が false
)いずれかの状態にある。
タイマーのそれぞれの時区間に対し
SVGTimer
型の
Event
が誘発される。
The SVGTimer interface provides an API for scheduling a one time or repetitive event. A SVGTimer object is always either in the running (attribute running is true) or waiting (attribute running is false) state. After each interval of the timer, an Event of type SVGTimer is triggered.
SVGTimer
イベントはタイマー
が
実行中
のときにのみ誘発される。
SVGTimer
イベントは標的上【target phase】に制限される。
SVGTimer
は
EventTarget
なので、
SVGTimer
をイベント型とする
addEventListener
を用いて
EventListener
を登録できる。
イベントリスナはイベントオブジェクトの target プロパティを通して対応する SVGTimer オブジェクトへアクセスできる。
SVGTimer events are triggered only when the timer is in the running state. The SVGTimer event is limited to the target phase. Since SVGTimer is an EventTarget, EventListeners can be registered on it using addEventListener with SVGTimer as the event type. Event listeners can access their corresponding SVGTimer object through the event object's target property.
SVGTimer
インターフェースは SVGGlobal
インターフェースの
createTimer
メソッドを用いて作成される。
SVGTimer instances are created using the createTimer method of the SVGGlobal interface.
interface SVGTimer : events::EventTarget { attribute long delay; attribute long repeatInterval; readonly attribute boolean running; void start(); void stop(); };
この属性は次のイベントが発火されるまでの残り時間をミリ秒で指定する。
SVGTimer
が実行中
の間は、この属性は現在の時区間の残り時間を反映して動的に更新される。
SVGTimer
が待機中
の場合、停止された時点での残り時間が delay に反映される。
delay 属性の取得時には現在の値、すなわちその時点での残りの delay が返される。
オブジェクトが実行中
のときに delay 期間が終了すると、 SVGTimer
オブジェクトは SVGTimer
型の Event
を誘発することになる。
このとき、 delay は
repeatInterval
値に更新され、新たな秒読みが開始される。
delay を設定することにより現在の時区間は新たな値に再設定される。
この属性が 0
の場合、イベントは可能な限り早くに誘発される。
負値をあてがうことは
stop()
メソッドを呼び出すことに等しい。
初期値は SVGGlobal
インターフェースの
createTimer
メソッドの initialInterval パラメタを通して設定され、 SVGTimer
の最初の時区間を定める。
This attribute specifies the time remaining in milliseconds until the next event is fired. When the SVGTimer is in the running state this attribute is dynamically updated to reflect the remaining time in the current interval. When the SVGTimer is waiting the delay reflects the time that remained when stopped. Getting the delay attribute returns the current value, i.e. a snapshot value of the remaining delay. After delay period has passed while the object is in the running state, the SVGTimer object will trigger an Event of type SVGTimer. The delay will then be updated with the repeatInterval value and a new count down will start. Setting the delay resets the current interval to the new value. If this attribute is 0, it means that the event will be triggered as soon as possible. Assigning a negative value is equivalent to calling the stop() method. The initial value is set through the initialInterval parameter in the createTimer method on the SVGGlobal interface, and defines the first interval of the SVGTimer.
この属性は
SVGTimer
の各反復の時区間、すなわち初期の時区間に後続する各タイマー時区間をミリ秒で指定する。
この属性の初期値は SVGGlobal
インターフェースの
createTimer
メソッドの repeatInterval
パラメタを通して設定される。
負値があてがわれるとイベント誘発の反復は行われなくなり、
delay
経過後にイベントを誘発する1度限りのタイマーになる。
This attribute specifies in milliseconds the interval for each repeat of the SVGTimer, i.e. each timer interval subsequent to the initial interval. The initial value of this attribute is set through the repeatInterval parameter in the createTimer method on the SVGGlobal interface. Assigning a negative value disables the repetitive triggering of the event making it a one time timer which triggers an event after the delay.
SVGTimer
の状態。
タイマーが実行中は値 true
, 待機中のときは false
になる。
タイマーが停止されている場合、
repeatInterval
と
delay
プロパティは非負になり得ることに注意(ただし delay
が負の場合、タイマーは停止される)。
SVGTimer state. Value is true if the timer is running, false if the timer is waiting. Note that the repeatInterval and delay properties can be non-negative if the timer is stopped (but if delay is negative, the timer is stopped).
SVGTimer
の状態を
実行中
に変える。
タイマーがすでに実行中にあるときは何もしない。
タイマーは初期状態では
待機中
なので、このメソッドで開始しなければならない。
開始時にタイマーの
delay
が負値だった場合、例えば delay が負値に設定されて停止されていた場合、 delay の値は、このメソッドが呼び出される際に
repeatInterval
に再設定される。
Changes the SVGTimer state into running. If the timer is already in the running state, it has no effect. Initially the timer is waiting, and must be started with this method. If the timer delay had a negative value when started, for example if the time had been stopped by setting the delay to a negative value, the delay value is reset to repeatInterval when the this method is called.
存在する多くのスクリプトを用いる SVG 文書はブラウザ固有の Window インターフェースの機能を利用している。
SVG Tiny 1.2 は、この仕様で定められる新たな特色機能と伴にこれらの事実上の標準機能の一部を定義する
SVGGlobal
インターフェースを指定する。
SVGGlobal
インターフェースは文書の
デフォルトビュー
([DOM2VIEWS], 1.1 節)
を表現するオブジェクトに実装されなければならない。
このオブジェクトは
AbstractView
も実装する。
従って ECMAScript 言語束縛においては、グローバルスクリプトオブジェクトが
SVGGlobal
を実装する。
文書の
SVGGlobal
オブジェクトは
DocumentView::defaultView
を通しても取得できる。
Many scripted SVG documents in existence make use of functions on a browser specific Window interface. SVG Tiny 1.2 specifies an SVGGlobal interface, on which some of these de facto standard functions are defined, as well as some functions for new features defines in this specification. The SVGGlobal interface must be implemented by the object that represents the default view of the document ([DOM2VIEWS], section 1.1). This object also implements AbstractView. Thus, in the ECMAScript language binding, the global script object implements SVGGlobal. The SVGGlobal object for a document can also be obtained through DocumentView::defaultView.
interface SVGGlobal { SVGTimer createTimer(in long initialInterval, in long repeatInterval); void getURL(in DOMString iri, in AsyncStatusCallback callback); void postURL(in DOMString iri, in DOMString data, in AsyncStatusCallback callback, in DOMString type, in DOMString encoding); Node parseXML(in DOMString data, in Document contextDoc); };
SVGTimer
の初期状態は
待機中
になる。
Creates a SVGTimer with the provided initial and repeat Intervals. The SVGTimer will initially be in the waiting state.
in long initialInterval |
SVGTimer
が反復し得る場合は最初の時区間をミリ秒で指定する。
すなわち、タイマーの
delay
属性の初期値を設定する。
SVGTimer が反復しない場合、1度限りのタイマー時区間を指定する。
このパラメタを負値に設定しても待機中の SVGTimer が作成されることになる。
Specifies the first interval in milliseconds for a repetitive SVGTimer, i.e. sets the initial value of the delay attribute on the timer. In the case the SVGTimer is not repetitive, it specifies the interval for the one time timer. Setting this parameter with a negative value will create an SVGTimer which is in the waiting state.
|
in long repeatInterval |
SVGTimer
が初期の時区間に続いて反復する際の時区間の長さを指定する。
負値にすると SVGTimer は1度限りのタイマーになる。
Specifies the time interval on which the SVGTimer repeats subsequent to the initial interval. A negative value will make the SVGTimer a one time timer.
|
与えられた IRI とコールバック関数が呼び出される AsyncStatusCallback オブジェクトに対し、このメソッドはその IRI のリソースの取得を試みる。 IRI が HTTP または HTTPS スキームを利用する場合、 HTTP GET メソッドが利用されることになる。 実装は他のスキームをサポートしてもよいが、要求はされない。 Given an IRI and an AsyncStatusCallback object on which to call a callback function, this method will attempt to fetch the resource at that IRI. If the IRI uses the HTTP or HTTPS scheme, the HTTP GET method will be used. Implementations may support other schemes, but are not required to.
このメソッドの呼び出しは非同期でなければならない。 呼び出された際は、即時に呼び出し側の文脈に制御が戻され、一旦リクエストが完了すれば、コールバック関数が呼び出される。 このメソッドを複数回呼び出した場合、 FIFO 順に実行されなければならない。 This method call must take place asynchronously. When called, control returns immediately to the calling context, and once the request is completed the callback is called. Multiple calls to this method must be executed in FIFO order.
UA には HTTP リクエストの gzip 内容コーディングのサポートが要求される。 また、コールバックに渡す前にそれらの内容は復号されなければならない。 UA にはそれらが送信する gzip エンコーディング内容のサポートは要求されないが、そうすることが奨励される。 リクエスト間での状態維持のため、クッキーはサポートされるべきである。 UA は利用者にリクエストによる対話手段(例えば認証情報の入力など)を提供してもよいが要求はされない。 User agents are required to support the gzip content coding for HTTP requests and must decode such content before passing it on to the callback. User agents are not required to support gzip encoding content that they send, though they are encouraged to. Cookies should be supported so that state can be maintained across requests. User agents may provide the user with means to interact with the request (e.g. to enter authentication information) but are not required to.
安全性の理由から、 UA はこれらのリクエストを origin によるものに制約することが強く奨励される。そのような制約の実施においては、コールバックはその
AsyncURLStatus
オブジェクトの
success
フィールドを false
に設定し、他のフィールドは null
に設定した上で直ちに呼び出される。
リダイレクト応答( 3xx HTTP ステータスコード)は API を通して暴露されてはならず、 HTTP 仕様に従って内部的に処理されなければならない。
It is important to note that for security reasons, user agents are strongly encouraged to restrict these requests by origin. When enforcing such restrictions, the callback is called immediately with its AsyncURLStatus object's success field set to false and other fields set to null. Redirection responses (3xx HTTP status codes) must not be exposed through the API but rather they must be processed internally according to the HTTP specification.
in DOMString iri | リクエストされることになるリソースの IRI 。 The IRI of the resource that is being requested. |
in AsyncStatusCallback callback | リクエスト完了時にコールバックが呼び出されることになるオブジェクト。 The object on which the callback will be called upon completion of the request. |
与えられた
IRI
, 転送データ, コールバック関数が呼び出される
AsyncStatusCallback
オブジェクト, メディア型, 内容コーディングに対し、このメソッドはリクエストされたメディア型と内容コーディングを用いてデータを指定された IRI へポストする。
UA は HTTP または HTTPS IRI による postURL
をサポートしなければならないが、他の IRI スキームでも HTTP と機能互換なプロトコルであればサポートしてよい。
一旦リクエストが完了すれば、
AsyncStatusCallback
インターフェースに述べられるようにコールバック関数が呼び出される。
postURL
がポストする内容をサポートしない IRI の場合、あるいは HTTP 互換でないポストで行われた場合、コード NOT_SUPPORTED_ERR の
DOMException
が投げられなければならない。
Given an IRI, data to be transmitted, an AsyncStatusCallback object on which to call a callback function, a media type, and a content coding, this method will post the data to the specified IRI using the requested media type and content coding. User agents must support postURL being invoked with an HTTP or HTTPS IRI, but may support other IRI schemes if they indicate protocols that are functionally compatible with HTTP. Once the request has been completed the callback is invoked as described in the AsyncStatusCallback interface. If postURL is invoked with an IRI that does not support posting content, or which does not post content in a manner compatible with HTTP, a DOMException with code NOT_SUPPORTED_ERR must be thrown.
処理要件は
getURL
と同じだが、以下の注意と追加要件がある。
Processing requirements are the same as for getURL, with the following notes and additions.
text/plain
でなければならない。
When the content type parameter is set then the Content-Type header of the request must be set accordingly. If the syntax of the content type parameter does not match that of a media type, it must be ignored. If this parameter is not specified, then it must default to text/plain.
identity
のみである。
When the encoding parameter is set then the user agent must encode the submitted data with that HTTP content coding and set the Content-Encoding header accordingly, if it supports it. If it does not support it, then it must ignore it, must not set the Content-Encoding header, and must transmit the data with no encoding. The only required content coding is identity.
in DOMString iri | リクエストされているリソースの IRI 。 The IRI of the resource that is being requested. |
in DOMString data | POST リクエストの body になるデータ。 The data that will be the body of the POST request. |
in AsyncStatusCallback callback | リクエスト完了時にコールバックが呼び出されることになるオブジェクト。 The object on which the callback will be called upon completion of the request. |
in DOMString type | POST リクエストの content type 。 The content type of the POST request. |
in DOMString encoding | POST リクエストのエンコーディング。 The encoding of the POST request. |
与えられた文字列と
Document
オブジェクトに対し、文字列を XML 文書としてパースし、それを表現する
Node
を返す。
文字列内の XML が
XML 1.0
または
XML 1.1
に従う整形式でないか、あるいは
XML 名前空間 1.0
または
XML 名前空間 1.1
(同順)に従う名前空間整形式でない場合、このメソッドは値 null
を返さなければならない。
Given a string and a Document object, parse the string as an XML document and return a Node representing it. If the XML in the string is not well-formed according to either XML 1.0 or XML 1.1 or not namespace-well-formed according to Namespaces in XML 1.0 or Namespaces in XML 1.1 respectively, this method must return a null value.
入力文字列をパースする際は
contextDoc
パラメタは、パースされたノードの
ownerDocument
フィールドの設定にのみ用いられる。
When parsing the input string, the contextDoc parameter is used only for setting the ownerDocument field in the parsed nodes.
パース中に script 要素に遭遇した際は、その場で実行されてはならない。 現在の SVG 文書に挿入された場合にのみ実行されることになる。 If during parsing a 'script' element is encountered, it must not be executed at that time. It will only be executed if it inserted into the current SVG document.
パース完了には外部リソース、例えば:外部実体, スタイルシート, スクリプト, ラスター画像, 動画, 音声, 等々の読み込みは要求されない。 XSL スタイルシートは適用されなければならない。 There is no requirement to load any external resources, e.g. external entities, stylesheets, scripts, raster images, video, audio, etc., for the parsing to complete. XSL stylesheets must not be applied.
contextDoc
パラメタが定められている場合、このメソッドは
ownerDocument
フィールドを与えられた
Document
オブジェクトに設定した
Element
オブジェクトを返す。
contextDoc
パラメタが指定された場合の実際の処理は以下の段階を適用することに等しくなければならない:
If the contextDoc parameter is defined, this method returns an Element object the ownerDocument field of which must be set to be the provided Document object. In effect when the contextDoc parameter is specified the processing must be equivalent to applying the following steps:
documentElement
要素を取得。
retrieving its documentElement element
deep
パラメタは true
に設定して、
parseXML
に渡された
Document
オブジェクトの「
importNode
メソッド」を呼び出す。
( importNode
は DOM 3 Core の一部であり、 uDOM のものではないことに注意。
効果が importNode
が用いられたかのようでなければならないことを指示するためにここに挙げたのであり、実装のサポートを要求するものではない。)
calling importNode on the Document object passed to parseXML with the Element from the previous step as its first parameter and the deep parameter set to true. (Please note that importNode is part of DOM 3 Core but not of the uDOM. It is mentioned here to indicate that the effect must be as if importNode had been used, but not to require that it be supported in implementations.)
in DOMString data | XML としてパースされることになるデータ。 The data that is to be parsed as XML. |
in Document contextDoc | パースを行う文脈を与える Document オブジェクト。 The Document object in the context of which to perform the parsing. |
Node | パースされた内容を表現する Node ( Document または Element )。 A Node (either a Document or an Element) representing the content that was parsed. |
DOMException | INVALID_CHARACTER_ERR: パースされた XML の名前の1つでも contextDoc の文書の XML のバージョンに従う XML の名前でない場合にレイズされる。 INVALID_CHARACTER_ERR: Raised if one of the parsed XML names is not an XML name according to the XML version of the contextDoc document. |
このインターフェースは
getURL
や
postURL
(いずれもこのインターフェースのインスタンスをパラメタにとる)を通して取得された内容を処理する目的のコードにより実装される。
リクエストの完了時に、このインターフェースを実装するオブジェクトの
operationComplete
メソッドが呼び出される。
This interface is implemented by code that intends to process content retrieved through getURL or postURL, both of which take an instance of this interface as a parameter. The operationComplete method of the object implementing this interface is called upon completion of the request.
interface AsyncStatusCallback { void operationComplete(in AsyncURLStatus status); };
このメソッドは、
getURL
や
postURL
を用いてリソースを取得した結果の通知を受けるためにコードに実装される。
リクエスト完了時に、リソースの内容とリクエストに関する情報を保持する
AsyncURLStatus
オブジェクトを伴って、メソッドが呼び出される。
This method is implemented by code in order to be notified of the result of fetching a resource using getURL or postURL. Upon completion of the request, the method is called with an AsyncURLStatus object that holds the resource contents and information about the request.
in AsyncURLStatus status | HTTP レスポンスを表現するオブジェクト。 An object representing the HTTP response. |
このインターフェースは、HTTP リクエスト完了時に
operationComplete
メソッドに渡すための、種々の HTTP レスポンス情報を保持する。
This interface captures several aspects of an HTTP response in order to be passed to the operationComplete method upon completion of an HTTP request.
interface AsyncURLStatus { readonly attribute boolean success; readonly attribute DOMString contentType; readonly attribute DOMString content; };
リクエストが成功したかどうかを示す真偽値フィールド。 A boolean field indicating whether the request succeeded or not.
HTTP リクエストのレスポンスのステータスコードが 200 番台の場合、この属性は true に設定されなければならず, ステータスコード 400 と 500 番台の場合、 false に設定されなければならない。
ステータスコードが 100 番台の場合は無視されなければならず, 300 番台の場合は
getURL
に示されている処理要件に従って処理されなければならない。
For HTTP requests with response status codes in the 200 range, this attribute must be set to true, and for status codes in the 400 and 500 ranges it must be set to false. Status codes in the 100 range must be ignored and those in the 300 range must be processed as indicated in getURL's processing requirements.
非 HTTP リソースへの取得の際しては、この属性は、成功裏に全体が取得できた場合は true に、他の場合は false に設定されなければならない。 When fetching non-HTTP resources, this attribute must be set to true if the resource was successfully retrieved in full, and false otherwise.
レスポンスの media type を含む文字列。 A string containing the media type of the response.
HTTP リクエストに対しては、この属性は Content-Type HTTP ヘッダの値に設定されなければならない。
Content-Type ヘッダが存在しない場合、属性は null
に設定されなければならない。
For HTTP requests, this attribute must be set to the value of the Content-Type HTTP header. If there was no Content-Type header, the attribute must be set to null.
非 HTTP リソースの取得に際しては、この属性は null
に設定されなければならない。
When fetching non-HTTP resources, this attribute must be set to null.
取得されたリソースを含む文字列。 A string containing the contents of the fetched resource.
リソースが有効な文字の連なりでない場合( HTTP リクエスト の media type と他のヘッダに従って、あるいは非 HTTP リソースを適切に、解釈したものとして)、この属性は null に設定されなければならない。 If the resource is not a valid sequence of characters (as interpreted according to the media type and other headers for an HTTP request, or as appropriate for non-HTTP resources), then this attribute must be set to null.
HTTP リクエストのレスポンス body の media type が text/*
階層で charset パラメタが指定されていた場合、テキストはホストプログラミング言語に備わるエンコーディングに、それがサポートされているなら変換されなければならない。
エンコーディングがサポートされていない場合、このフィールドの値は null
でなければならない。
要求されるエンコーディングは UTF-8 と UTF-16 ( BE と LE )のみである。
HTTP レスポンス body に1つ以上の内容コーディングが適用されている場合、このフィールドが設定される前に完全に復号されなければならない。
HTTP レスポンスのステータスコードがエラーコードでありながら body も持つ場合、その body の内容は取り出されなければならない。
For HTTP requests, if the media type of the response body was in the text/* hierarchy and specified a charset parameter, then the text must be converted into the host programming language's native form if the encoding is supported. If the encoding is not supported, the value of this field must be null. The only required encodings are UTF-8 and UTF-16 (BE and LE). If the HTTP response body had one or more content codings applied to it then it must be fully decoded before setting this field. If the HTTP response status code was an error code but carried a body, the content of that body must still be exposed.
EventListenerInitializer2 インターフェースは、「グローバルオブジェクト」の概念を持たない言語で書かれたスクリプトにイベントリスナを初期化する手段を与えるために利用される。 特に Java のイベントリスナで利用されているが、この一般的な手法は他のその種のスクリプト言語にも通用し得るものになる。 EventListenerInitializer2 を実装するオブジェクトを見出して利用する方法の詳細については script 要素の記述を見よ。 The EventListenerInitializer2 interface is used to provide a way for scripts written in languages that do not have a concept of a "global object" to initialize their event listeners. Specifically, it is used for Java event listeners, but this general approach is suggested for other such scripting languages. See the description of the 'script' element for details on how the object implementing EventListenerInitializer2 is discovered and used.
interface EventListenerInitializer2 { void initializeEventListeners(in Element scriptElement); EventListener createEventListener(in Element handlerElement); };
指定された script 要素で与えられたスクリプトが実行されるべきであることを指示するために呼び出される。 Invoked to indicate that the script given by the specified 'script' element should be executed.
in Element scriptElement | 実行するスクリプトを特定する script 要素。 The 'script' element that identifies the script to execute. |
指定された handler 要素に対応する EventListener を取得するために呼び出される。 Invoked to obtain an EventListener that corresponds to the specified 'handler' element.
in Element handlerElement | 対応する EventListener を返す handler 要素。 The 'handler' element for which a corresponding EventListener is to be returned. |
EventListener | EventListener 。 The EventListener. |