目次詳細目次前章次章要素属性プロパティ

5 文書構造

目次

5.1 SVG 文書片を定義する: svg 要素

5.1.1 概観

SVG 文書片svg 要素とその中に含められる任意個数の SVG 要素から構成される。 An SVG document fragment consists of any number of SVG elements contained within an ‘svg’ element.

SVG 文書片は、空のもの(すなわち svg の中に何も含まれていないもの), rect, などの グラフィックス要素 をただ一つ含むごく単純なものから, コンテナ要素グラフィックス要素 から構築される複雑で深い入れ子構造を持つものまでになり得る。 An SVG document fragment can range from an empty fragment (i.e., no content inside of the ‘svg’ element), to a very simple SVG document fragment containing a single SVG graphics element such as a ‘rect’, to a complex, deeply nested collection of container elements and graphics elements.

SVG 文書片は、それ自身が独立した ファイルやリソースになれる。 その場合は SVG 文書 になる。 あるいは、親の XML 文書内に文書片としてインラインに埋め込むこともできる。 An SVG document fragment can stand by itself as a self-contained file or resource, in which case the SVG document fragment is an SVG document, or it can be embedded inline as a fragment within a parent XML document.

下に、親の XML 文書内に文書片として埋め込まれている簡単な SVG 内容の例を示す。 svg 要素と ellipse 要素が SVG 名前空間に属することを指示するため、 XML 名前空間が利用されていることに注意: The following example shows simple SVG content embedded inline as a fragment within a parent XML document. Note the use of XML namespaces to indicate that the ‘svg’ and ‘ellipse’ elements belong to the SVG namespace:

<?xml version="1.0" standalone="yes"?>
<parent xmlns="http://example.org"
        xmlns:svg="http://www.w3.org/2000/svg">
   <!-- 親の内容はここに -->
   <svg:svg width="4cm" height="8cm" version="1.1">
      <svg:ellipse cx="2cm" cy="4cm" rx="2cm" ry="1cm" />
   </svg:svg>
   <!-- ... -->
</parent>

次の例は少し複雑なもの(いくつかの矩形が含まれている)。 独立した 外部依存のない SVG 文書になっている: This example shows a slightly more complex (i.e., it contains multiple rectangles) stand-alone, self-contained SVG document:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="5cm" height="4cm" version="1.1"
     xmlns="http://www.w3.org/2000/svg">
  <desc>4個の別々の矩形
  </desc>
    <rect x="0.5cm" y="0.5cm" width="2cm" height="1cm"/>
    <rect x="0.5cm" y="2cm" width="1cm" height="1.5cm"/>
    <rect x="3cm" y="0.5cm" width="1.5cm" height="2cm"/>
    <rect x="3.5cm" y="3cm" width="1cm" height="0.5cm"/>

  <!-- 要素でキャンバスの境界を表示 -->
  <rect x=".01cm" y=".01cm" width="4.98cm" height="3.98cm"
        fill="none" stroke="blue" stroke-width=".02cm" />

</svg>

svg 要素は SVG 内容の中に現れてもよい。 これが、他の SVG 文書片を SVG 文書片の中に埋め込むための仕組みになる。 ‘svg’ elements can appear in the middle of SVG content. This is the mechanism by which SVG document fragments can be embedded within other SVG document fragments.

SVG 内容の中における svg 要素の別の用途は、新たなビューポートを確立させることである( 新たなビューポートの確立 を見よ)。 Another use for ‘svg’ elements within the middle of SVG content is to establish a new viewport. (See Establishing a new viewport.)

いかなる場合でも、すべての SVG 要素が SVG 名前空間に属するものと識別されるようにするためには, XML 名前空間 勧告 [XML-NS] に従って SVG 名前空間宣言が与えられなければならない。 以下は SVG 名前空間宣言として可能な記法になる。 名前空間接頭辞の無い xmlns 属性を svg 要素に指定した場合、そのスコープ下に入るすべての要素の既定の名前空間が SVG になる: In all cases, for compliance with the Namespaces in XML Recommendation [XML-NS], an SVG namespace declaration must be provided so that all SVG elements are identified as belonging to the SVG namespace. The following are possible ways to provide a namespace declaration. An ‘xmlns’ attribute without a namespace prefix could be specified on an ‘svg’ element, which means that SVG is the default namespace for all elements within the scope of the element with the ‘xmlns’ attribute:

<svg xmlns="http://www.w3.org/2000/svg" …>
  <rect …/>
</svg>

xmlns 属性に名前空間接頭辞を付けた場合(例えば xmlns:svg="http://www.w3.org/2000/svg" )、対応する名前空間は既定の名前空間にはならないので、要素すべてに名前空間接頭辞を与えなければならない: If a namespace prefix is specified on the ‘xmlns’ attribute (e.g., xmlns:svg="http://www.w3.org/2000/svg"), then the corresponding namespace is not the default namespace, so an explicit namespace prefix must be assigned to the elements:

<svg:svg xmlns:svg="http://www.w3.org/2000/svg" …>
  <svg:rect …/>
</svg:svg>

名前空間接頭辞は先祖要素に指定することもできる( 上の例 に示されている)。 詳細は XML 名前空間 勧告 [XML-NS] を参照のこと。 Namespace prefixes can be specified on ancestor elements (illustrated in the above example). For more information, refer to the Namespaces in XML Recommendation [XML-NS].

5.1.2 svg 要素

svg
分類:
コンテナ要素, 構造要素
内容モデル:
以下の要素の任意個数, 任意順序の組み合わせ:
属性:
DOM インタフェース:

属性定義

version = "<number>"

文書が準拠する SVG 言語のバージョンを指定する。 Indicates the SVG language version to which this document fragment conforms.

SVG 1.0 [SVG10] ではこの属性は '1.0' に固定されている。 SVG 1.1 では '1.1' とすべきである。 In SVG 1.0 [SVG10], this attribute was fixed to the value '1.0'. For SVG 1.1, the attribute should have the value '1.1'.

アニメーション:不可
baseProfile = profile-name

文書作成者が内容の正確な描画に最小限必要と考える SVG 言語プロファイルをここで指定する。 この属性は処理における制約を規定するわけではなく、メタデータと見なしてよい。 例えば、利用者がここで指定した基本プロファイルの枠を越えて文書を編集しようとした際に,文書作成ツールから警告を発するための利用がある。 それぞれの SVG 言語プロファイルは、この属性に与える適切なテキストを定義すべきである。 Describes the minimum SVG language profile that the author believes is necessary to correctly render the content. The attribute does not specify any processing restrictions; It can be considered metadata. For example, the value of the attribute could be used by an authoring tool to warn the user when they are modifying the document beyond the scope of the specified base profile. Each SVG profile should define the text that is appropriate for this attribute.

この属性が指定されていない場合の効果は、値 none が指定されたときと同じになる。 If the attribute is not specified, the effect is as if a value of 'none' were specified.

アニメーション:不可
x = "<coordinate>"

最も外側の svg 要素 に対しては、どんな意味も効果も生じない。) (Has no meaning or effect on outermost svg elements.)

埋め込まれる svg 要素が配置される領域矩形の第一頂点の X 座標。 The x-axis coordinate of one corner of the rectangular region into which an embedded ‘svg’ element is placed.

この属性が指定されていない場合の効果は、値 0 が指定されたときと同じになる。 If the attribute is not specified, the effect is as if a value of '0' were specified.

アニメーション:
y = "<coordinate>"

最も外側の svg 要素 に対しては、どんな意味も効果も生じない。) (Has no meaning or effect on outermost svg elements.)

埋め込まれる svg 要素が配置される領域矩形の第一頂点の Y 座標。 The y-axis coordinate of one corner of the rectangular region into which an embedded ‘svg’ element is placed.

この属性が指定されていない場合の効果は、値 0 が指定されたときと同じになる。 If the attribute is not specified, the effect is as if a value of '0' were specified.

アニメーション:
width = "<length>"

最も外側の svg 要素 に対しては、 SVG 文書片の固有の横幅を意味する。 埋め込まれる svg 要素に対しては、配置されるときの矩形の横幅を意味する。 For outermost svg elements, the intrinsic width of the SVG document fragment. For embedded ‘svg’ elements, the width of the rectangular region into which the ‘svg’ element is placed.

負値はエラー( エラー処理 を見よ)。 値をゼロにすると要素は描画されなくなる。 A negative value is an error (see Error processing). A value of zero disables rendering of the element.

この属性が指定されていない場合の効果は、値 '100%' が指定されたときと同じになる。 If the attribute is not specified, the effect is as if a value of '100%' were specified.

アニメーション:
height = "<length>"

最も外側の svg 要素 に対しては、 SVG 文書片の固有の高さを意味する。 埋め込まれる svg 要素に対しては、配置されるときの矩形の高さを意味する。 For outermost svg elements, the intrinsic height of the SVG document fragment. For embedded ‘svg’ elements, the height of the rectangular region into which the ‘svg’ element is placed.

負値はエラー( エラー処理 を見よ)。 値をゼロにすると要素は描画されなくなる。 A negative value is an error (see Error processing). A value of zero disables rendering of the element.

この属性が指定されていない場合の効果は、値 '100%' が指定されたときと同じになる。 If the attribute is not specified, the effect is as if a value of '100%' were specified.

アニメーション:
preserveAspectRatio = "[defer] <align> [<meetOrSlice>]"

preserveAspectRatio を見よ。 See ‘preserveAspectRatio’.

この属性が指定されていない場合の効果は、値 'xMidYMid meet' が指定されたときと同じになる。 If the attribute is not specified, then the effect is as if a value of 'xMidYMid meet' were specified.

アニメーション:
contentScriptType = "content-type"

contentScriptType を見よ。 See 'contentScriptType'.

contentStyleType = "content-type"

contentStyleType を見よ。 See 'contentStyleType'.

zoomAndPan = "disable | magnify"

zoomAndPan を見よ。 See 'zoomAndPan'.

他の文書の部品として参照されることが予期される SVG 文書においては、 最も外側の svg 要素viewBox 属性を指定するとよい。 この属性は、 SVG 文書を任意のビューポートに適宜倍率を変えてはめ込む簡便な方法を提供する。 If an SVG document is likely to be referenced as a component of another document, the author will often want to include a ‘viewBox’ attribute on the outermost svg element of the referenced document. This attribute provides a convenient way to design SVG documents to scale-to-fit into an arbitrary viewport.

5.2 グループ化:g 要素

5.2.1 概観

g 要素は、互いに関連する グラフィックス要素 をグループ化するための コンテナ要素 である。 The ‘g’ element is a container element for grouping together related graphics elements.

desc 要素と title 要素とグループ化との併用により、文書構造と意味論の情報が与えられるようになる。 多彩な構造を備える文書は、スピーチ, 点字, あるいはグラフィックによる出力が可能になり, アクセシビリティ も向上する。 Grouping constructs, when used in conjunction with the ‘desc’ and ‘title’ elements, provide information about document structure and semantics. Documents that are rich in structure may be rendered graphically, as speech, or as braille, and thus promote accessibility.

グループ化された要素に対しても、個々のオブジェクトと同様に id 属性を用いて名前を付けられる。 名前付きのグループは、アニメーションや再利用など,様々な局面で必要になる。 A group of elements, as well as individual objects, can be given a name using the ‘id’ attribute. Named groups are needed for several purposes such as animation and re-usable objects.

例: An example:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg"
     version="1.1" width="5cm" height="5cm">
  <desc>それぞれ2個の矩形からなる2つのグループ</desc>
  <g id="group1" fill="red">
    <rect x="1cm" y="1cm" width="1cm" height="1cm"/>
    <rect x="3cm" y="1cm" width="1cm" height="1cm"/>
  </g>
  <g id="group2" fill="blue">
    <rect x="1cm" y="3cm" width="1cm" height="1cm"/>
    <rect x="3cm" y="3cm" width="1cm" height="1cm"/>
  </g>

  <!-- 'rect' 要素でキャンバスの境界を表示 -->
  <rect x=".01cm" y=".01cm" width="4.98cm" height="4.98cm"
        fill="none" stroke="blue" stroke-width=".02cm"/>
</svg>

この例を SVG で表示( SVG 対応ブラウザのみ)

g 要素は、他の g 要素を任意の階層にわたって入れ子にできる。 下の例のように: A ‘g’ element can contain other ‘g’ elements nested within it, to an arbitrary depth. Thus, the following is possible:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg"
     version="1.1" width="4in" height="3in">
  <desc>グループは入れ子にできる</desc>
  <g>
     <g>
       <g>
       </g>
     </g>
   </g>
</svg>

g に含まれていないどの要素も、(少なくとも概念的には)あたかも単独でグループをなすものとして扱われる。 Any element that is not contained within a ‘g’ is treated (at least conceptually) as if it were in its own group.

5.2.2 g 要素

g
分類:
コンテナ要素, 構造要素
内容モデル:
以下の要素の任意個数, 任意順序の組み合わせ:
属性:
DOM インタフェース:

5.3.1 概観

SVG では、後で再利用するためのグラフィカルなオブジェクトを定義できる。 そのために、広範囲に渡り,他のオブジェクトへの IRI 参照 [RFC3987] が利用できるようにされている。 例えば 矩形を線型グラデーションで塗りつぶす場合、まず次の様に linearGradient 要素を定義して ID を与える: SVG allows graphical objects to be defined for later reuse. To do this, it makes extensive use of IRI references [RFC3987] to these other objects. For example, to fill a rectangle with a linear gradient, you first define a ‘linearGradient’ element and give it an ID, as in:

<linearGradient id="MyGradient">...</linearGradient>

次に、矩形の fill プロパティに,この線型グラデーションへの参照を与える: You then reference the linear gradient as the value of the ‘fill’ property for the rectangle, as in:

<rect style="fill:url(#MyGradient)"/>

グラデーションなどの一部の型の要素は、それ自身は描画内容を生成しない。 それらは都合の良い任意の場所に配置できる。 しかしながら、グラフィカルなオブジェクトを直接描画させずに,参照からのみに利用したい場合もある。 これを行うため,および 定義済み内容の簡便なグループ化のため、 SVG には defs 要素が用意されている。 Some types of element, such as gradients, will not by themselves produce a graphical result. They can therefore be placed anywhere convenient. However, sometimes it is desired to define a graphical object and prevent it from being directly rendered. it is only there to be referenced elsewhere. To do this, and to allow convenient grouping defined content, SVG provides the ‘defs’ element.

参照先の要素は、可能な限り defs 要素内に定義することが推奨される。 常に参照を通して利用される要素は: altGlyphDef, clipPath, cursor, filter, linearGradient, marker, mask, pattern, radialGradient, symbol である。 これらの要素は defs 要素内で定義した方が文書内容も理解し易くなり、アクセシビリティも向上する。 It is recommended that, wherever possible, referenced elements be defined inside of a ‘defs’ element. Among the elements that are always referenced: ‘altGlyphDef’, ‘clipPath’, ‘cursor’, ‘filter’, ‘linearGradient’, ‘marker’, ‘mask’, ‘pattern’, ‘radialGradient’ and ‘symbol’. Defining these elements inside of a ‘defs’ element promotes understandability of the SVG content and thus promotes accessibility.

5.3.2 defs 要素

defs
分類:
コンテナ要素, 構造要素
内容モデル:
以下の要素の任意個数, 任意順序の組み合わせ:
属性:
DOM インタフェース:

defs 要素は 被参照要素 のためのコンテナ要素である。 可読性と アクセシビリティ の要求から、参照される可能性のある要素は可能ならこの要素内に定義することが推奨される。 The ‘defs’ element is a container element for referenced elements. For understandability and accessibility reasons, it is recommended that, whenever possible, referenced elements be defined inside of a ‘defs’.

defs 要素の内容モデルは g 要素と同じである。 したがって g 要素の子になれるすべての要素は defs 要素の子になれ、逆もまた成立する。 The content model for ‘defs’ is the same as for the ‘g’ element; thus, any element that can be a child of a ‘g’ can also be a child of a ‘defs’, and vice versa.

defs 要素の子孫の要素は直接描画されることはない。 これらはあたかも defs 要素が g 要素だったとしたときに, display プロパティが none に指定されていたかのように、描画木の一部分とみなされない。 しかしながら、 defs 要素の子孫は元々の木にいつでも存在しており,他の要素からの参照は常に可能である。 したがって、 display プロパティが defs 要素またはその子孫のどこかにあったとしても、他の要素からの参照を妨げることはない。 Elements that are descendants of a ‘defs’ are not rendered directly; they are prevented from becoming part of the rendering tree just as if the ‘defs’ element were a ‘g’ element and the ‘display’ property were set to none. Note, however, that the descendants of a ‘defs’ are always present in the source tree and thus can always be referenced by other elements; thus, the value of the ‘display’ property on the ‘defs’ element or any of its descendants does not prevent those elements from being referenced by other elements.

ストリーミング環境において UA の効率的な実行を促すためには、 SVG 内容作成者は参照元の要素の先祖要素の直接の子として defs 要素を置き,その中に局所 IRI 参照から参照される子要素すべてを置くことが奨励される。 例えば: To provide some SVG user agents with an opportunity to implement efficient implementations in streaming environments, creators of SVG content are encouraged to place all elements which are targets of local IRI references within a ‘defs’ element which is a direct child of one of the ancestors of the referencing element. For example:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="8cm" height="3cm"
     xmlns="http://www.w3.org/2000/svg" version="1.1">
  <desc>先祖要素の 'defs' 子要素内における局所 URI 参照。</desc>
  <defs>
    <linearGradient id="Gradient01">
      <stop offset="20%" stop-color="#39F" />
      <stop offset="90%" stop-color="#F3F" />
    </linearGradient>
  </defs>
  <rect x="1cm" y="1cm" width="6cm" height="1cm" 
        fill="url(#Gradient01)"  />

  <!-- 'rect' 要素でキャンバスの境界を表示 -->
  <rect x=".01cm" y=".01cm" width="7.98cm" height="2.98cm"
        fill="none" stroke="blue" stroke-width=".02cm" />

</svg>

この例を SVG で表示( SVG 対応ブラウザのみ)

上の文書では svg 要素が線型グラデーションを含む defs 要素を直接の子として持ちつつ,線型グラデーションを参照する rect 要素の先祖に位置している。 このように、上の文書は上述の指針に沿っている。 In the document above, the linear gradient is defined within a ‘defs’ element which is the direct child of the ‘svg’ element, which in turn is an ancestor of the ‘rect’ element which references the linear gradient. Thus, the above document conforms to the guideline.

5.4 desc 要素と title 要素

desc
分類:
記述的要素
内容モデル:
任意の要素または文字データ
属性:
DOM インタフェース:
title
分類:
記述的要素
内容モデル:
任意の要素または文字データ
属性:
DOM インタフェース:

それぞれの コンテナ要素グラフィックス要素 には,個別に、 desc 要素, またはテキストのみの説明を与える title 要素,あるいはそれらの両方を指定することができる。 SVG 文書片が視覚メディアに SVG として描画される場合、 desctitle 要素は,グラフィックの一部としては出力されない。 しかしながら title 要素は、例えばポインティング装置で触れると現れるツールチップとして表示させることも, UA には可能である。 視覚, 聴覚の両方について代替表現は可能であり、 path などのグラフィックス要素を表示する代わりに desctitle 要素を表現することは十分あり得る。 このようなことは、(場合によっては利用者の)スタイルシートに対する変更を通して,容易に実現できる。 階層構造が深い場合や, use 要素の参照を辿るような場合、どこまで深く説明文を掘り下げるかの制御を 利用者に委ねた方が望ましい場面は多々ある。 Each container element or graphics element in an SVG drawing can supply a ‘desc’ and/or a ‘title’ description string where the description is text-only. When the current SVG document fragment is rendered as SVG on visual media, ‘desc’ and ‘title’ elements are not rendered as part of the graphics. User agents may, however, for example, display the ‘title’ element as a tooltip, as the pointing device moves over particular elements. Alternate presentations are possible, both visual and aural, which display the ‘desc’ and ‘title’ elements but do not display ‘path’ elements or other graphics elements. This is readily achieved by using a different (perhaps user) style sheet. For deep hierarchies, and for following ‘use’ element references, it is sometimes desirable to allow the user to control how deep they drill down into descriptive text.

適合 SVG 文書片においては、どの title 要素もその親の最初の子要素になるべきである。 注記:ツールチップの表示に title を実際に利用する実装には、 title が実際に最初の子要素になっているときに限り,そうするものが多い。 In conforming SVG document fragments, any ‘title’ element should be the first child element of its parent. Note that those implementations that do use ‘title’ to display a tooltip often will only do so if the ‘title’ is indeed the first child element of its parent.

以下に例を挙げる。 通常の処理では UA は g 要素内の desctitle 要素を除いた残りの部分のみを表示する。 The following is an example. In typical operation, the SVG user agent would not render the ‘desc’ and ‘title’ elements but would render the remaining contents of the ‘g’ element.

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg SYSTEM "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg"
     version="1.1" width="4in" height="3in">
  <g>
    <title>地域別売上高</title>
    <desc>
	  これは地域別売上高を表す棒グラフである。
    </desc>
    <!-- ベクターデータで定義される棒グラフ -->
  </g>
</svg>

説明要素とタイトル要素には他の名前空間でマークアップされたテキストも含められる: Description and title elements can contain marked-up text from other namespaces. Here is an example:

<?xml version="1.0" standalone="yes"?>
<svg xmlns="http://www.w3.org/2000/svg"
     version="1.1" width="4in" height="3in">
  <desc xmlns:mydoc="http://example.org/mydoc">
    <mydoc:title>これは例示用 SVG ファイル</mydoc:title>
    <mydoc:para>全体的な説明には <mydoc:emph>mydoc</mydoc:emph>
      名前空間によるマークアップを利用。</mydoc:para>
  </desc>
  <g>
    <!-- 絵図はここに -->
  </g>
</svg>

文書作成者は、独立した SVG 文書の 最も外側の svg 要素 に対し常に, title 要素を子要素として与えるべきである。 svg 要素の子要素としての title 要素は SVG 文書片の内容確認に役立つ。 利用者はしばしば文脈の外から文書を参照するので、文書作成者は文脈が豊かなタイトルを提供するべきである。 「序文」の様な文脈情報に乏しいタイトルより、「中世の養蜂業・序文」の様なタイトルを付けるべきである。 UA は 最も外側の svg 要素title 子要素があれば、アクセシビリティに配慮して必ず利用者に示されるようにすべきである。 このような仕組の実装は UA 側に託されている(例えば、音声によるキャプション)。 Authors should always provide a ‘title’ child element to the outermost svg element within a stand-alone SVG document. The ‘title’ child element to an ‘svg’ element serves the purposes of identifying the content of the given SVG document fragment. Since users often consult documents out of context, authors should provide context-rich titles. Thus, instead of a title such as "Introduction", which doesn't provide much contextual background, authors should supply a title such as "Introduction to Medieval Bee-Keeping" instead. For reasons of accessibility, user agents should always make the content of the ‘title’ child element to the outermost svg element available to users. The mechanism for doing so depends on the user agent (e.g., as a caption, spoken).

多くの SVG の要素(特にコンテナ要素とテキスト要素)の DTD 定義では desc, および title 子要素の配置や数に制限を設けていない。 この融通性は、コンテナ要素に対する一貫性を備えた内容モデルが開発されるまでの,一時的な措置である。 一部のコンテナ要素は 混成内容を許容し、望まれる制約を XML の混成内容の規則 ([XML10], 3.2.2 節) が受け入れてくれないからである。 将来版の SVG 言語の表現は、 DTD よりも表出的になり,より制約された混成内容規則を持てるようになるであろう。 すべての要素に対し、高々 1 個の desc と高々 1 個の title を子要素として与え,それらを( metadata 要素と文字データを除く)他のすべての子要素より先に位置させることが強く推奨される。 UA は、処理の際に複数の desctitle からの選択を迫られた際には,最初のものを選ぶべきである(例えばツールチップにどのテキストを用いるかなど)。 The DTD definitions of many of SVG's elements (particularly, container and text elements) place no restriction on the placement or number of the ‘desc’ and ‘title’ sub-elements. This flexibility is only present so that there will be a consistent content model for container elements, because some container elements in SVG allow for mixed content, and because the mixed content rules for XML ([XML10], section 3.2.2) do not permit the desired restrictions. Representations of future versions of the SVG language might use more expressive representations than DTDs which allow for more restrictive mixed content rules. It is strongly recommended that at most one ‘desc’ and at most one ‘title’ element appear as a child of any particular element, and that these elements appear before any other child elements (except possibly ‘metadata’ elements) or character data content. If user agents need to choose among multiple ‘desc’ or ‘title’ elements for processing (e.g., to decide which string to use for a tooltip), the user agent shall choose the first one.

5.5 symbol 要素

symbol
分類:
コンテナ要素, 構造要素
内容モデル:
以下の要素の任意個数, 任意順序の組み合わせ:
属性:
DOM インタフェース:

symbol 要素は、グラフィックのひな型オブジェクトを定義し, use 要素によりインスタンス化される。 The ‘symbol’ element is used to define graphical template objects which can be instantiated by a ‘use’ element.

グラフィックに繰り返し用いる symbol 要素の利用により、文書に構造と意味論が加えられる。 多彩な構造を備える文書は、グラフィック, 読み上げ, あるいは点字による出力が可能になり、 アクセシビリティ も向上する。 The use of ‘symbol’ elements for graphics that are used multiple times in the same document adds structure and semantics. Documents that are rich in structure may be rendered graphically, as speech, or as braille, and thus promote accessibility.

symbolg の根本的な相違は: The key distinctions between a ‘symbol’ and a ‘g’ are:

marker 要素と pattern 要素は symbol 要素と密接に関連する。 Closely related to the ‘symbol’ element are the ‘marker’ and ‘pattern’ elements.

symbol 要素は決して直接描画されることはなく、 use 要素からの参照以外の用途はない。 display プロパティは symbol 要素には適用されない。 すなわち, symbol 要素は、 display プロパティが none 以外の値に設定されていても 直接描画されることはなく, symbol 要素自身あるいはその先祖において display プロパティが none に設定されていても 参照を通して利用できる。 ‘symbol’ elements are never rendered directly; their only usage is as something that can be referenced using the ‘use’ element. The ‘display’ property does not apply to the ‘symbol’ element; thus, ‘symbol’ elements are not directly rendered even if the ‘display’ property is set to a value other than none, and ‘symbol’ elements are available for referencing even when the ‘display’ property on the ‘symbol’ element or any of its ancestors is set to none.

5.6 use 要素

use
分類:
グラフィックス要素, グラフィックス参照要素, 構造要素
内容モデル:
以下の要素の任意個数, 任意順序の組み合わせ:
属性:
DOM インタフェース:

どの svg, symbol, g, use 要素あるいは グラフィックス要素 も、 use 要素によるひな型としての再利用(すなわちインスタンス化)の対象になる。 use 要素は、文書の与えられた場所において他の要素を参照し,そのグラフィック内容の取り込みと描画を指示する。 Any ‘svg’, ‘symbol’, ‘g’, graphics element or other ‘use’ is potentially a template object that can be re-used (i.e., "instanced") in the SVG document via a ‘use’ element. The ‘use’ element references another element and indicates that the graphical contents of that element is included/drawn at that given point in the document.

image 要素とは異なり、 use 要素は,文書全体を参照することはできない。 Unlike ‘image’, the ‘use’ element cannot reference entire files.

use 要素は省略可能な次の属性: x, y, width, height を持つ。 これらは、参照先の要素のグラフィック内容を現在の座標系の矩形領域に写像するために利用される。 The ‘use’ element has optional attributes ‘x’, ‘y’, ‘width’ and ‘height’ which are used to map the graphical contents of the referenced element onto a rectangular region within the current coordinate system.

use 要素による効果は、あたかも参照先の要素の内容が DOM 木において — その use 要素を親とする別個の非公開木として,かつ use 要素のすべての先祖がその木の先祖になるように — 末端まで複製されたかのようにふるまう。 複製された DOM 木は非公開なので、 SVG 文書オブジェクトモデル( DOM )においては use 要素とその属性が存在するだけであり,参照先の要素の内容が use 要素の子としては現れることはない。 The effect of a ‘use’ element is as if the contents of the referenced element were deeply cloned into a separate non-exposed DOM tree which had the ‘use’ element as its parent and all of the ‘use’ element's ancestors as its higher-level ancestors. Because the cloned DOM tree is non-exposed, the SVG Document Object Model (DOM) only contains the ‘use’ element and its attributes. The SVG DOM does not show the referenced element's contents as children of ‘use’ element.

CSS によるスタイル付け をサポートする UA においては、この概念的な非公開 DOM 木の中への,参照先の要素とその子孫の末端までの複製は、 CSS カスケード ([CSS2], 6 節) によりもたらされる参照先の要素とその内容のすべてのプロパティ値 の複製も意味する。 CSS2 セレクタの適用については、元の(すなわち参照先の)要素については 正規の文書構造の一部なので適用される一方,(概念的な)複製木については 正規の文書構造の一部ではないので適用されない。 For user agents that support Styling with CSS, the conceptual deep cloning of the referenced element into a non-exposed DOM tree also copies any property values resulting from the CSS cascade ([CSS2], chapter 6) on the referenced element and its contents. CSS2 selectors can be applied to the original (i.e., referenced) elements because they are part of the formal document structure. CSS2 selectors cannot be applied to the (conceptually) cloned DOM tree because its contents are not part of the formal document structure.

しかしながら、プロパティ継承においては、参照先の要素がテキストそのままとして use 要素下に末端の子孫まで複製されているものとみなされ, use 要素とその先祖要素のプロパティを継承し,複製木内のインスタンス化された要素は 参照先の要素の元々の親のプロパティを継承しない。 Property inheritance, however, works as if the referenced element had been textually included as a deeply cloned child of the ‘use’ element. The referenced element inherits properties from the ‘use’ element and the ‘use’ element's ancestors. An instance of a referenced element does not inherit properties from the referenced element's original parents.

もしイベント属性が参照先の要素にあてがわれている場合、そのイベントの実際の標的は「インスタンス化された木」内の対応する SVGElementInstance オブジェクトになる。 If event attributes are assigned to referenced elements, then the actual target for the event will be the SVGElementInstance object within the "instance tree" corresponding to the given referenced element.

非公開木におけるイベント処理は、 SVGElementInstance オブジェクトへ配送されることを除けば,あたかも参照先の要素がテキストのまま use 要素下に末端の子孫まで複製されたかのように処理される。 イベントの target 属性と currentTarget 属性は、参照先の部分木の中のイベントの標的に対応する SVGElementInstance と現在の標的要素に設定される。 イベントは通常の木のごとく、木の非公開部分も公開部分も辿って伝播する:最初はルート要素から use 要素へ,次に非公開部分をイベントの標的まで辿り(捕獲過程 — capture phase ),標的でバブル化し、再び非公開部分を use 要素まで辿った後,通常の木を辿ってルート要素まで浮上する(浮上過程 — bubbling phase )。 The event handling for the non-exposed tree works as if the referenced element had been textually included as a deeply cloned child of the ‘use’ element, except that events are dispatched to the SVGElementInstance objects. The event's target and currentTarget attributes are set to the SVGElementInstance that corresponds to the target and current target elements in the referenced subtree. An event propagates through the exposed and non-exposed portions of the tree in the same manner as it would in the regular document tree: first going from the root element to the ‘use’ element and then through non-exposed tree elements in the capture phase, followed by the target phase at the target of the event, then bubbling back through non-exposed tree to the use element and then back through regular tree to the root element in bubbling phase.

同じ要素に対応するすべての SVGElementInstance オブジェクトは、イベントリスナのリストを共有する。 どのオブジェクトがイベントリスナを呼び出したかは、イベントの currentTarget 属性から知ることができる。 An element and all its corresponding SVGElementInstance objects share an event listener list. The currentTarget attribute of the event can be used to determine through which object an event listener was invoked.

visibility プロパティの振るまいは、ここでのプロパティ継承モデルに従う。 したがって、 use 要素で visibility:hidden と指定されていたとしても,参照先の内容が描画されなくなるわけではない。 use 要素で visibility:hidden と指定されていて, 参照先の要素では visibility:hidden または visibility:inherit と指定されているならば、その要素は見えなくなる。 しかしながら,参照先の要素で visibility:visible が指定されていた場合、たとえ use 要素で visibility:hidden と指定されていたとしても,その要素は見えることになる。 The behavior of the ‘visibility’ property conforms to this model of property inheritance. Thus, specifying 'visibility:hidden' on a ‘use’ element does not guarantee that the referenced content will not be rendered. If the ‘use’ element specifies 'visibility:hidden' and the element it references specifies 'visibility:hidden' or 'visibility:inherit', then that one element will be hidden. However, if the referenced element instead specifies 'visibility:visible', then that element will be visible even if the ‘use’ element specifies 'visibility:hidden'.

参照先の要素におけるアニメーションは、そのインスタンスにおいても有効である。 Animations on a referenced element will cause the instances to also be animated.

use 要素における視覚上の効果は、あたかも use 要素が,以下のようにして生成される内容に置き換えられたかのようにふるまう: A ‘use’ element has the same visual effect as if the ‘use’ element were replaced by the following generated content:

  1. 生成される内容においては、 useg によって置き換えられ,置き換えた guse 要素の x, y, width, height, xlink:href 属性を除いたすべての属性が移植される。 x, yuse 要素の x, y 属性の値とするとき、変換 translate(x, y)g 要素の transform 属性の終端(つまり,右側)に付加される。 (下の各項の原文における共通部分)
  2. 次に:
    use 要素が symbol 要素を参照している場合
    参照先の symbol とその内容は、根元の symbolsvg に置き換えられることを除いて,生成される木に末端まで複製される。 この生成された svg は常に明示的に width 属性と height 属性の値を持ち, use 要素の widthheight の値が移植されるが、これらが use 要素に与えられていないものについては値 '100%' をとる。 If the ‘use’ element references a ‘symbol’ element: In the generated content, the ‘use’ will be replaced by ‘g’, where all attributes from the ‘use’ element except for ‘x’, ‘y’, ‘width’, ‘height’ and ‘xlink:href’ are transferred to the generated ‘g’ element. An additional transformation translate(x,y) is appended to the end (i.e., right-side) of the ‘transform’ attribute on the generated ‘g’, where x and y represent the values of the ‘x’ and ‘y’ attributes on the ‘use’ element. The referenced ‘symbol’ and its contents are deep-cloned into the generated tree, with the exception that the ‘symbol’ is replaced by an ‘svg’. This generated ‘svg’ will always have explicit values for attributes ‘width’ and ‘height’. If attributes ‘width’ and/or ‘height’ are provided on the ‘use’ element, then these attributes will be transferred to the generated ‘svg’. If attributes ‘width’ and/or ‘height’ are not specified, the generated ‘svg’ element will use values of '100%' for these attributes.
    use 要素が svg 要素を参照している場合
    参照先の svg とその内容は生成される木に末端まで複製される。 もし use 要素に widthheight 属性が与えられていた場合、これらは svg 要素の対応する値を上書きする。 If the ‘use’ element references an ‘svg’ element: In the generated content, the ‘use’ will be replaced by ‘g’, where all attributes from the ‘use’ element except for ‘x’, ‘y’, ‘width’, ‘height’ and ‘xlink:href’ are transferred to the generated ‘g’ element. An additional transformation translate(x,y) is appended to the end (i.e., right-side) of the ‘transform’ attribute on the generated ‘g’, where x and y represent the values of the ‘x’ and ‘y’ attributes on the ‘use’ element. The referenced ‘svg’ and its contents are deep-cloned into the generated tree. If attributes ‘width’ and/or ‘height’ are provided on the ‘use’ element, then these values will override the corresponding attributes on the ‘svg’ in the generated tree.
    他の場合
    参照先のオブジェクトとその内容は生成される木に末端まで複製される。 Otherwise: In the generated content, the ‘use’ will be replaced by ‘g’, where all attributes from the ‘use’ element except for ‘x’, ‘y’, ‘width’, ‘height’ and ‘xlink:href’ are transferred to the generated ‘g’ element. An additional transformation translate(x,y) is appended to the end (i.e., right-side) of the ‘transform’ attribute on the generated ‘g’, where x and y represent the values of the ‘x’ and ‘y’ attributes on the ‘use’ element. The referenced object and its contents are deep-cloned into the generated tree.

CSS によるスタイル付け をサポートする UA においては、生成された g 要素は CSS カスケード ([CSS2], 6 節) により「カスケードされた」 use 要素のプロパティ値を一緒に運ぶ。 加えて、参照先のリソースの(末端までの)複製は、元の(つまり、参照先の)要素の「カスケードされた」プロパティ値も一緒に運ぶ。 したがって, class 属性, および style 属性と組み合わせて用いられる様々な CSS セレクタによる効果は、実質的には,生成された内容において「カスケードされた」プロパティ値を伝達する機能上等価な style 属性への置き換えになる。 For user agents that support Styling with CSS, the generated ‘g’ element carries along with it the "cascaded" property values on the ‘use’ element which result from the CSS cascade ([CSS2], chapter 6). Additionally, the copy (deep clone) of the referenced resource carries along with it the "cascaded" property values resulting from the CSS cascade on the original (i.e., referenced) elements. Thus, the result of various CSS selectors in combination with the ‘class’ and ‘style’ attributes are, in effect, replaced by the functional equivalent of a ‘style’ attribute in the generated content which conveys the "cascaded" property values.

下の Example Use01rect を利用する単純な use 要素を示す: Example Use01 below has a simple ‘use’ on a ‘rect’.

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="10cm" height="3cm" viewBox="0 0 100 30" version="1.1"
     xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <desc>Example Use01 - 'rect' を利用する単純な 'use'</desc>
  <defs>
    <rect id="MyRect" width="60" height="10"/>
  </defs>
  <rect x=".1" y=".1" width="99.8" height="29.8"
        fill="none" stroke="blue" stroke-width=".2" />
  <use x="20" y="10" xlink:href="#MyRect" />
</svg>
Example Use01
Example Use01 — Simple case of 'use' on a 'rect'

この例を SVG で表示( SVG 対応ブラウザのみ)

視覚効果においては、次と同じになる: The visual effect would be equivalent to the following document:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="10cm" height="3cm" viewBox="0 0 100 30"
     xmlns="http://www.w3.org/2000/svg" version="1.1">
  <desc>Example Use01-GeneratedContent - 'rect' を利用する単純な 'use'</desc>
  <!-- 'defs' 部は省略 -->

  <rect x=".1" y=".1" width="99.8" height="29.8"
        fill="none" stroke="blue" stroke-width=".2" />

  <!-- 'use' を置き換える生成内容はここから -->
  <g transform="translate(20,10)">
    <rect width="60" height="10"/>
  </g>
  <!-- 生成内容はここまで -->

</svg>

この例を SVG で表示( SVG 対応ブラウザのみ)

下の Example Use02symbol を利用する use 要素を示す: Example Use02 below has a ‘use’ on a ‘symbol’.

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="10cm" height="3cm" viewBox="0 0 100 30" version="1.1"
     xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <desc>Example Use02 - 'symbol' を利用する 'use'</desc>
  <defs>
    <symbol id="MySymbol" viewBox="0 0 20 20">
      <desc>MySymbol — 格子状に並ぶ4矩形</desc>
      <rect x="1" y="1" width="8" height="8"/>
      <rect x="11" y="1" width="8" height="8"/>
      <rect x="1" y="11" width="8" height="8"/>
      <rect x="11" y="11" width="8" height="8"/>
    </symbol>
  </defs>
  <rect x=".1" y=".1" width="99.8" height="29.8"
        fill="none" stroke="blue" stroke-width=".2" />
  <use x="45" y="10" width="10" height="10" 
       xlink:href="#MySymbol" />
</svg>
Example Use02
Example Use02 — 'use' on a 'symbol'

この例を SVG で表示( SVG 対応ブラウザのみ)

視覚効果においては、次と同じになる: The visual effect would be equivalent to the following document:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="10cm" height="3cm" viewBox="0 0 100 30"
     xmlns="http://www.w3.org/2000/svg" version="1.1">
  <desc>Example Use02-GeneratedContent - 'symbol' を利用する 'use'</desc>

  <!-- 'defs' 部は省略 -->

  <rect x=".1" y=".1" width="99.8" height="29.8"
        fill="none" stroke="blue" stroke-width=".2" />

  <!-- 'use' を置き換える生成内容はここから -->
  <g transform="translate(45, 10)" >
    <!-- 参照先の 'symbol' 開始。'symbol' は
         x,y,width,height=0,0,100%,100% に設定された 'svg' に置き換わる -->
    <svg width="10" height="10" 
         viewBox="0 0 20 20">
      <rect x="1" y="1" width="8" height="8"/>
      <rect x="11" y="1" width="8" height="8"/>
      <rect x="1" y="11" width="8" height="8"/>
      <rect x="11" y="11" width="8" height="8"/>
    </svg>
    <!-- ここまでが参照先の 'symbol' -->
  </g>
  <!-- 生成内容はここまで -->

</svg>

この例を SVG で表示( SVG 対応ブラウザのみ)

Example Use03use 要素が transform 属性を持つときどのような効果が生じるかを示す: Example Use03 illustrates what happens when a ‘use’ has a ‘transform’ attribute.

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="10cm" height="3cm" viewBox="0 0 100 30" version="1.1"
     xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <desc>Example Use03 - 'transform' 属性を伴う 'use' </desc>
  <defs>
    <rect id="MyRect" x="0" y="0" width="60" height="10"/>
  </defs>
  <rect x=".1" y=".1" width="99.8" height="29.8"
        fill="none" stroke="blue" stroke-width=".2" />
  <use xlink:href="#MyRect"
       transform="translate(20,2.5) rotate(10)" />
</svg>
Example Use03
Example Use03 — 'use' with a 'transform' attribute

この例を SVG で表示( SVG 対応ブラウザのみ)

視覚効果においては、次と同じになる: The visual effect would be equivalent to the following document:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="10cm" height="3cm" viewBox="0 0 100 30"
     xmlns="http://www.w3.org/2000/svg" version="1.1">
  <desc>Example Use03-GeneratedContent - 'transform' 属性を伴う 'use'</desc>

  <!-- 'defs' 部は省略 -->

  <rect x=".1" y=".1" width="99.8" height="29.8"
        fill="none" stroke="blue" stroke-width=".2" />

  <!-- 'use' を置き換える生成内容はここから -->
  <g transform="translate(20,2.5) rotate(10)">
    <rect x="0" y="0" width="60" height="10"/>
  </g>
  <!-- 生成内容はここまで -->

</svg>

この例を SVG で表示( SVG 対応ブラウザのみ)

Example Use04use 要素に対する種々の CSS によるスタイル付けの適用を示す: Example Use04 illustrates a ‘use’ element with various methods of applying CSS styling.

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="12cm" height="3cm" viewBox="0 0 1200 300" version="1.1"
     xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <desc>Example Use04 - 'use' に対する CSS によるスタイル付け</desc>
  <defs style=" /* 規則 9 */ stroke-miterlimit: 10" >
    <path id="MyPath" d="M300 50 L900 50 L900 250 L300 250"
                     class="MyPathClass"
                     style=" /* 規則 10 */ stroke-dasharray:300,100" />
  </defs>
  <style type="text/css">
    <![CDATA[
      /* 規則 1 */ #MyUse { fill: blue }
      /* 規則 2 */ #MyPath { stroke: red }
      /* 規則 3 */ use { fill-opacity: .5 }
      /* 規則 4 */ path { stroke-opacity: .5 }
      /* 規則 5 */ .MyUseClass { stroke-linecap: round }
      /* 規則 6 */ .MyPathClass { stroke-linejoin: bevel }
      /* 規則 7 */ use > path { shape-rendering: optimizeQuality }
      /* 規則 8 */ g > path { visibility: hidden }
    ]]>
  </style>

  <rect x="0" y="0" width="1200" height="300"
         style="fill:none; stroke:blue; stroke-width:3"/>
  <g style=" /* 規則 11 */ stroke-width:40">
    <use id="MyUse" xlink:href="#MyPath" 
         class="MyUseClass"
         style="/* 規則 12 */ stroke-dashoffset:50" />
  </g>
</svg>
Example Use04
Example Use04 — 'use' with CSS styling

この例を SVG で表示( SVG 対応ブラウザのみ)

視覚効果においては下に示す文書と同じになる。 スタイル規則のうち、一部(規則 1-6, 規則 10-12 )は生成内容に反映され,それ以外(規則 7-9 )は反映されないことを確認されたい。 生成内容に反映されない規則とは: The visual effect would be equivalent to the following document. Observe that some of the style rules above apply to the generated content (i.e., rules 1-6, 10-12), whereas others do not (i.e., rules 7-9). The rules which do not affect the generated content are:

例証のための便宜上、下の生成内容では有効なセレクタを style 属性としてインライン化している。 In the generated content below, the selectors that yield a match have been transferred into inline ‘style’ attributes for illustrative purposes.

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="12cm" height="3cm" viewBox="0 0 1200 300"
     xmlns="http://www.w3.org/2000/svg" version="1.1">
  <desc>Example Use04-GeneratedContent - 'transform' 属性を伴う 'use' </desc>

  <!-- 'style' 部と 'defs' 部は省略 -->

  <rect x="0" y="0" width="1200" height="300"
         style="fill:none; stroke:blue; stroke-width:3"/>
  <g style="/* 規則 11 */ stroke-width:40">

    <!-- 'use' を置き換える生成内容はここから -->
    <g style="/* 規則 1 */ fill:blue;
                 /* 規則 3 */ fill-opacity:.5;
                 /* 規則 5 */ stroke-linecap:round;
                 /* 規則 12 */ stroke-dashoffset:50" >
      <path d="M300 50 L900 50 L900 250 L300 250"
            style="/* 規則 2 */ stroke:red; 
                   /* 規則 4 */ stroke-opacity:.5; 
                   /* 規則 6 */ stroke-linejoin: bevel; 
                   /* 規則 10 */ stroke-dasharray:300,100" />
    </g> 
    <!-- 生成内容はここまで -->

  </g>
</svg>

この例を SVG で表示( SVG 対応ブラウザのみ)

use 要素が他の use 要素もしくは use 要素を内容に持つ他の要素を参照する場合、上で述べた末端までの複製処理は再帰的に行われる。 しかしながら,参照による連鎖が 直接的か間接的かを問わず循環した場合、 参照と defs 要素 にて述べたように,エラーとみなされる。 When a ‘use’ references another element which is another ‘use’ or whose content contains a ‘use’ element, then the deep cloning approach described above is recursive. However, a set of references that directly or indirectly reference a element to create a circular dependency is an error, as described in References and the ‘defs’ element.

属性定義

x = "<coordinate>"

参照先の要素が配置される矩形の第一頂点の X 座標。 The x-axis coordinate of one corner of the rectangular region into which the referenced element is placed.

この属性が指定されていない場合の効果は、値 0 が指定されたときと同じになる。 If the attribute is not specified, the effect is as if a value of "0" were specified.

アニメーション:
y = "<coordinate>"

参照先の要素が配置される矩形の第一頂点の Y 座標。 The y-axis coordinate of one corner of the rectangular region into which the referenced element is placed.

この属性が指定されていない場合の効果は、値 0 が指定されたときと同じになる。 If the attribute is not specified, the effect is as if a value of "0" were specified.

アニメーション:
width = "<length>"

参照先の要素が配置される矩形の幅。 負値はエラー( エラー処理 を見よ)。 値をゼロにすると要素は描画されなくなる。 The width of the rectangular region into which the referenced element is placed. A negative value is an error (see Error processing). A value of zero disables rendering of this element.

アニメーション:
height = "<length>"

参照先の要素が配置される矩形の高さ。 負値はエラー( エラー処理 を見よ)。 値をゼロにすると要素は描画されなくなる。 The height of the rectangular region into which the referenced element is placed. A negative value is an error (see Error processing). A value of zero disables rendering of this element.

アニメーション:
xlink:href = "<iri>"

SVG 文書片または SVG 文書内の要素への IRI 参照 A IRI reference to an element/fragment within an SVG document.

アニメーション:

5.7 image 要素

image
分類:
グラフィックス要素, グラフィックス参照要素
内容モデル:
以下の要素の任意個数, 任意順序の組み合わせ:
属性:
DOM インタフェース:

image 要素はファイルの完全な中身を現在の利用座標系の与えられた矩形領域に描画させることを指示する。 image 要素は PNG や JPEG などのラスター画像のファイルあるいは、 MIME タイプ "image/svg+xml" のファイルを参照できる。 適合 SVG ビューア には少なくとも PNG, JPEG, SVG 形式のサポートが求められる。 The ‘image’ element indicates that the contents of a complete file are to be rendered into a given rectangle within the current user coordinate system. The ‘image’ element can refer to raster image files such as PNG or JPEG or to files with MIME type of "image/svg+xml". Conforming SVG viewers need to support at least PNG, JPEG and SVG format files.

image 要素の処理結果は必ず4チャンネル RGBA である。 image 要素が3チャンネル( RGB )のみを持つラスター画像のファイルを参照している場合、アルファ値が一様に 1 にされた4チャンネル RGBA に変換される。 1チャンネルのみのラスター画像の場合、3つの色チャンネル( RGB )の値が元の1チャンネルの値から算出され,アルファチャンネルが一様に 1 にされた4チャンネル RGBA に変換される。 The result of processing an ‘image’ is always a four-channel RGBA result. When an ‘image’ element references a raster image file such as PNG or JPEG files which only has three channels (RGB), then the effect is as if the object were converted into a 4-channel RGBA image with the alpha channel uniformly set to 1. For a single-channel raster image, the effect is as if the object were converted into a 4-channel RGBA image, where the single channel from the referenced object is used to compute the three color channels and the alpha channel is uniformly set to 1.

image 要素は新規のビューポートを 新たなビューポートの確立 で述べられるようにして確立する。 ビューポートの境界は属性 x, y, width, height で指定される。 参照先の画像の配置や拡縮率は image 要素の preserveAspectRatio 属性で制御される。 An ‘image’ element establishes a new viewport for the referenced file as described in Establishing a new viewport. The bounds for the new viewport are defined by attributes ‘x’, ‘y’, ‘width’ and ‘height’. The placement and scaling of the referenced image are controlled by the ‘preserveAspectRatio’ attribute on the ‘image’ element.

image 要素が SVG 画像を参照する場合、 SVG 画像のルート要素の clip, overflow プロパティは無視される( x, y, width, height 属性が無視されるのと同じように)。 image 要素の preserveAspectRatio の値が 'defer' で開始されていない限り、参照先の SVG 画像のルート要素の preserveAspectRatio 属性も無視される(詳細は preserveAspectRatio を見よ)。 その代わり、参照する image 要素の preserveAspectRatio 属性, clip, overflow プロパティが,どのように SVG 画像をビューポートにはめ込み, どのようにクリッピングするか(またはしないか)を決定する。 When an ‘image’ element references an SVG image, the ‘clip’ and ‘overflow’ properties on the root element in the referenced SVG image are ignored (in the same manner as the ‘x’, ‘y’, ‘width’ and ‘height’ attributes are ignored). Unless the value of ‘preserveAspectRatio’ on the ‘image’ element starts with 'defer', the ‘preserveAspectRatio’ attribute on the root element in the referenced SVG image is also ignored (see ‘preserveAspectRatio’ for details). Instead, the ‘preserveAspectRatio’ attribute on the referencing ‘image’ element defines how the SVG image content is fitted into the viewport and the ‘clip’ and ‘overflow’ properties on the ‘image’ element define how the SVG image content is clipped (or not) relative to the viewport.

preserveAspectRatio 属性の評価時に利用される viewBox 属性の値は、参照先の内容で定義される。 明白な viewBox を持つ内容(例えば viewBox 属性が 最も外側の svg 要素 に指定されている SVG ファイル)ならば、その値が利用されるべきである。 ほとんどのラスター画像( PNG, JPEG )では、画像の大きさが利用されるべきである(すなわち, image 要素は暗黙の 'viewBox' の値: '0, 0, ラスター画像の幅, ラスター画像の高さ' を持つ)。 値が指定されていない場合(例えば 最も外側の svg 要素viewBox 属性が指定されていない SVG ファイル)、 preserveAspectRatio 属性は無視され,ビューポートの x, y 属性による変換のみが内容の表示に用いられる。 The value of the ‘viewBox’ attribute to use when evaluating the ‘preserveAspectRatio’ attribute is defined by the referenced content. For content that clearly identifies a viewBox (e.g. an SVG file with the ‘viewBox’ attribute on the outermost svg element) that value should be used. For most raster content (PNG, JPEG) the bounds of the image should be used (i.e. the ‘image’ element has an implicit ‘viewBox’ of '0 0 raster-image-width raster-image-height'). Where no value is readily available (e.g. an SVG file with no ‘viewBox’ attribute on the outermost svg element) the ‘preserveAspectRatio’ attribute is ignored, and only the translation due to the ‘x’ & ‘y’ attributes of the viewport is used to display the content.

例えば image 要素が PNG や JPEG を参照していて, preserveAspectRatio="xMinYMin meet" が指定されているならば、ラスターにおける縦横比は保たれる(画像の座標系から現在の利用座標系への X 軸方向と Y 軸方向の拡縮率は等しくなる)。 ラスターは image 要素の属性 x, y, width, height から定まるビューポートに収まる範囲内まで 可能な限り大きくされ、ラスターの左上隅はビューポートの左上隅に合わせられる。 preserveAspectRatio の値が 'none' の場合、画像の縦横比は維持されない。 画像は ラスターの左上隅が座標 (x, y) に,ラスターの右下隅が座標 (x + width, y + height) に正確に揃うように,はめ込まれる。 For example, if the image element referenced a PNG or JPEG and preserveAspectRatio="xMinYMin meet", then the aspect ratio of the raster would be preserved (which means that the scale factor from image's coordinates to current user space coordinates would be the same for both X and Y), the raster would be sized as large as possible while ensuring that the entire raster fits within the viewport, and the top/left of the raster would be aligned with the top/left of the viewport as defined by the attributes ‘x’, ‘y’, ‘width’ and ‘height’ on the ‘image’ element. If the value of ‘preserveAspectRatio’ was 'none' then aspect ratio of the image would not be preserved. The image would be fitted such that the top/left corner of the raster exactly aligns with coordinate (‘x’, ‘y’) and the bottom/right corner of the raster exactly aligns with coordinate (‘x’+‘width’, ‘y’+‘height’).

image 要素から参照されるリソースは、別個の,構文解析木と(リソースが XML ならば)文書オブジェクトモデルを持つ文書を表現する。 したがって,プロパティは、その画像へは継承されない。 The resource referenced by the ‘image’ element represents a separate document which generates its own parse tree and document object model (if the resource is XML). Thus, there is no inheritance of properties into the image.

use 要素とは異なり, image 要素は SVG ファイル内の要素を参照することはできない。 Unlike ‘use’, the ‘image’ element cannot reference elements within an SVG file.

属性定義

x = "<coordinate>"

参照先の文書が配置される矩形の第一頂点の X 座標。 The x-axis coordinate of one corner of the rectangular region into which the referenced document is placed.

この属性が指定されていない場合の効果は、値 0 が指定されたときと同じになる。 If the attribute is not specified, the effect is as if a value of '0' were specified.

アニメーション:
y = "<coordinate>"

参照先の文書が配置される矩形の第一頂点の Y 座標。 The y-axis coordinate of one corner of the rectangular region into which the referenced document is placed.

この属性が指定されていない場合の効果は、値 0 が指定されたときと同じになる。 If the attribute is not specified, the effect is as if a value of '0' were specified.

アニメーション:
width = "<length>"

参照先の文書が配置される矩形の幅。 The width of the rectangular region into which the referenced document is placed.

負値はエラー( エラー処理 を見よ)。 値をゼロにすると要素は描画されなくなる。 A negative value is an error (see Error processing). A value of zero disables rendering of the element.

アニメーション:
height = "<length>"

参照先の文書が配置される矩形の高さ。 The height of the rectangular region into which the referenced document is placed.

負値はエラー( エラー処理 を見よ)。 値をゼロにすると要素は描画されなくなる。 A negative value is an error (see Error processing). A value of zero disables rendering of the element.

アニメーション:
xlink:href = "<iri>"

IRI 参照 A IRI reference.

アニメーション:
preserveAspectRatio = "[defer] <align> [<meetOrSlice>]"

preserveAspectRatio を見よ。 See ‘preserveAspectRatio’.

preserveAspectRatio 属性が指定されていない場合の効果は、値 xMidYMid meet が指定されたときと同じになる。 If attribute ‘preserveAspectRatio’ is not specified, then the effect is as if a value of xMidYMid meet were specified.

アニメーション:

例: An example:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
  "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="4in" height="3in" version="1.1"
     xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <desc>このグラフィックは外部の画像へリンクする
  </desc>
  <image x="200" y="200" width="100px" height="100px"
         xlink:href="myimage.png">
    <title>My image</title>
  </image>
</svg>

5.8 条件付き処理

5.8.1 条件付き処理の概観

SVG には, UA の能力や利用者の言語環境に応じて代替表示を指定する機能を提供する switch 要素があり、 条件付き処理属性requiredFeatures, requiredExtensions, systemLanguage を伴って利用される。 SVG contains a ‘switch’ element along with attributes ‘requiredFeatures’, ‘requiredExtensions’ and ‘systemLanguage’ to provide an ability to specify alternate viewing depending on the capabilities of a given user agent or the user's language.

条件付き処理属性は、一種のテストのように働くものであり,真または偽の値を返す。 switch 要素は、その子要素のうち,これらの属性がすべて真と評価される 最初の子要素のみを描画する。 これらの属性のうち与えられていないものがあれば、それらの属性についての評価は 真とみなされる。 Attributes ‘requiredFeatures’, ‘requiredExtensions’ and ‘systemLanguage’ act as tests and return either true or false results. The ‘switch’ renders the first of its children for which all of these attributes test true. If the given attribute is not specified, then a true value is assumed.

display プロパティと同様、これらの条件付き処理属性は、要素の直接的描画にのみ影響し,( use 要素などによる)要素から要素への参照には関与しない。 Similar to the ‘display’ property, conditional processing attributes only affect the direct rendering of elements and do not prevent elements from being successfully referenced by other elements (such as via a ‘use’).

ゆえに,各種 条件付き処理属性は: In consequence:

5.8.2 switch 要素

switch
分類:
コンテナ要素
内容モデル:
以下の要素の任意個数, 任意順序の組み合わせ:
属性:
DOM インタフェース:

switch 要素は、その直接の子要素に対し順に,各種 条件付き処理属性を評価し、それらがすべて真となる最初の子要素に対してのみ,その処理と描画を行う。 他の要素は無視され、描画されない。 子要素が g であったとしても、その部分木全体が,処理されるか無視されるか — したがって,描画されるかされないか — のどちらかになる。 The ‘switch’ element evaluates the ‘requiredFeatures’, ‘requiredExtensions’ and ‘systemLanguage’ attributes on its direct child elements in order, and then processes and renders the first child for which these attributes evaluate to true. All others will be bypassed and therefore not rendered. If the child element is a container element such as a ‘g’, then the entire subtree is either processed/rendered or bypassed/not rendered.

注記: display, visibility プロパティの値は, switch 要素の処理には影響しない。 特に、 switch 要素の子の displaynone に設定しても, switch 要素による真偽テストには無関係である。 Note that the values of properties ‘display’ and ‘visibility’ have no effect on ‘switch’ element processing. In particular, setting ‘display’ to none on a child of a ‘switch’ element has no effect on true/false testing associated with ‘switch’ element processing.

更なる詳細と例は 外部の型のオブジェクトの埋め込み を見よ。 For more information and an example, see Embedding foreign object types.

5.8.3 requiredFeatures 属性

requiredFeatures の定義: Definition of requiredFeatures:

requiredFeatures = list-of-features

値は空白で区切られた特能文字列のリスト。 指定されたすべての特能について, UA でサポートされているかどうかが調べられる。 特能文字列には、付録の 特能文字列 にて定義されるもののみを指定できる。 すべての特能がサポートされていれば,この属性は真と評価され、それ以外の場合,要素はその子要素もひっくるめて無視され,描画されない。 The value is a list of feature strings, with the individual values separated by white space. Determines whether all of the named features are supported by the user agent. Only feature strings defined in the Feature String appendix are allowed. If all of the given features are supported, then the attribute evaluates to true; otherwise, the current element and its children are skipped and thus will not be rendered.

アニメーション:不可

この属性が与えられていない場合、暗黙に真と評価される。 この属性に null 文字列または空文字列が指定された場合、偽と評価される。 If the attribute is not present, then its implicit return value is "true". If a null string or empty string value is given to attribute ‘requiredFeatures’, the attribute returns "false".

requiredFeatures は通常, switch 要素と伴用される。 requiredFeatures が他の局面で用いられた場合、その要素を描画するか/しないかの単純なスイッチになる。 ‘requiredFeatures’ is often used in conjunction with the ‘switch’ element. If the ‘requiredFeatures’ is used in other situations, then it represents a simple switch on the given element whether to render the element or not.

5.8.4 requiredExtensions 属性

requiredExtensions 属性は必要な言語拡張のリストを指定する。 言語拡張は,この仕様で定められている特能の範囲外であり、 UA の機能の範疇である。 個々の言語拡張は IRI 参照 により指定される。 The ‘requiredExtensions’ attribute defines a list of required language extensions. Language extensions are capabilities within a user agent that go beyond the feature set defined in this specification. Each extension is identified by an IRI reference.

requiredExtensions の定義: Definition of requiredExtensions:

requiredExtensions = list-of-extensions

値は,要求される拡張を指定する IRI 参照 の空白区切りのリスト。 指定されたすべての拡張について, UA でサポートされているかどうかが調べられる。 すべての拡張がサポートされていれば,この属性は真と評価され、それ以外の場合,要素はその子要素もひっくるめて無視され,描画されない。 The value is a list of IRI references which identify the required extensions, with the individual values separated by white space. Determines whether all of the named extensions are supported by the user agent. If all of the given extensions are supported, then the attribute evaluates to true; otherwise, the current element and its children are skipped and thus will not be rendered.

アニメーション:不可

IRI 参照 に含まれる空白は,エスケープされていなければならない。 If a given IRI reference contains white space within itself, that white space must be escaped.

この属性が与えられていない場合、暗黙に真と評価される。 この属性に null 文字列または空文字列が指定された場合、偽と評価される。 If the attribute is not present, then its implicit return value is "true". If a null string or empty string value is given to attribute ‘requiredExtensions’, the attribute returns "false".

requiredExtensions は通常 switch 要素と伴用される。 requiredExtensions が他の局面で用いられた場合、その要素を描画するか/しないかの単純なスイッチになる。 ‘requiredExtensions’ is often used in conjunction with the ‘switch’ element. If the ‘requiredExtensions’ is used in other situations, then it represents a simple switch on the given element whether to render the element or not.

拡張の IRI 名はスクリプトの書き手が異なるバージョンを区別できるようにするため、 "http://example.org/SVGExtensionXYZ/1.0" のように,バージョン情報も含められるべきである。 The IRI names for the extension should include versioning information, such as "http://example.org/SVGExtensionXYZ/1.0", so that script writers can distinguish between different versions of a given extension.

5.8.5 systemLanguage 属性

この属性の値は、 BCP 47 [BCP47] で定められている言語名のコンマ区切りのリストである。 The attribute value is a comma-separated list of language names as defined in BCP 47 [BCP47].

利用者の環境で設定されている言語の一つが、この属性で指定された言語(の文字列),あるいはその接頭辞(接頭辞に続く最初のタグ区切り文字が "-")に完全に一致するならば,真と評価される。 Evaluates to "true" if one of the languages indicated by user preferences exactly equals one of the languages given in the value of this parameter, or if one of the languages indicated by user preferences exactly equals a prefix of one of the languages given in the value of this parameter such that the first tag character following the prefix is "-".

他の場合、偽と評価される。 Evaluates to "false" otherwise.

注記: この一致規則の利用があるからと言って、言語に対応する言語タグの割り当てが、利用者がなんらかのタグの言語を理解するならば,そのタグを接頭子とするすべてのタグの言語も理解する形で 行われていることを意味するわけではない。 Note: This use of a prefix matching rule does not imply that language tags are assigned to languages in such a way that it is always true that if a user understands a language with a certain tag, then this user will also understand all languages with tags for which this tag is a prefix.

この接頭子一致規則は単純にそのような用法を許容しているに過ぎない。 The prefix rule simply allows the use of prefix tags if this is the case.

実装上の注記:言語について利用者の選好による設定を可能にする場合、実装者は「利用者が上記の言語一致規則の詳細について知らない」ことを念頭に置いて,適切なガイドを提供すべきである。 例えば、利用者は「 "en-gb" を選択しておけば,すべての英語文書は英国英語でなくとも利用できる」と考えるかもしれない。 言語設定のユーザインタフェースでは「最良の言語一致のためには,("en-gb" に加えて)"en" も追加すべきである」旨を示唆すべきである。 Implementation note: When making the choice of linguistic preference available to the user, implementers should take into account the fact that users are not familiar with the details of language matching as described above, and should provide appropriate guidance. As an example, users may assume that on selecting "en-gb", they will be served any kind of English document if British English is not available. The user interface for setting user preferences should guide the user to add "en" to get the best matching behavior.

複数人による同時視聴を意図する内容のために、複数の言語を含めてもよい。 例えば、元のマオリ語に加え, 英語も同時に表現できる内容は、次のように書かれるであろう: Multiple languages MAY be listed for content that is intended for multiple audiences. For example, content that is presented simultaneously in the original Maori and English versions, would call for:

<text systemLanguage="mi, en"><!-- content goes here --></text>

しかしながら、 systemLanguage テスト属性の付いたオブジェクトに複数の言語が用意されているからと言って、複数言語に渡る視聴者向けになるとは限らない。 例えば “A First Lesson in Latin” (ラテン語第一講)の様な,英語を母語とする読者向けであることが明白な 初心者向け言語入門など。 このような場合、 systemLanguage テスト属性は "en" のみを含むべきである。 However, just because multiple languages are present within the object on which the ‘systemLanguage’ test attribute is placed, this does not mean that it is intended for multiple linguistic audiences. An example would be a beginner's language primer, such as "A First Lesson in Latin," which is clearly intended to be used by an English-literate audience. In this case, the ‘systemLanguage’ test attribute should only include "en".

文書作成者への注記: 文書作成者は、 switch 要素に含まれている複数の代替言語のオブジェクトが どれも表示されない可能性を考慮に入れるべきである。 したがって switch 要素の最後に、いかなる場合にも受け入れられる「万能選手」を含めておくことが推奨される。 Authoring note: Authors should realize that if several alternative language objects are enclosed in a ‘switch’, and none of them matches, this may lead to situations where no content is displayed. It is thus recommended to include a "catch-all" choice at the end of such a ‘switch’ which is acceptable in all cases.

systemLanguage 属性に対しては: For the ‘systemLanguage’:

     アニメーション:不可

この属性が与えられていない場合、暗黙に真と評価される。 この属性に null 文字列または空文字列が指定された場合、偽と評価される。 If the attribute is not present, then its implicit return value is "true". If a null string or empty string value is given to attribute ‘systemLanguage’, the attribute returns "false".

systemLanguage は通常 switch 要素と伴用される。 systemLanguage が他の局面で用いられた場合、その要素を描画するか/しないかの単純なスイッチになる。 ‘systemLanguage’ is often used in conjunction with the ‘switch’ element. If the ‘systemLanguage’ is used in other situations, then it represents a simple switch on the given element whether to render the element or not.

5.8.6 テスト属性の適用性

直接的に描画されない要素に対するテスト属性の適用の可否を次に挙げる: The following list describes the applicability of the test attributes to the elements that do not directly produce rendering.

5.9 文書の正当な描画に欠かせない外部リソースの指定

文書はしばしば、他のファイル(他のウェブリソース)を描画の一部として参照利用する。 文書作成者にとっては、他のリソースの存在が文書の正当性に欠かせないかどうか指定したい場合もある。 Documents often reference and use the contents of other files (and other Web resources) as part of their rendering. In some cases, authors want to specify that particular resources are required for a document to be considered correct.

externalResourcesRequired 属性は、すべてのコンテナ要素,および 外部リソースを参照し得るすべての要素に利用できる。 参照先の外部リソースが,与えられたコンテナ要素/グラフィックス要素の正当な描画に欠かせないものかどうかを、この属性で指定できる。 Attribute ‘externalResourcesRequired’ is available on all container elements and to all elements which potentially can reference external resources. It specifies whether referenced resources that are not part of the current document are required for proper rendering of the given container element or graphics element.

属性定義

externalResourcesRequired = "false | true"
false
(既定値)外部リソースは 省略可能であることを指示する。 描画処理は、外部リソースが現在の要素もしくはその子孫において入手できなくても,続行される。 (The default value.) Indicates that resources external to the current document are optional. Document rendering can proceed even if external resources are unavailable to the current element and its descendants.
true
外部リソースが欠かせないことを指示する。 外部リソースが入手できない場合、進行中の描画処理は中断され,文書の SVGLoad イベントは発火されず,アニメーションは そのリソースとすべての必要なリソースが 入手され, 解釈され, 描画準備が完了するまで 開始されない。 もし必要なリソースで時間切れイベントが生じた場合、文書はエラー状態になる( エラー処理 を見よ)。 エラー状態は、必要なリソースが可用になるまで解除されない。 Indicates that resources external to the current document are required. If an external resource is not available, progressive rendering is suspended, the document's SVGLoad event is not fired and the animation timeline does not begin until that resource and all other required resources become available, have been parsed and are ready to be rendered. If a timeout event occurs on a required resource, then the document goes into an error state (see Error processing). The document remains in an error state until all required resources become available.

この属性は、スタイルシート, カラープロファイル( カラープロファイル記述 を見よ), font-face 要素による IRI 参照 で指定されるフォント, CSS @font-face で指定されるフォントを含む,すべての種類のリソース参照に適用できる。 特に externalResourcesRequired="true" に設定された要素が存在する場合、すべてのスタイルシートが可用でなければならない。 なぜなら、どのスタイルシートも要素の描画に影響し得るからである。 This attribute applies to all types of resource references, including style sheets, color profiles (see Color profile descriptions) and fonts specified by an IRI reference using a ‘font-face’ element or a CSS @font-face specification. In particular, if an element sets externalResourcesRequired="true", then all style sheets must be available since any style sheet might affect the rendering of that element.

externalResourcesRequired 属性は(属性値の継承の意味で)継承できないが、コンテナ要素に使用された場合は,含まれるすべての要素に適用される。 Attribute ‘externalResourcesRequired’ is not inheritable (from a sense of attribute value inheritance), but if set on a container element, its value will apply to all elements within the container.

外部リソースを参照する要素を含んでいるコンテナ要素において externalResourcesRequired="true" に指定されている場合、コンテナ内容の漸進的な表示は無効になる。 従って SVG 内容を生成するツール類は、通常の一般動作として単に 最も外側の svg 要素externalResourcesRequired="true" を指定するようなことは避けるべきであり,外部リソースの存在が描画の正しさに特に欠かせないような特定のグラフィックス要素やコンテナ要素に対してのみ, externalResourcesRequired="true" を指定する方がよい。 Because setting externalResourcesRequired="true" on a container element will have the effect of disabling progressive display of the contents of that container, if that container includes elements that reference external resources, tools that generate SVG content are cautioned against simply setting externalResourcesRequired="true" on the outermost svg element on a universal basis. Instead, it is better to specify externalResourcesRequired="true" on those particular graphics elements or container elements which specifically need the availability of external resources in order to render properly.

externalResourcesRequired 属性に対しては: For externalResourcesRequired:

アニメーション:不可

5.10 共通属性

5.10.1 すべての要素に共通の属性: idxml:base

id 属性と xml:base 属性はすべての SVG 要素で利用できる: The ‘id’ and ‘xml:base’ attributes are available on all SVG elements:

属性定義

id = "name"

要素に一意的な名前を与えるための標準 XML 属性。 Extensible Markup Language (XML) 1.0 勧告 [XML10] を参照のこと。 Standard XML attribute for assigning a unique name to an element. Refer to the Extensible Markup Language (XML) 1.0 Recommendation [XML10].

アニメーション:不可
xml:base = "<iri>"

文書または外部実体の基底 IRI 以外の基底 IRI を指定する。 XML Base 仕様 [XML-BASE] を参照のこと。 Specifies a base IRI other than the base IRI of the document or external entity. Refer to the XML Base specification [XML-BASE].

アニメーション:不可

5.10.2 xml:lang and xml:space 属性

文字データ内容を含み得る要素は, xml:lang 属性と xml:space 属性を持つことができる: Elements that might contain character data content have attributes ‘xml:lang’ and ‘xml:space’.

属性定義

xml:lang = "languageID"

内容や属性に利用される言語(例えば英語)を指定する標準 XML 属性。 Extensible Markup Language (XML) 1.0 勧告 [XML10] を参照のこと。 Standard XML attribute to specify the language (e.g., English) used in the contents and attribute values of particular elements. Refer to the Extensible Markup Language (XML) 1.0 Recommendation [XML10].

アニメーション:不可
xml:space = "{default | preserve}"

文字データの空白を保持するかどうかを指定する標準 XML 属性。 default および preserve のみが値として許される。 Extensible Markup Language (XML) 1.0 勧告 [XML10] を参照のこと。 加えて、 SVG における 空白の扱い も見よ。 Standard XML attribute to specify whether white space is preserved in character data. The only possible values are 'default' and 'preserve'. Refer to the Extensible Markup Language (XML) 1.0 Recommendation [XML10] and to the discussion white space handling in SVG.

アニメーション:不可

5.11 DOM インタフェース

5.11.1 インタフェース SVGDocument

svg 要素が, XHTML 文書 [XHTML] などの他の名前空間の文書の部品として, インラインに埋め込まれている場合、 SVGDocument オブジェクトは存在せず,代わりに文書オブジェクト階層のルートオブジェクトは HTMLDocument オブジェクトなどの,異なる型の文書オブジェクトになる。 When an ‘svg’ element is embedded inline as a component of a document from another namespace, such as when an ‘svg’ element is embedded inline within an XHTML document [XHTML], then an SVGDocument object will not exist; instead, the root object in the document object hierarchy will be a Document object of a different type, such as an HTMLDocument object.

一方で、独立 SVG ファイル(すなわち MIME タイプ "image/svg+xml" のファイル)を閲覧しているときの様に, XML 文書階層におけるルート要素が svg 要素である場合、 SVGDocument オブジェクトが実際に存在する。 この場合の SVGDocument オブジェクトは,文書オブジェクトモデル階層のルートオブジェクトになる。 However, an SVGDocument object will indeed exist when the root element of the XML document hierarchy is an ‘svg’ element, such as when viewing a stand-alone SVG file (i.e., a file with MIME type "image/svg+xml"). In this case, the SVGDocument object will be the root object of the document object model hierarchy.

XHTML 文書が object 要素を持ち, その href 属性が SVG 文書(すなわち MIME タイプ "image/svg+xml" のファイルであり,したがってそのルート要素が svg 要素)を参照しているときなど, SVG 文書が参照を介して埋め込まれている場合、2つの別々の DOM 階層が存在することになる。 一つは参照している文書のもの(例えば XHTML 文書)であり, もう一つは参照先の SVG 文書のものになる。 後者におけるルートオブジェクトは SVGDocument オブジェクトである。 In the case where an SVG document is embedded by reference, such as when an XHTML document has an ‘object’ element whose ‘href’ attribute references an SVG document (i.e., a document whose MIME type is "image/svg+xml" and whose root element is thus an ‘svg’ element), there will exist two distinct DOM hierarchies. The first DOM hierarchy will be for the referencing document (e.g., an XHTML document). The second DOM hierarchy will be for the referenced SVG document. In this second DOM hierarchy, the root object of the document object model hierarchy is an SVGDocument object.

SVGDocument インタフェースは [DOM1] 仕様の 文書オブジェクトモデル (HTML) レベル 1 の HTMLDocument インタフェースと類似する,属性とメソッドのリストを含んでいる。 The SVGDocument interface contains a similar list of attributes and methods to the HTMLDocument interface described in the Document Object Model (HTML) Level 1 chapter of the [DOM1] specification.

interface SVGDocument : Document,
                        DocumentEvent {
  readonly attribute DOMString title;
  readonly attribute DOMString referrer;
  readonly attribute DOMString domain;
  readonly attribute DOMString URL;
  readonly attribute SVGSVGElement rootElement;
};
属性
title (readonly DOMString)

svg ルート要素の title 子要素で指定される文書のタイトル(すなわち <svg><title>Here is the title</title>...</svg> The title of a document as specified by the ‘title’ sub-element of the ‘svg’ root element (i.e., <svg><title>Here is the title</title>...</svg>)

referrer (readonly DOMString)

このページにリンクするページの URI 。 利用者が直接的にページを開いた場合の値は空文字列になる(リンクを通してではなく,例えばブックマークなどから)。 Returns the URI of the page that linked to this page. The value is an empty string if the user navigated to the page directly (not through a link, but, for example, via a bookmark).

domain (readonly DOMString)

文書を供するサーバのドメイン名,あるいはドメイン名からサーバが特定できない場合は null 文字列。 The domain name of the server that served the document, or a null string if the server cannot be identified by a domain name.

URL (readonly DOMString)

文書の完全な URI 。 The complete URI of the document.

rootElement (readonly SVGSVGElement)

文書階層におけるルートの svg 要素。 The root ‘svg’ in the document hierarchy.

5.11.2 インタフェース SVGSVGElement

SVGSVGElement インタフェースは、 svg 要素に対応する,基本的なインタフェースである。 このインタフェースは、行列演算や視覚描画装置に対する再描画の時間的制御など,有用かつ多方面に共通して利用される様々なメソッドを含む。 A key interface definition is the SVGSVGElement interface, which is the interface that corresponds to the ‘svg’ element. This interface contains various miscellaneous commonly-used utility methods, such as matrix operations and the ability to control the time of redraw on visual rendering devices.

SVGSVGElementViewCSSDocumentCSS を拡張し、プロパティの算出値へのアクセスと DOM Level 2 Style [DOM2STYLE] で述べられているスタイルシートの上書きを提供する。 SVGSVGElement extends ViewCSS and DocumentCSS to provide access to the computed values of properties and the override style sheet as described in DOM Level 2 Style [DOM2STYLE].

interface SVGSVGElement : SVGElement,
                          SVGTests,
                          SVGLangSpace,
                          SVGExternalResourcesRequired,
                          SVGStylable,
                          SVGLocatable,
                          SVGFitToViewBox,
                          SVGZoomAndPan,
                          DocumentEvent,
                          ViewCSS,
                          DocumentCSS {

  readonly attribute SVGAnimatedLength x;
  readonly attribute SVGAnimatedLength y;
  readonly attribute SVGAnimatedLength width;
  readonly attribute SVGAnimatedLength height;
           attribute DOMString contentScriptType setraises(DOMException);
           attribute DOMString contentStyleType setraises(DOMException);
  readonly attribute SVGRect viewport;
  readonly attribute float pixelUnitToMillimeterX;
  readonly attribute float pixelUnitToMillimeterY;
  readonly attribute float screenPixelToMillimeterX;
  readonly attribute float screenPixelToMillimeterY;
  readonly attribute boolean useCurrentView;
  readonly attribute SVGViewSpec currentView;
           attribute float currentScale;
  readonly attribute SVGPoint currentTranslate;

  unsigned long suspendRedraw(in unsigned long maxWaitMilliseconds);
  void unsuspendRedraw(in unsigned long suspendHandleID);
  void unsuspendRedrawAll();
  void forceRedraw();
  void pauseAnimations();
  void unpauseAnimations();
  boolean animationsPaused();
  float getCurrentTime();
  void setCurrentTime(in float seconds);
  NodeList getIntersectionList(in SVGRect rect, in SVGElement referenceElement);
  NodeList getEnclosureList(in SVGRect rect, in SVGElement referenceElement);
  boolean checkIntersection(in SVGElement element, in SVGRect rect);
  boolean checkEnclosure(in SVGElement element, in SVGRect rect);
  void deselectAll();
  SVGNumber createSVGNumber();
  SVGLength createSVGLength();
  SVGAngle createSVGAngle();
  SVGPoint createSVGPoint();
  SVGMatrix createSVGMatrix();
  SVGRect createSVGRect();
  SVGTransform createSVGTransform();
  SVGTransform createSVGTransformFromMatrix(in SVGMatrix matrix);
  Element getElementById(in DOMString elementId);
};
属性
x (readonly SVGAnimatedLength)

svg 要素の x 属性に対応する。 Corresponds to attribute ‘x’ on the given ‘svg’ element.

y (readonly SVGAnimatedLength)

svg 要素の y 属性に対応する。 Corresponds to attribute ‘y’ on the given ‘svg’ element.

width (readonly SVGAnimatedLength)

svg 要素の width 属性に対応する。 Corresponds to attribute ‘width’ on the given ‘svg’ element.

height (readonly SVGAnimatedLength)

svg 要素の height 属性に対応する。 Corresponds to attribute ‘height’ on the given ‘svg’ element.

contentScriptType (DOMString)

与えられた svg 要素の contentScriptType 属性に対応する。 Corresponds to attribute ‘contentScriptType’ on the given ‘svg’ element.

設定時の例外
DOMException, code NO_MODIFICATION_ALLOWED_ERR
読み取り専用の属性 の値の変更を試みたときに投出される。 Raised on an attempt to change the value of a read only attribute.
contentStyleType (DOMString)

svg 要素の contentStyleType 属性に対応する。 Corresponds to attribute ‘contentStyleType’ on the given ‘svg’ element.

設定時の例外
DOMException, code NO_MODIFICATION_ALLOWED_ERR
読み取り専用の属性 の値の変更を試みたときに投出される。 Raised on an attempt to change the value of a read only attribute.
viewport (readonly SVGRect)

この svg 要素に対応する(暗黙または明示的な)ビューポートの位置と大きさ。 UA が実際に内容を描画しているときは、その実際の位置と大きさを表現する。 位置と大きさは親要素の座標系における単位無しの値を表す。 親要素が存在しない場合(すなわち svg 要素が文書木のルート)、この SVG 文書が他の文書の一部として埋め込まれているならば(例えば HTML の object 要素により),親の文書の座標系における単位無しの値を表す(もし親が CSS または XSL によるレイアウトを利用している場合、単位無しの値は CSS2 仕様で述べられるように,現在の CSS または XSL ビューポートの画素単位による値を表現する)。 親要素が座標系を持たない場合、 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. The position and size values are unitless values in the coordinate system of the parent element. If no parent element exists (i.e., ‘svg’ element represents the root of the document tree), 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 CSS2 specification.) If the parent element does not have a coordinate system, then the user agent should provide reasonable default values for this attribute.

SVGRect オブジェクト自身とその内容は共に 読み取り専用 である。 The SVGRect object is read only.

pixelUnitToMillimeterX (readonly float)

ビューポートの X 軸方向の( CSS2 で定義されているものと同様な)画素単位による長さ。 70dpi から 120dpi までの範囲のどこかを表現し、システムがサポートしていれば対象メディアの特性に合致させられ得る。 システムが画素の大きさを知り得ない場合は、適切な画素の大きさが既定値として与えられる。 Size of a pixel units (as defined by CSS2) along the x-axis of the viewport, which represents a unit somewhere in the range of 70dpi to 120dpi, and, on systems that support this, might actually match the characteristics of the target medium. On systems where it is impossible to know the size of a pixel, a suitable default pixel size is provided.

pixelUnitToMillimeterY (readonly float)

前記に相応するビューポートの Y 軸方向の画素単位による長さ。 Corresponding size of a pixel unit along the y-axis of the viewport.

screenPixelToMillimeterX (readonly float)

ビューポートのスクリーン単位による X 軸方向の長さ。 DOM レベル2の UI イベントは与えられた UI イベントが生じたときのスクリーンにおける位置を指示する。 UA が実際に「スクリーン単位」の物理的な長さを知ることができれば、この属性はその情報を表す。 できない場合、 UA は 0.28mm などの適当な既定値を与える。 User interface (UI) events in DOM Level 2 indicate the screen positions at which the given UI event occurred. When the user agent actually knows the physical size of a "screen unit", this attribute will express that information; otherwise, user agents will provide a suitable default value such as .28mm.

screenPixelToMillimeterY (readonly float)

前項に相応する,ビューポートのスクリーン単位による Y 軸方向の長さ。 Corresponding size of a screen pixel along the y-axis of the viewport.

useCurrentView (readonly boolean)

現在の最も内側の SVG 文書片の初期表示(すなわちズームとパンがなされる前の表示)は、「標準」表示(すなわち viewBox などの svg 要素の属性に基づく表示)または「カスタム」表示(すなわち特定の view または他の要素へのハイパーリンクによる表示 — SVG 内容の中へのリンク: URI 片と SVG ビュー を見よ)のいずれも有り得る。 初期表示が「標準」表示の場合、この属性は偽になる。 初期表示が「カスタム」表示の場合、この属性は真になる。 The initial view (i.e., before magnification and panning) of the current innermost SVG document fragment can be either the "standard" view (i.e., based on attributes on the ‘svg’ element such as ‘viewBox’) or to a "custom" view (i.e., a hyperlink into a particular ‘view’ or other element - see Linking into SVG content: IRI fragments and SVG views). If the initial view is the "standard" view, then this attribute is false. If the initial view is a "custom" view, then this attribute is true.

currentView (readonly SVGViewSpec)

現在の最も内側の SVG 文書片の初期表示(すなわちズームとパンがなされる前の)の定義。 その意味は状況に依存する: The definition of the initial view (i.e., before magnification and panning) of the current innermost SVG document fragment. The meaning depends on the situation:

  • 初期表示が「標準」表示であった場合: If the initial view was a "standard" view, then:

    • currentView 内の viewBox, preserveAspectRatio, zoomAndPan の値は SVGSVGElement の対応する DOM 属性の値と直接的に一致する。 the values for viewBox, preserveAspectRatio and zoomAndPan within currentView will match the values for the corresponding DOM attributes that are on SVGSVGElement directly
    • currentView 内の transformviewTarget の値は null になる。 the values for transform and viewTarget within currentView will be null
  • 初期表示が view 要素へのリンクによるものであった場合: If the initial view was a link into a ‘view’ element, then:

    • currentView 内の viewBox, preserveAspectRatio, zoomAndPan の値はその view 要素の対応する属性に対応する。 the values for viewBox, preserveAspectRatio and zoomAndPan within currentView will correspond to the corresponding attributes for the given ‘view’ element
    • currentView 内の transformviewTarget の値は null にされる。 the values for transform and viewTarget within currentView will be null
  • 初期表示が他の(すなわち view 以外の)要素へのリンクによるものであった場合: If the initial view was a link into another element (i.e., other than a ‘view’), then:

    • currentView 内の viewBox, preserveAspectRatio, zoomAndPan の値は最も近い先祖の svg 要素に対応する SVGSVGElement の対応する DOM 属性の値と直接的に一致する。 the values for viewBox, preserveAspectRatio and zoomAndPan within currentView will match the values for the corresponding DOM attributes that are on SVGSVGElement directly for the closest ancestor ‘svg’ element
    • currentView 内の transform の値は null にされる。 the values for transform within currentView will be null
    • currentView 内の viewTarget の値はリンク先を表す。 the viewTarget within currentView will represent the target of the link
  • 初期表示が SVG ビュー指定片識別子(すなわち #svgView(...))を用いた SVG 文書片へのリンクによるものであった場合: If the initial view was a link into the SVG document fragment using an SVG view specification fragment identifier (i.e., #svgView(...)), then:

    • currentView 内の viewBox, preserveAspectRatio, zoomAndPan, transform, viewTarget の値は SVG ビュー指定片識別子による値に対応する。 the values for viewBox, preserveAspectRatio, zoomAndPan, transform and viewTarget within currentView will correspond to the values from the SVG view specification fragment identifier

オブジェクト自身とその内容はいずれも読み取り専用である。 The object itself and its contents are both read only.

currentScale (float)

最も外側の svg 要素 において、この属性は,利用者による ズームとパン も含めた,初期表示からの現在の表示倍率を表す。 DOM 属性 currentScale, currentTranslate は、 2x3 行列 [a b c d e f] = [currentScale 0 0 currentScale currentTranslate.x currentTranslate.y] に等価である。 つまり,ズームとパンが可用にされている場合(すなわち, zoomAndPan="magnify" )、追加の変換が SVG 文書片の最も外側のレベル(すなわち 最も外側の svg 要素 の外側)に置かれたように働く。 On an outermost svg element, this attribute indicates the current scale factor relative to the initial view to take into account user magnification and panning operations, as described under Magnification and panning. DOM attributes currentScale and currentTranslate are equivalent to the 2x3 matrix [a b c d e f] = [currentScale 0 0 currentScale currentTranslate.x currentTranslate.y]. If "magnification" is enabled (i.e., zoomAndPan="magnify"), then the effect is as if an extra transformation were placed at the outermost level on the SVG document fragment (i.e., outside the outermost svg element).

svg 要素が 最も外側の svg 要素 でない場合の,この属性のふるまいは、未定義である。 When accessed on an ‘svg’ element that is not an outermost svg element, it is undefined what behavior this attribute has.

currentTranslate (readonly SVGPoint)

最も外側の svg 要素 においては、前記に相応する利用者によるズームとパン操作を計算に入れた並進量。 On an outermost svg element, the corresponding translation factor that takes into account user "magnification".

最も外側の svg 要素 でない svg 要素においては、この属性のふるまいは未定義である。 When accessed on an ‘svg’ element that is not an outermost svg element, it is undefined what behavior this attribute has.

演算
unsigned long suspendRedraw(in unsigned long maxWaitMilliseconds)

休止時間をパラメタにとり、次のいずれかの時点まで再描画を休止させることを指示する: Takes a time-out value which indicates that redraw shall not occur until:

  1. 対応する unsuspendRedraw() 呼び出しが行われた時。 the corresponding unsuspendRedraw() call has been made,
  2. unsuspendRedrawAll() 呼び出しが行われたか、または an unsuspendRedrawAll() call has been made, or
  3. 休止時間が経過した時。 its timer has timed out.

対話性がサポートされない環境(例えば印刷メディア)においては、再描画は休止されないものとする。 suspendRedraw() と unsuspendRedraw() の呼び出しは対にすべきであるが、必須ではない。 In environments that do not support interactivity (e.g., print media), then redraw shall not be suspended. Calls to suspendRedraw() and unsuspendRedraw() should, but need not be, made in balanced pairs.

一連の SVG DOM における変化がもたらす再描画を休止させたい場合は、 SVG DOM に対する変更の前に: To suspend redraw actions as a collection of SVG DOM changes occur, precede the changes to the SVG DOM with a method call similar to:

suspendHandleID = suspendRedraw(maxWaitMilliseconds);

の様にメソッドを呼び出し,変更後に次の様にメソッドを呼び出す: and follow the changes with a method call similar to:

unsuspendRedraw(suspendHandleID);

suspendRedraw を複数回同時に呼び出した場合の各呼び出しは、それぞれ,他から独立に扱われることに注意。 Note that multiple suspendRedraw calls can be used at once and that each such method call is treated independently of the other suspendRedraw method calls.

パラメタ
  1. unsigned long maxWaitMilliseconds

    装置への再描画を休止する時間の長さをミリ秒で指定する。 60 秒以上の値は 60 秒に抑えられる。 The amount of time in milliseconds to hold off before redrawing the device. Values greater than 60 seconds will be truncated down to 60 seconds.

返り値

呼び出しに対する一意的な識別子として働く数。 対応する suspendRedraw() の呼び出しには、この値が渡されなければならない。 A number which acts as a unique identifier for the given suspendRedraw() call. This value must be passed as the parameter to the corresponding unsuspendRedraw() method call.

void unsuspendRedraw(in unsigned long suspendHandleID)

以前の suspendRedraw() 呼び出しから得られた識別子に対応する suspendRedraw() を取り消す。 Cancels a specified suspendRedraw() by providing a unique suspend handle ID that was returned by a previous suspendRedraw() call.

パラメタ
  1. unsigned long suspendHandleID

    取り消したい suspendRedraw() 呼び出しに対応する一意的な識別子。 この値は前の suspendRedraw() 呼び出しの返り値でなければならない。 無効な識別子が渡された場合、 unsuspendRedraw() は黙って無視される。 A number which acts as a unique identifier for the desired suspendRedraw() call. The number supplied must be a value returned from a previous call to suspendRedraw(). If an invalid handle ID value is provided then the request to unsuspendRedraw() is silently ignored.

void unsuspendRedrawAll()

現在有効な suspendRedraw() メソッド呼び出しすべてを取り消す。 このメソッドは、一連の SVG DOM 呼び出しの最終段階で,すべての suspendRedraw() メソッド呼び出しを清算するときに最も有用である。 Cancels all currently active suspendRedraw() method calls. This method is most useful at the very end of a set of SVG DOM calls to ensure that all pending suspendRedraw() method calls have been cancelled.

void forceRedraw()

対話性をサポートする描画環境において、ビューポートにおいて更新が必要なすべての領域の再描画を直ちに行うことを UA に強制する。 In rendering environments supporting interactivity, forces the user agent to immediately redraw all regions of the viewport that require updating.

void pauseAnimations()

この svg 要素に対応する SVG 文書片内で定義されている,すべての活動中のアニメーションを休止させる。 この文書片におけるアニメーションの計時は、休止状態が解除されるまで一時停止する。 Suspends (i.e., pauses) all currently running animations that are defined within the SVG document fragment corresponding to this ‘svg’ element, causing the animation clock corresponding to this document fragment to stand still until it is unpaused.

void unpauseAnimations()

この svg 要素に対応する SVG 文書片内で定義されている,すべての休止中のアニメーションを再開させる。 この文書片におけるアニメーションの計時は、一時停止の時点から再開される。 Unsuspends (i.e., unpauses) currently running animations that are defined within the SVG document fragment, causing the animation clock to continue from the time at which it was suspended.

boolean animationsPaused()

この SVG 文書片が休止状態の間、真を返す。 Returns true if this SVG document fragment is in a paused state.

返り値

この SVG 文書片が休止状態かどうかを表す真偽値。 Boolean indicating whether this SVG document fragment is in a paused state.

float getCurrentTime()

現在の SVG 文書片の始動時刻から経過した現在の時刻を秒で返す。 文書時間軸が開始される前に getCurrentTime が呼び出された場合(例えば文書の SVGLoad イベントが配送される前の script 要素内のスクリプトからの呼び出し)、 0 が返される。 Returns the current time in seconds relative to the start time for the current SVG document fragment. If getCurrentTime is called before the document timeline has begun (for example, by script running in a ‘script’ element before the document's SVGLoad event is dispatched), then 0 is returned.

返り値

秒単位による現在の時刻。 文書の時間軸が開始されていなければ 0 。 The current time in seconds, or 0 if the document timeline has not yet begun.

void setCurrentTime(in float seconds)

この SVG 文書片の計時を調整して、新しく現在の時刻を設定する。 文書時間軸が開始される前に setCurrentTime が呼び出された場合(例えば文書の SVGLoad イベントが配送される前の script 要素内のスクリプトから呼び出された場合)、文書時間軸の開始の際には,メソッドの最後の呼び出しで与えた seconds による時刻へ飛ぶことになる。 Adjusts the clock for this SVG document fragment, establishing a new current time. If setCurrentTime is called before the document timeline has begun (for example, by script running in a ‘script’ element before the document's SVGLoad event is dispatched), then the value of seconds in the last invocation of the method gives the time that the document will seek to once the document timeline has begun.

パラメタ
  1. float seconds

    新しく設定する現在の時刻を現在の SVG 文書片の始動時刻からの秒数で与える。 The new current time in seconds relative to the start time for the current SVG document fragment.

NodeList getIntersectionList(in SVGRect rect, in SVGElement referenceElement)

引数に与えられた矩形と描画域とが交わるグラフィックス要素のリストを返す。 ただし条件に適うものは、 pointer-events 処理で定められる,ポインタイベントの標的になれるグラフィックス要素のみとする。 Returns the list of graphics elements whose rendered content intersects the supplied rectangle. Each candidate graphics element is to be considered a match only if the same graphics element can be a target of pointer events as defined in ‘pointer-events’ processing.

パラメタ
  1. SVGRect rect

    テストする矩形。 値は現在の svg 要素の 初期座標系 におけるもの。 The test rectangle. The values are in the initial coordinate system for the current ‘svg’ element.

  2. SVGElement referenceElement

    null でないならば、交わる要素のうち referenceElement を先祖に持たないものは,返される NodeList から除外されなければならない。 If not null, then any intersected element that doesn't have the referenceElement as ancestor must not be included in the returned NodeList.

返り値

描画内容が与えられた矩形と交わる要素のリスト。 この NodeList は、インタフェースが live でないことを除き, ([DOM2], 1.2 節) で定められた NodeList インタフェースと同じになるように実装されなければならない。 A list of Elements whose content intersects the supplied rectangle. This NodeList must be implemented identically to the NodeList interface as defined in DOM Level 2 Core ([DOM2], section 1.2) with the exception that the interface is not live.

NodeList getEnclosureList(in SVGRect rect, in SVGElement referenceElement)

描画内容全体が引数に与えられた矩形に囲まれるグラフィックス要素のリストを返す。 ただし条件に適うものは、 pointer-events 処理で定められる,ポインタイベントの標的になれるグラフィックス要素のみとする。 Returns the list of graphics elements whose rendered content is entirely contained within the supplied rectangle. Each candidate graphics element is to be considered a match only if the same graphics element can be a target of pointer events as defined in ‘pointer-events’ processing.

パラメタ
  1. SVGRect rect

    テストする矩形。 値は現在の svg 要素の 初期座標系 におけるもの。 The test rectangle. The values are in the initial coordinate system for the current ‘svg’ element.

  2. SVGElement referenceElement

    null でないならば、囲まれる要素のうち referenceElement を先祖に持たないものは,返される NodeList から除外されなければならない。 If not null, then any intersected element that doesn't have the referenceElement as ancestor must not be included in the returned NodeList.

返り値

描画内容全体が引数に与えられた矩形に囲まれる要素のリスト。 この NodeList は、インタフェースが live でないことを除き, ([DOM2], 1.2 節) で定められた NodeList インタフェースと同じになるように実装されなければならない。 A list of Elements whose content is enclosed by the supplied rectangle. This NodeList must be implemented identically to the NodeList interface as defined in DOM Level 2 Core ([DOM2], section 1.2) with the exception that the interface is not live.

boolean checkIntersection(in SVGElement element, in SVGRect rect)

引数に与えられた要素の描画内容が引数に与えられた矩形と交わるとき、真を返す。 ただし条件に適うものは、 pointer-events 処理で定められる,ポインタイベントの標的になれるグラフィックス要素のみとする。 Returns true if the rendered content of the given element intersects the supplied rectangle. Each candidate graphics element is to be considered a match only if the same graphics element can be a target of pointer events as defined in ‘pointer-events’ processing.

パラメタ
  1. SVGElement element

    テストする要素。 The element on which to perform the given test.

  2. SVGRect rect

    テストする矩形。 値は現在の svg 要素の 初期座標系 におけるもの。 The test rectangle. The values are in the initial coordinate system for the current ‘svg’ element.

返り値

与えられた要素が与えられた矩形と交わるかどうかを表す真偽値。 True or false, depending on whether the given element intersects the supplied rectangle.

boolean checkEnclosure(in SVGElement element, in SVGRect rect)

引数に与えられた要素の描画内容全体が引数に与えられた矩形に囲まれるとき、真を返す。 ただし条件に適うものは、 pointer-events 処理で定められる,ポインタイベントの標的になれるグラフィックス要素のみとする。 Returns true if the rendered content of the given element is entirely contained within the supplied rectangle. Each candidate graphics element is to be considered a match only if the same graphics element can be a target of pointer events as defined in ‘pointer-events’ processing.

パラメタ
  1. SVGElement element

    テストする要素。 The element on which to perform the given test.

  2. SVGRect rect

    テストする矩形。 値は現在の svg 要素の 初期座標系 におけるもの。 The test rectangle. The values are in the initial coordinate system for the current ‘svg’ element.

返り値

与えられた要素が与えられた矩形に囲まれるかどうかを表す真偽値。 True or false, depending on whether the given element is enclosed by the supplied rectangle.

void deselectAll()

テキスト文字列や文字入力域の選択も含め、選択されているオブジェクトの選択を解除する。 Unselects any selected objects, including any selections of text strings and type-in bars.

SVGNumber createSVGNumber()

文書木の外に SVGNumber オブジェクトを作成する。 オブジェクトは値 0 に初期化される。 Creates an SVGNumber object outside of any document trees. The object is initialized to a value of zero.

返り値

SVGNumber オブジェクト。 An SVGNumber object.

SVGLength createSVGLength()

文書木の外に SVGLength オブジェクトを作成する。 オブジェクトは値 0 利用単位に初期化される。 Creates an SVGLength object outside of any document trees. The object is initialized to the value of 0 user units.

返り値

SVGLength オブジェクト。 An SVGLength object.

SVGAngle createSVGAngle()

文書木の外に SVGAngle オブジェクトを作成する。 オブジェクトは値 0 に初期化される(単位なし)。 Creates an SVGAngle object outside of any document trees. The object is initialized to the value 0 degrees (unitless).

返り値

SVGAngle オブジェクト。 An SVGAngle object.

SVGPoint createSVGPoint()

文書木の外に SVGPoint オブジェクトを作成する。 オブジェクトは利用座標系の点 (0, 0) に初期化される。 Creates an SVGPoint object outside of any document trees. The object is initialized to the point (0,0) in the user coordinate system.

返り値

SVGPoint オブジェクト。 An SVGPoint object.

SVGMatrix createSVGMatrix()

文書木の外に SVGMatrix オブジェクトを作成する。 オブジェクトは単位行列に初期化される。 Creates an SVGMatrix object outside of any document trees. The object is initialized to the identity matrix.

返り値

SVGMatrix オブジェクト。 An SVGMatrix object.

SVGRect createSVGRect()

文書木の外に SVGRect オブジェクトを作成する。 オブジェクトはすべての値が 0 利用単位に初期化される。 Creates an SVGRect object outside of any document trees. The object is initialized such that all values are set to 0 user units.

返り値

SVGRect オブジェクト。 An SVGRect object.

SVGTransform createSVGTransform()

文書木の外に SVGTransform オブジェクトを作成する。 オブジェクトは単位行列による変換( SVG_TRANSFORM_MATRIX )に初期化される。 Creates an SVGTransform object outside of any document trees. The object is initialized to an identity matrix transform (SVG_TRANSFORM_MATRIX).

返り値

SVGTransform オブジェクト。 An SVGTransform object.

SVGTransform createSVGTransformFromMatrix(in SVGMatrix matrix)

文書木の外に SVGTransform オブジェクトを作成する。 オブジェクトは与えられた行列による変換(すなわち SVG_TRANSFORM_MATRIX )に初期化される。 パラメタ matrix からの値は複製され、 matrix がそのまま SVGTransform::matrix になることはない。 Creates an SVGTransform object outside of any document trees. The object is initialized to the given matrix transform (i.e., SVG_TRANSFORM_MATRIX). The values from the parameter matrix are copied, the matrix parameter is not adopted as SVGTransform::matrix.

パラメタ
  1. SVGMatrix matrix

    変換行列。 The transform matrix.

返り値

SVGTransform オブジェクト。 An SVGTransform object.

Element getElementById(in DOMString elementId)

与えられた elementId を id に持つ Element オブジェクトをこの SVG 文書片から検索する(すなわち検索範囲は文書木の一部分に限定される)。 Element が見つかった場合はそれが返され、見つからなかった場合は null が返される。 複数の要素がこの id を持つ場合のふるまいは未定義である。 Searches this SVG document fragment (i.e., the search is restricted to a subset of the document tree) for an Element whose id is given by elementId. If an Element is found, that Element is returned. If no such element exists, returns null. Behavior is not defined if more than one element has this id.

パラメタ
  1. DOMString elementId

    要素に対し一意的な id 値。 The unique id value for an element.

返り値

合致した要素。 The matching element.

5.11.3 インタフェース SVGGElement

SVGSVGElement インタフェースは g 要素に対応する。 The SVGSVGElement interface corresponds to the ‘g’ element.

interface SVGGElement : SVGElement,
                        SVGTests,
                        SVGLangSpace,
                        SVGExternalResourcesRequired,
                        SVGStylable,
                        SVGTransformable {
};

5.11.4 インタフェース SVGDefsElement

SVGDefsElement インタフェースは defs 要素に対応する。 The SVGDefsElement interface corresponds to the ‘defs’ element.

interface SVGDefsElement : SVGElement,
                           SVGTests,
                           SVGLangSpace,
                           SVGExternalResourcesRequired,
                           SVGStylable,
                           SVGTransformable {
};

5.11.5 インタフェース SVGDescElement

SVGDescElement インタフェースは desc 要素に対応する。 The SVGDescElement interface corresponds to the ‘desc’ element.

interface SVGDescElement : SVGElement,
                           SVGLangSpace,
                           SVGStylable {
};

5.11.6 インタフェース SVGTitleElement

SVGTitleElement インタフェースは title 要素に対応する。 The SVGTitleElement interface corresponds to the ‘title’ element.

interface SVGTitleElement : SVGElement,
                            SVGLangSpace,
                            SVGStylable {
};

5.11.7 インタフェース SVGSymbolElement

SVGSymbolElement インタフェースは symbol 要素に対応する。 The SVGSymbolElement interface corresponds to the ‘symbol’ element.

interface SVGSymbolElement : SVGElement,
                             SVGLangSpace,
                             SVGExternalResourcesRequired,
                             SVGStylable,
                             SVGFitToViewBox {
};

5.11.8 インタフェース SVGUseElement

SVGUseElement インタフェースは use 要素に対応する。 The SVGUseElement interface corresponds to the ‘use’ element.

interface SVGUseElement : SVGElement,
                          SVGURIReference,
                          SVGTests,
                          SVGLangSpace,
                          SVGExternalResourcesRequired,
                          SVGStylable,
                          SVGTransformable {
  readonly attribute SVGAnimatedLength x;
  readonly attribute SVGAnimatedLength y;
  readonly attribute SVGAnimatedLength width;
  readonly attribute SVGAnimatedLength height;
  readonly attribute SVGElementInstance instanceRoot;
  readonly attribute SVGElementInstance animatedInstanceRoot;
};
属性
x (readonly SVGAnimatedLength)

与えられた use 要素の x 属性に対応する。 Corresponds to attribute ‘x’ on the given ‘use’ element.

y (readonly SVGAnimatedLength)

与えられた use 要素の y 属性に対応する。 Corresponds to attribute ‘y’ on the given ‘use’ element.

width (readonly SVGAnimatedLength)

与えられた use 要素の width 属性に対応する。 Corresponds to attribute ‘width’ on the given ‘use’ element.

height (readonly SVGAnimatedLength)

与えられた use 要素の height 属性に対応する。 Corresponds to attribute ‘height’ on the given ‘use’ element.

instanceRoot (readonly SVGElementInstance)

「インスタンス木」のルート。 インスタンス木についての説明は SVGElementInstance の記述を見よ。 The root of the "instance tree". See description of SVGElementInstance for a discussion on the instance tree.

animatedInstanceRoot (readonly SVGElementInstance)

xlink:href 属性がアニメートされている場合は現在アニメーション中の「インスタンス木」のルート。 xlink:href 属性がアニメートされていない場合は instanceRoot と同じ値をとる。 インスタンス木についての説明は SVGElementInstance の記述を見よ。 If the ‘xlink:href’ attribute is being animated, contains the current animated root of the "instance tree". If the ‘xlink:href’ attribute is not currently being animated, contains the same value as instanceRoot. See description of SVGElementInstance for a discussion on the instance tree.

5.11.9 インタフェース SVGElementInstance

use 要素に対し、 SVG DOM は SVGElementInstance 型のオブジェクトからなる非公開木(「インスタンス木」)を維持管理する。 SVGElementInstance はインスタンス木における1個のノードを表現する。 use 要素に対応する SVGUseElement オブジェクトの instanceRoot 属性がインスタンス木のルートオブジェクトを指す。 For each ‘use’ element, the SVG DOM maintains a shadow tree (the "instance tree") of objects of type SVGElementInstance. An SVGElementInstance represents a single node in the instance tree. The root object in the instance tree is pointed to by the instanceRoot attribute on the SVGUseElement object for the corresponding ‘use’ element.

use 要素が rect などの単純なグラフィックス要素を参照する場合、ただ1個の SVGElementInstance オブジェクトが存在し,この SVGElementInstance オブジェクトの correspondingElement 属性は参照先の rect 要素に対応する SVGRectElement になる。 If the ‘use’ element references a simple graphics element such as a ‘rect’, then there is only a single SVGElementInstance object, and the correspondingElement attribute on this SVGElementInstance object is the SVGRectElement that corresponds to the referenced ‘rect’ element.

use 要素が2個の rect 要素を持つ g 要素を参照している場合、インスタンス木には3個の SVGElementInstance オブジェクト — ルートの SVGElementInstance オブジェクトでその correspondingElementg に対応する SVGGElement オブジェクトになるもの, および 2個の SVGElementInstance 子オブジェクトでそれぞれの correspondingElementSVGRectElement オブジェクトになるもの — が存在する。 If the ‘use’ element references a ‘g’ which contains two ‘rect’ elements, then the instance tree contains three SVGElementInstance objects, a root SVGElementInstance object whose correspondingElement is the SVGGElement object for the ‘g’, and then two child SVGElementInstance objects, each of which has its correspondingElement that is an SVGRectElement object.

参照先のオブジェクト自身が use 要素であるか,あるいは参照先のオブジェクト内に use 子要素がある場合、インスタンス木は完全な木を形成するために間接参照を通して再帰的に拡張される。 例えば use 要素が g を参照していて, g 要素自身が use を含んでいて,その userect 要素を参照している場合、最初の(最も外側の) use のインスタンス木は次のような SVGElementInstance オブジェクト階層で構成される: If the referenced object is itself a ‘use’, or if there are ‘use’ subelements within the referenced object, the instance tree will contain recursive expansion of the indirect references to form a complete tree. For example, if a ‘use’ element references a ‘g’, and the ‘g’ itself contains a ‘use’, and that ‘use’ references a ‘rect’, then the instance tree for the original (outermost) ‘use’ will consist of a hierarchy of SVGElementInstance objects, as follows:

SVGElementInstance #1 (parentNode=null, firstChild=#2, correspondingElement is the 'g')
  SVGElementInstance #2 (parentNode=#1, firstChild=#3, correspondingElement is the other 'use')
    SVGElementInstance #3 (parentNode=#2, firstChild=null, correspondingElement is the 'rect')
interface SVGElementInstance : EventTarget {
  readonly attribute SVGElement correspondingElement;
  readonly attribute SVGUseElement correspondingUseElement;
  readonly attribute SVGElementInstance parentNode;
  readonly attribute SVGElementInstanceList childNodes;
  readonly attribute SVGElementInstance firstChild;
  readonly attribute SVGElementInstance lastChild;
  readonly attribute SVGElementInstance previousSibling;
  readonly attribute SVGElementInstance nextSibling;
};
属性
correspondingElement (readonly SVGElement)

このオブジェクトがそのインスタンスとなる、対応する要素。 例えば use 要素が rect 要素を参照しているならば、 correspondingElementrect 要素に対応する SVGRectElement オブジェクトになるような SVGElementInstance が作成される。 The corresponding element to which this object is an instance. For example, if a ‘use’ element references a ‘rect’ element, then an SVGElementInstance is created, with its correspondingElement being the SVGRectElement object for the ‘rect’ element.

correspondingUseElement (readonly SVGUseElement)

この SVGElementInstance オブジェクトが属するインスタンス木に対応する use 要素。 use 要素が入れ子になっている場合(例えば use が別の use 要素を参照していて,その use 要素が rect 要素などのグラフィックス要素を参照している場合)、 correspondingUseElement は最も外側の(すなわち、 rect, を直接参照する use 要素の方ではなく,間接的に参照する方の) use になる。 The corresponding ‘use’ element to which this SVGElementInstance object belongs. When ‘use’ elements are nested (e.g., a ‘use’ references another ‘use’ which references a graphics element such as a ‘rect’), then the correspondingUseElement is the outermost ‘use’ (i.e., the one which indirectly references the ‘rect’, not the one with the direct reference).

parentNode (readonly SVGElementInstance)

インスタンス木における,この SVGElementInstance の親。 SVGElementInstance オブジェクトは use 要素に直接参照されている要素に対応する場合に限り、親を持たず,その場合の parentNode は null になる。 The parent of this SVGElementInstance within the instance tree. All SVGElementInstance objects have a parent except the SVGElementInstance which corresponds to the element which was directly referenced by the ‘use’ element, in which case parentNode is null.

childNodes (readonly SVGElementInstanceList)

インスタンス木における,この SVGElementInstance のすべての子からなる SVGElementInstanceList 。 子が存在しない場合、項目が空の SVGElementInstanceList になる(すなわち、空リスト)。 An SVGElementInstanceList that contains all children of this SVGElementInstance within the instance tree. If there are no children, this is an SVGElementInstanceList containing no entries (i.e., an empty list).

firstChild (readonly SVGElementInstance)

インスタンス木における,この SVGElementInstance の最初の子。 存在しない場合は null を返す。 The first child of this SVGElementInstance within the instance tree. If there is no such SVGElementInstance, this returns null.

lastChild (readonly SVGElementInstance)

インスタンス木における,この SVGElementInstance の最後の子。 存在しない場合は null を返す。 The last child of this SVGElementInstance within the instance tree. If there is no such SVGElementInstance, this returns null.

previousSibling (readonly SVGElementInstance)

この SVGElementInstance の直前にある SVGElementInstance 。 存在しない場合は null を返す。 The SVGElementInstance immediately preceding this SVGElementInstance. If there is no such SVGElementInstance, this returns null.

nextSibling (readonly SVGElementInstance)

この SVGElementInstance の直後にある SVGElementInstance 。 存在しない場合は null を返す。 The SVGElementInstance immediately following this SVGElementInstance. If there is no such SVGElementInstance, this returns null.

5.11.10 インタフェース SVGElementInstanceList

SVGElementInstanceList インタフェースは、実装の仕方を定義/制約しない,抽象化された SVGElementInstance オブジェクトの順序付きのリストを表現する。 The SVGElementInstanceList interface provides the abstraction of an ordered collection of SVGElementInstance objects, without defining or constraining how this collection is implemented.

interface SVGElementInstanceList {

  readonly attribute unsigned long length;

  SVGElementInstance item(in unsigned long index);
};
属性
length (readonly unsigned long)

リストに含まれる SVGElementInstance オブジェクトの個数。 ノードのインデックスの範囲は 0 から length-1 まで。 The number of SVGElementInstance objects in the list. The range of valid child indices is 0 to length-1 inclusive.

演算
SVGElementInstance item(in unsigned long index)

リストの index 番目のノードを返す。 index がリスト内のノード数以上の場合は null を返す。 Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.

パラメタ
  1. unsigned long index

    リストの項目のインデックス。 Index into the collection.

返り値

SVGElementInstanceListindex 番目の SVGElementInstance オブジェクト。 インデックスが無効な場合は null を返す。 The SVGElementInstance object at the indexth position in the SVGElementInstanceList, or null if that is not a valid index.

5.11.11 インタフェース SVGImageElement

SVGImageElement インタフェースは image 要素に対応する。 The SVGImageElement interface corresponds to the ‘image’ element.

interface SVGImageElement : SVGElement,
                            SVGURIReference,
                            SVGTests,
                            SVGLangSpace,
                            SVGExternalResourcesRequired,
                            SVGStylable,
                            SVGTransformable {
  readonly attribute SVGAnimatedLength x;
  readonly attribute SVGAnimatedLength y;
  readonly attribute SVGAnimatedLength width;
  readonly attribute SVGAnimatedLength height;
  readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio;
};
属性
x (readonly SVGAnimatedLength)

与えられた image 要素の x 属性に対応する。 Corresponds to attribute ‘x’ on the given ‘image’ element.

y (readonly SVGAnimatedLength)

与えられた image 要素の y 属性に対応する。 Corresponds to attribute ‘y’ on the given ‘image’ element.

width (readonly SVGAnimatedLength)

与えられた image 要素の width 属性に対応する。 Corresponds to attribute ‘width’ on the given ‘image’ element.

height (readonly SVGAnimatedLength)

与えられた image 要素の height 属性に対応する。 Corresponds to attribute ‘height’ on the given ‘image’ element.

preserveAspectRatio (readonly SVGAnimatedPreserveAspectRatio)

与えられた image 要素の preserveAspectRatio 属性に対応する。 Corresponds to attribute ‘preserveAspectRatio’ on the given ‘image’ element.

5.11.12 インタフェース SVGSwitchElement

SVGSwitchElement インタフェースは switch 要素に対応する。 The SVGSwitchElement interface corresponds to the ‘switch’ element.

interface SVGSwitchElement : SVGElement,
                             SVGTests,
                             SVGLangSpace,
                             SVGExternalResourcesRequired,
                             SVGStylable,
                             SVGTransformable {
};

5.11.13 インタフェース GetSVGDocument

このインタフェースは、他の DOM ベースの言語に対し,参照を通して埋め込まれた SVG 文書へのアクセスを提供する。 例外は、 HTML object 要素に対応する DOM Element オブジェクトなどの様に, DOM オブジェクトにそのような SVG 文書への参照を可能にするインタフェースが実装されている場合である。 大抵の場合、そのような DOM オブジェクトには Window 仕様 [WINDOW] で定められている EmbeddingElement の実装も要求されている。 This interface provides access to an SVG document embedded by reference in another DOM-based language. The expectation is that the interface is implemented on DOM objects that allow such SVG document references, such as the DOM Element object that corresponds to an HTML ‘object’ element. Such DOM objects are often also required to implement the EmbeddingElement defined in the Window specification [WINDOW].

このインタフェースは廃止予定にあり、将来版の SVG 仕様からは削除され得る。 文書作成者には、参照先の SVG 文書の取得する際には(もしあれば) EmbeddingElement インタフェースの contentDocument 属性の利用が奨励される。 This interface is deprecated and may be dropped from future versions of the SVG specification. Authors are suggested to use the contentDocument attribute on the EmbeddingElement interface to obtain a referenced SVG document, if that interface is available.

interface GetSVGDocument {
  SVGDocument getSVGDocument();
};
演算
SVGDocument getSVGDocument()

このメソッドは、埋め込んでいる要素における,埋め込み内容の Document オブジェクト,あるいは文書が存在していなければ null を返さなければならない。 This method must return the Document object embedded content in an embedding element, or null if there is no document.

これは埋め込んでいる要素に EmbeddingElement インタフェースも実装されているならば、その要素の EmbeddingElement::contentDocument 属性にアクセスするに等しくなることに注意。 文書作成者には、返された Document が実際に svg 要素なのかどうか確かめることを薦める。 Note that this is equivalent to fetching the value of the EmbeddingElement::contentDocument attribute of the embedding element, if the EmbeddingElement interface is also implemented. The author is advised to check that the document element of the returned Document is indeed an ‘svg’ element instead of assuming that that will always be the case.

返り値

参照先の SVG 文書に対する Document オブジェクト。 存在しなければ null を返す。 The Document object for the referenced document, or null if there is no document.

目次詳細目次前章次章要素属性プロパティ