14 January 2003 翻訳更新: 2010/05/02

16 対話性


目次


16.1 概要

次に挙げる SVG 言語の特色機能の利用により、 SVG 内容に対話性(即ち利用者からのイベントに反応する)を持たせられる:

SVG content can be interactive (i.e., responsive to user-initiated events) by utilizing the following features in the SVG language:

この章では次について述べる:

This chapter describes:

他の章にも関連する情報がある:

Related information can be found in other chapters:

16.2 サポートされているイベントの完全な一覧

SVG では、以下の仕組みにおいてイベントが作用する:

The following aspects of SVG are affected by events:

次の表に、 SVG から認識されサポートされる全てのイベントを挙げる。 最初の列のイベント名はアニメーションを開始/終了させるイベントを定義するために SVG の アニメーション要素 で利用される名前である。3列目の DOM2 名DOM2 イベントリスナ を定義するために利用される名前である。5列目のイベント属性名は対応する イベント属性 の名前であり、 SVG 言語の要素に付加することができる。

The following table lists all of the events which are recognized and supported in SVG. The Event name in the first column is the name to use within SVG's animation elements to define the events which can start or end animations. The DOM2 name in the third column is the name to use when defining DOM2 event listeners. The Event attribute name in the fifth column contains the corresponding name of the event attributes that can be attached to elements in the SVG language.

イベント名 説明 DOM2 名 DOM2 分類 イベント属性名
Event name Description DOM2 name DOM2 category Event attribute name
focusin 'text' が選択されたときなど、要素がフォーカスを得た時に生ずる。 DOMFocusIn UIEvent onfocusin
focusin Occurs when an element receives focus, such as when a 'text' becomes selected. DOMFocusIn UIEvent onfocusin
focusout 'text' の選択が解除されたときなど、要素がフォーカスを失った時に生ずる。 DOMFocusOut UIEvent onfocusout
focusout Occurs when an element loses focus, such as when a 'text' becomes unselected. DOMFocusOut UIEvent onfocusout
activate マウスクリックやキーの押下などにより、要素が活性化した時に生ずる。どのように活性化されたかを示唆する数値引数が与えられる: 1 は単純活性化(例えば単純なクリックや Enter キー) 2 はハイパー活性化(例えばダブルクリックやシフトキーを押しながらの Enter キー)。 DOMActivate UIEvent onactivate
activate Occurs when an element is activated, for instance, thru a mouse click or a keypress. A numerical argument is provided to give an indication of the type of activation that occurs: 1 for a simple activation (e.g. a simple click or Enter), 2 for hyperactivation (for instance a double click or Shift Enter). DOMActivate UIEvent onactivate
click ポインティング装置のボタンが要素の上でクリックされた時に生ずる。クリックとは、画面上の同じ位置における mousedown (ボタン押下)と mouseup (ボタン解放)として定義される。これらのイベントが生ずる順番は: mousedown, mouseup, click である。複数回のクリックが画面上の同じ位置で生じた場合、この一連のイベントは繰り返され、 detail 属性が各反復ごとに1ずつ増加する。 (same) MouseEvent onclick
click Occurs when the pointing device button is clicked over an element. A click is defined as a mousedown and mouseup over the same screen location. The sequence of these events is: mousedown, mouseup, click. If multiple clicks occur at the same screen location, the sequence repeats with the detail attribute incrementing with each repetition. (same) MouseEvent onclick
mousedown ポインティング装置のボタンが要素上で押下された時に生ずる。 (same) MouseEvent onmousedown
mousedown Occurs when the pointing device button is pressed over an element. (same) MouseEvent onmousedown
mouseup ポインティング装置のボタンが要素上で解放された時に生ずる。 (same) MouseEvent onmouseup
mouseup Occurs when the pointing device button is released over an element. (same) MouseEvent onmouseup
mouseover ポインティング装置が要素上へ入った時に生ずる。 (same) MouseEvent onmouseover
mouseover Occurs when the pointing device is moved onto an element. (same) MouseEvent onmouseover
mousemove ポインティング装置が要素上で動かされた時に生ずる。 (same) MouseEvent onmousemove
mousemove Occurs when the pointing device is moved while it is over an element. (same) MouseEvent onmousemove
mouseout ポインティング装置が要素上から出た時に生ずる。 (same) MouseEvent onmouseout
mouseout Occurs when the pointing device is moved away from an element. (same) MouseEvent onmouseout
DOMSubtreeModified この総体的イベントは文書へのあらゆる変更を通知するためにある。これは下に挙げられている、より詳細なイベントのかわりに用いることができる。(このイベントの正式な定義は DOM2 仕様 を参照のこと。) (same) MutationEvent none
DOMSubtreeModified This is a general event for notification of all changes to the document. It can be used instead of the more specific events listed below. (The normative definition of this event is the description in the DOM2 specification.) (same) MutationEvent none
DOMNodeInserted ノードが他のノードの子として挿入された後に発火される。(このイベントの正式な定義は DOM2 仕様 を参照のこと。) (same) MutationEvent none
DOMNodeInserted Fired when a node has been added as a child of another node. (The normative definition of this event is the description in the DOM2 specification.) (same) MutationEvent none
DOMNodeRemoved ノードが別のノードから削除される前に発火される。(このイベントの正式な定義は DOM2 仕様 を参照のこと。) (same) MutationEvent none
DOMNodeRemoved Fired when a node is being removed from another node. (The normative definition of this event is the description in the DOM2 specification.) (same) MutationEvent none
DOMNodeRemovedFromDocument ノードが文書から削除される前に発火される(ノードを含む部分木が文書から削除される場合も発火される)。(このイベントの正式な定義は DOM2 仕様 を参照のこと。) (same) MutationEvent none
DOMNodeRemovedFromDocument Fired when a node is being removed from a document, either through direct removal of the Node or removal of a subtree in which it is contained. (The normative definition of this event is the description in the DOM2 specification.) (same) MutationEvent none
DOMNodeInsertedIntoDocument ノードが文書に挿入された後に発火される(ノードを含む部分木が文書に挿入される場合も発火される)。(このイベントの正式な定義は DOM2 仕様 を参照のこと。) (same) MutationEvent none
DOMNodeInsertedIntoDocument Fired when a node is being inserted into a document, either through direct insertion of the Node or insertion of a subtree in which it is contained. (The normative definition of this event is the description in the DOM2 specification.) (same) MutationEvent none
DOMAttrModified ノードの属性が変更された後に発火される。(このイベントの正式な定義は DOM2 仕様 を参照のこと。) (same) MutationEvent none
DOMAttrModified Fired after an attribute has been modified on a node. (The normative definition of this event is the description in the DOM2 specification.) (same) MutationEvent none
DOMCharacterDataModified ノード自身は挿入も削除もされていないがノード内の CharacterData が変更された後に発火される(このイベントの正式な定義は DOM2 仕様 を参照のこと。) (same) MutationEvent none
DOMCharacterDataModified Fired after CharacterData within a node has been modified but the node itself has not been inserted or deleted. (The normative definition of this event is the description in the DOM2 specification.) (same) MutationEvent none
SVGLoad このイベントはUAが要素とその子孫要素の構文解析を完了し、対象装置への要素の描画準備が完了したときなど、要素に対する処理の準備が完了した時に発火される。 文書の正当性に欠かせない外部リソースの指定 に対する読み込み, 構文解析, 描画準備はイベントの発火前に完了していなければならない。 (same) none onload
SVGLoad The event is triggered at the point at which the user agent has fully parsed the element and its descendants and is ready to act appropriately upon that element, such as being ready to render the element to the target device. Referenced external resources that are required must be loaded, parsed and ready to render before the event is triggered. Optional external resources are not required to be ready for the event to be triggered. (same) none onload
SVGUnload 最も外側の svg 要素 にのみ適用され得る。 unload イベントは DOM 実装が文書をウインドウまたはフレームから削除する時に生ずる。 (same) none onunload
SVGUnload Only applicable to outermost 'svg' elements. The unload event occurs when the DOM implementation removes a document from a window or frame. (same) none onunload
SVGAbort abort イベントは要素が完全に読み込まれる前にページの読み込みが中止された時に生ずる。 (same) none onabort
SVGAbort The abort event occurs when page loading is stopped before an element has been allowed to load completely. (same) none onabort
SVGError error イベントは要素が正しく読み込まれなかった時、あるいはスクリプトの実行時にエラーが生じたときに生ずる。 (same) none onerror
SVGError The error event occurs when an element does not load properly or when an error occurs during script execution. (same) none onerror
SVGResize 文書表示領域の大きさが変更された時に生ずる。このイベントは 最も外側の svg 要素 にのみ適用可能であり、大きさの変更操作が終了した後に配送( dispatch )される。イベントの標的は 'svg' 要素である。 (same) none onresize
SVGResize Occurs when a document view is being resized. This event is only applicable to outermost 'svg' elements and is dispatched after the resize operation has taken place. The target of the event is the 'svg' element. (same) none onresize
SVGScroll 文書表示が利用者による操作、あるいは SVGSVGElement インターフェースで利用可能な 'currentTranslate' プロパティの変更に伴って、X軸またはY軸あるいはその両方に沿ってずらされた時に生ずる。このイベントは 最も外側の svg 要素 にのみ適用可能であり、ずらし操作が終了した後に配送される。イベントの標的は 'svg' 要素である。 (same) none onscroll
SVGScroll Occurs when a document view is being shifted along the X or Y or both axis, either through a direct user interaction or any change on the 'currentTranslate' property available on SVGSVGElement interface. This event is only applicable to outermost 'svg' elements and is dispatched after the shift modification has taken place. The target of the event is the 'svg' element. (same) none onscroll
SVGZoom 文書表示におけるズームの度合いが利用者による操作、あるいは SVGSVGElement インターフェースで利用可能な 'currentScale' プロパティの変更に伴って変化した時に生ずる。このイベントは 最も外側の svg 要素 にのみ適用可能であり、ズームの変更が終了した後に配送される。イベントの標的は 'svg' 要素である。 none none onzoom
SVGZoom Occurs when the zoom level of a document view is being changed, either through a direct user interaction or any change to the 'currentScale' property available on SVGSVGElement interface. This event is only applicable to outermost 'svg' elements and is dispatched after the zoom level modification has taken place. The target of the event is the 'svg' element. none none onzoom
beginEvent アニメーション要素が開始された時に生ずる。詳細は SMIL アニメーション仕様 のインターフェース TimeEvent の記述を参照。 none none onbegin
beginEvent Occurs when an animation element begins. For details, see the description of Interface TimeEvent in the SMIL Animation specification. none none onbegin
endEvent アニメーション要素が終了した時に生ずる。詳細は SMIL アニメーション仕様 のインターフェース TimeEvent の記述を参照。 none none onend
endEvent Occurs when an animation element ends. For details, see the description of Interface TimeEvent in the SMIL Animation specification. none none onend
repeatEvent アニメーション要素が繰り返された時に生ずる。最初の反復の後の各繰り返しごとに生じる。詳細は SMIL アニメーション仕様 のインターフェース TimeEvent の記述を参照。 none none onrepeat
repeatEvent Occurs when an animation element repeats. It is raised each time the element repeats, after the first iteration. For details, see the description of Interface TimeEvent in the SMIL Animation specification. none none onrepeat

DOM2 キーイベント で述べられている様に、 SVG の仕様にはキーイベントセットが提供されていない。キーボード入力装置のためのイベントセットは将来版の DOM と SVG 仕様に含まれる予定である。

As in DOM2 Key events, the SVG specification does not provide a key event set. An event set designed for use with keyboard input devices will be included in a later version of the DOM and SVG specifications.

SVGLoad イベントはイベントが適用されている要素のみに配送され、その祖先には配送されない。例えば、 'image' 要素とその親の 'g' 要素の両方に SVGLoad イベントに対応するイベントリスナが割り当てられている場合、 'image' 要素が読み込まれた時は、そのイベントリスナのみが呼び出される。( 'g' 要素のイベントリスナは実際に呼び出されるが、それは 'g' が読み込まれた時点のことである。)
エラータ :この段落は SVG Tiny 1.2 との一貫性を保つため、次の短い一文に置き換えられた)
SVGLoad イベントは浮上しない。

A SVGLoad event is dispatched only to the element to which the event applies; it is not dispatched to its ancestors. For example, if an 'image' element and its parent 'g' element both have event listeners for SVGLoad events, when the 'image' element has been loaded, only its event listener will be invoked. (The 'g' element's event listener will indeed get invoked, but the invocation will happen when the 'g' itself has been loaded.)

DOM2 のイベント型においてイベントリスナに渡されるパラメタの詳細は DOM2 仕様を参照のこと。他のイベント型においてイベントリスナに渡されるパラメタはこの仕様の他の場所で述べられる。

Details on the parameters passed to event listeners for the event types from DOM2 can be found in the DOM2 specification. For other event types, the parameters passed to event listeners are described elsewhere in this specification.

16.3 UIイベント

対話性をサポートするUA向けに、文書作成者がUIイベント(ユーザーインターフェース・イベント)に反応できるように SVG 文書を定義することはごく一般的なことである。UIイベントには ポインタイベント, キーボードイベント, 文書イベントがある。

On user agents which support interactivity, it is common for authors to define SVG documents such that they are responsive to user interface events. Among the set of possible user events are pointer events, keyboard events, and document events.

文書作成者はUIイベントへの反応として、アニメーションの開始, 他のウェブページへのハイパーリンクの実行, 文書の一部のハイライト(例えばポインタに重なるグラフィックス要素の色を変化させるなど), 「ロールオーバー( roll-over )」の開始(例えばポインタの傍にあらかじめ隠されてあったグラフィックス要素が現れる), リモートのデータベースと交信するスクリプトの起動, 等々をさせられる。

In response to user interface (UI) events, the author might start an animation, perform a hyperlink to another Web page, highlight part of the document (e.g., change the color of the graphics elements which are under the pointer), initiate a "roll-over" (e.g., cause some previously hidden graphics elements to appear near the pointer) or launch a script which communicates with a remote database.

イベント属性 または アニメーション により SVG 言語の一部としてとして定義される全てのUIイベント関連の特色機能では、イベントのモデルは DOM2 [DOM2-EVBUBBLE] によるイベント浮上( event bubbling )モデルに対応する。一方、 DOM2 [DOM2-EVCAPTURE] によるイベント捕獲( event capture )モデルは DOM メソッド呼び出しのみにより確立できる。

For all UI event-related features defined as part of the SVG language via event attributes or animation, the event model corresponds to the event bubbling model described in DOM2 [ DOM2-EVBUBBLE]. The event capture model from DOM2 [ DOM2-EVCAPTURE] can only be established from DOM method calls.

16.4 ポインタイベント

利用者のポインティング装置の行為によって生ずるUIイベントをポインタイベントと呼ぶ。

User interface events that occur because of user actions performed on a pointer device are called pointer events.

多くのシステムはマウスやトラックボールなどのポインティング装置をサポートする。マウスを利用するシステムでは、ポインタイベントはマウスの移動やマウスクリックなどの行為から生ずる。異なるポインティング装置を利用するシステムでは、ボタンの押下をマウスクリックと等価なものとするなど、利用者による行為を等価なものに置き換える仕組みを提供することにより、マウスの振る舞いをエミュレートする。

Many systems support pointer devices such as a mouse or trackball. On systems which use a mouse, pointer events consist of actions such as mouse movements and mouse clicks. On systems with a different pointer device, the pointing device often emulates the behavior of the mouse by providing a mechanism for equivalent user actions, such as a button to press which is equivalent to a mouse click.

ポインタイベントそれぞれに対し、 SVG-UAはポインタイベントの標的要素( target element )を決定する。標的要素はイベントが生じた時点において、要素に関連付けられたグラフィック内容がポインタに重なるグラフィックス要素のうち、最も手前にあるものになる。(要素に関連付けられたグラフィック内容がポインタに重なるかどうかがどのように決定されるか、その状況においてグラフィックス要素がポインタイベントの標的要素になり得るかどうかについては 'pointer-events' プロパティを見よ。)要素が表示されない(即ち要素またはその祖先の 'display' プロパティの値が none )の場合、その要素はポインタイベントの標的になり得ない。

For each pointer event, the SVG user agent determines the target element of a given pointer event. The target element is the topmost graphics element whose relevant graphical content is under the pointer at the time of the event. (See property 'pointer-events' for a description of how to determine whether an element's relevant graphical content is under the pointer, and thus in which circumstances that graphic element can be the target element for a pointer event.) When an element is not displayed (i.e., when the 'display' property on that element or one of its ancestors has a value of none), that element cannot be the target of pointer events.

イベントは標的要素に配送されるか, 標的要素の祖先の一つに配送されるか, あるいは配送されないかのいずれかであり、次に依存して定まる:

The event is either initially dispatched to the target element, to one of the target element's ancestors, or not dispatched, depending on the following:

イベント浮上 [DOM2-EVBUBBLE] の過程においては、標的要素の直接の祖先全てにわたる浮上が生ずる。子孫側が祖先側より先にイベントを受け取る。したがって 'path' 要素が 'g' 要素の子であり、その両方が click イベントに対するイベントリスナを持つ場合、そのイベントは 'g' 要素の前に 'path' 要素に配送される。

When event bubbling [ DOM2-EVBUBBLE] is active, bubbling occurs up to all direct ancestors of the target element. Descendant elements receive events before their ancestors. Thus, if a 'path' element is a child of a 'g' element and they both have event listeners for click events, then the event will be dispatched to the 'path' element before the 'g' element.

イベント捕獲 [DOM2-EVCAPTURE] の過程においては、祖先要素がその子孫より先にイベントを受け取る。

When event capturing [ DOM2-EVCAPTURE] is active, ancestor elements receive events before their descendants.

イベントが最初に特定の要素に配送された後、更なる処理をさせない適切な動作(例えば preventCapture() または preventBubble() DOM メソッド呼び出しなど)がなされない限り、イベントは要素の祖先(イベント浮上の場合)または子孫(イベント捕獲の場合)に更なる処理をさせられる適切なイベントハンドラがあれば、それに渡される。

After an event is initially dispatched to a particular element, unless an appropriate action has been taken to prevent further processing (e.g., by invoking the preventCapture() or preventBubble() DOM method call), the event will be passed to the appropriate event handlers (if any) for that element's ancestors (in the case of event bubbling) or that element's descendants (in the case of event capture) for further processing.

16.5 UIイベントの処理順序

UIイベントの処理順序は次の様になる:

The processing order for user interface events is as follows:


16.6 'pointer-events' プロパティ

文書作成者にとっては、どのような状況下で特定のグラフィックス要素がポインタイベントの標的になれるかどうかを制御したくなる場面がある。例えば、ストロークされた図形の境界部にポインタが重なるときにのみポインタイベントを受け取れるようにしたい場合や、要素の奥にあるグラフィックス要素がポインタイベントの標的になれるよう、いかなる状況においても手前の要素がポインタイベントを無視するようにさせたい場合などがある。

In different circumstances, authors may want to control under what circumstances particular graphic elements can become the target of pointer events. For example, the author might want a given element to receive pointer events only when the pointer is over the stroked perimeter of a given shape. In other cases, the author might want a given element to ignore pointer events under all circumstances so that graphical elements underneath the given element will become the target of pointer events.

具体的には、 'fill'blue にされた矩形の上に、 'stroke'red (即ち外形線が赤色)に、かつ 'fill'none (即ち内部は塗られない)にされた円形が直接描画されている状況下で、円形の境界部にポインタが重なるときにのみ円形がポインタイベントの標的になるようにさせ、円形の内部にポインタが重なるときは奥の矩形がポインタイベントの標的になるようにさせたい場合などである。

For example, suppose a circle with a 'stroke' of red (i.e., the outline is solid red) and a 'fill' of none (i.e., the interior is not painted) is rendered directly on top of a rectangle with a 'fill' of blue. The author might want the circle to be the target of pointer events only when the pointer is over the perimeter of the circle. When the pointer is over the interior of the circle, the author might want the underlying rectangle to be the target element of pointer events.

エラータ :次の段落を追加)

クリッピングパスが適用されている場合、その外側は 'pointer-events' の値の如何に関わらず、ポインタイベントに反応しない。一方で、マスクが適用されている場合、マスクの不透明度が0の場所であってもポインタイベントは捕獲される。クリッピングパスは幾何的な境界であり、点が内側か外側かを判定することは容易い一方、マスクは二分的なものではなく、完全に透明な場所と「ほぼ」透明な場所で振る舞いが異なるのでは混乱を招くので。

'pointer-events' プロパティは、どのような状況でグラフィックス要素がポインタイベントの標的要素になれるかを指示する。これは次に挙げるものの処理に影響を及ぼす:

The 'pointer-events' property specifies under what circumstances a given graphics element can be the target element for a pointer event. It affects the circumstances under which the following are processed:

'pointer-events'
値:   visiblePainted | visibleFill | visibleStroke | visible |
painted | fill | stroke | all | none | inherit
初期値:   visiblePainted
適用対象:   グラフィックス要素
継承:   有り
パーセント:   N/A
メディア:   視覚
アニメーション  
Value:   visiblePainted | visibleFill | visibleStroke | visible |
painted | fill | stroke | all | none | inherit
Initial:   visiblePainted
Applies to:   graphics elements
Inherited:   yes
Percentages:   N/A
Media:   visual
Animatable:   yes
visiblePainted
'visibility' プロパティが visible に設定されており、かつ「塗られた」領域にポインタが重なっているときにポインタイベントの標的要素になれる。塗られた領域にポインタが重なるとは、要素の内部(即ちフィル)にポインタが重なっており、かつ 'fill' プロパティが none 以外の値に設定されているか、あるいは要素の境界部(即ちストローク)にポインタが重なっており、かつ 'stroke' プロパティが none 以外の値に設定されていることを意味する。 エラータ : 'fill' の値が( URI 参照により間接的に設定されるなどにより)、実際に none になる場合もポインタと重なっていないものとする。)
The given element can be the target element for pointer events when the 'visibility' property is set to visible and when the pointer is over a "painted" area. The pointer is over a painted area if it is over the interior (i.e., fill) of the element and the 'fill' property is set to a value other than 'none' or it is over the perimeter (i.e., stroke) of the element and the 'stroke' property is set to a value other than 'none'.
visibleFill
'visibility' プロパティが visible に設定されており、かつ要素の内部(即ちフィル)にポインタが重なっているときにポインタイベントの標的要素になれる。 'fill' プロパティの値はイベント処理に影響しない。
The given element can be the target element for pointer events when the 'visibility' property is set to visible and when the pointer is over the interior (i.e., fill) of the element. The value of the 'fill' property does not effect event processing.
visibleStroke
'visibility' プロパティが visible に設定されており、かつ要素の境界部(即ちストローク)にポインタが重なっているときにポインタイベントの標的要素になれる。 'stroke' プロパティの値はイベント処理に影響しない。
The given element can be the target element for pointer events when the 'visibility' property is set to visible and when the pointer is over the perimeter (i.e., stroke) of the element. The value of the 'stroke' property does not effect event processing.
visible
'visibility' プロパティが visible に設定されており、かつ要素の内部(即ちフィル)または境界部(即ちストローク)にポインタが重なっているときにポインタイベントの標的要素になれる。 'fill', 'stroke' プロパティの値はイベント処理に影響しない。
The given element can be the target element for pointer events when the 'visibility' property is set to visible and the pointer is over either the interior (i.e., fill) or the perimeter (i.e., stroke) of the element. The values of the 'fill' and 'stroke' do not effect event processing.
painted
要素の「塗られた」領域にポインタが重なっているときにポインタイベントの標的要素になれる。塗られた領域にポインタが重なっているとは、要素の内部(即ちフィル)に重なっており、かつ 'fill' プロパティが none 以外の値に設定されているか、あるいは要素の境界部(即ちストローク)に重なっており、かつ 'stroke' プロパティが none 以外の値に設定されていることを意味する。 'visibility' プロパティの値はイベント処理に影響しない。 エラータ : 'fill' あるいは 'stroke' の値が( URI 参照により間接的に設定されるなどにより)、実際に none になる場合もポインタと重なっていないものとする。)
The given element can be the target element for pointer events when the pointer is over a "painted" area. The pointer is over a painted area if it is over the interior (i.e., fill) of the element and the 'fill' property is set to a value other than 'none' or it is over the perimeter (i.e., stroke) of the element and the 'stroke' property is set to a value other than 'none'. The value of the 'visibility' property does not effect event processing.
fill
要素の内部(即ちフィル)にポインタが重なっているときにポインタイベントの標的要素になれる。 'fill''visibility' プロパティの値はイベント処理に影響しない。
The given element can be the target element for pointer events when the pointer is over the interior (i.e., fill) of the element. The values of the 'fill' and 'visibility' properties do not effect event processing.
stroke
要素の境界部(即ちストローク)にポインタが重なっているときにポインタイベントの標的要素になれる。 'stroke', 'visibility' プロパティの値はイベント処理に影響しない。
The given element can be the target element for pointer events when the pointer is over the perimeter (i.e., stroke) of the element. The values of the 'stroke' and 'visibility' properties do not effect event processing.
all
要素の内部(即ちフィル)または境界部(即ちストローク)にポインタが重なっているときにポインタイベントの標的要素になれる。 'fill', 'stroke', 'visibility' プロパティの値はイベント処理に影響しない。
The given element can be the target element for pointer events whenever the pointer is over either the interior (i.e., fill) or the perimeter (i.e., stroke) of the element. The values of the 'fill', 'stroke' and 'visibility' properties do not effect event processing.
none
要素はポインタイベントを受け取らない。
The given element does not receive pointer events.

テキスト要素に対しては、文字セルを基に当たり判定が行われる:

For text elements, hit detection is performed on a character cell basis:

ラスター画像に対する当たり判定は画像全体(即ち画像の矩形領域が画像がイベントを受け取るかどうかの決定要因の一つ)あるいは画素ごと(即ちポインタと重なる画素におけるアルファ値が画像がイベントを受け取るかどうかの決定要因の一つ)に行われる:

For raster images, hit detection is either performed on a whole-image basis (i.e., the rectangular area for the image is one of the determinants for whether the image receives the event) or on a per-pixel basic (i.e., the alpha values for pixels under the pointer help determine whether the image receives the event):

ラスター画像においては、 'opacity', 'fill-opacity', 'stroke-opacity', 'fill', 'stroke' プロパティの値はイベント処理に影響しないことに注意。

Note that for raster images, the values of properties 'opacity', 'fill-opacity', 'stroke-opacity', 'fill' and 'stroke' do not effect event processing.

エラータ :マスクの存在は当たり判定に影響しない。次の節を挿入)

16.6.1 クリッピングパス, マスク, ポインタイベント

pointer-events に対しマスクとクリッピングパスが及ぼす効果は異なる。 クリッピングパスは幾何的な境界であり、点が境界の内側か外側のいずれに位置するかは明瞭に定まる。したがって、ポインタイベントはクリップされた要素の可視領域においては通常どおり検知されなければならず、クリップ領域上においては クリッピングパス の定義で述べているように、 pointer-events プロパティの異なる値に依存して、通常どおり検知され得る。一方で、(フィルタの様に働く)マスクは二分的ではない画素演算であり、完全に透明な状態と「ほぼ」透明な状態の見分けがつき難く、ふるまいが異なるのでは混乱する。したがって、マスクが適用された要素においてはポインタイベントはマスクにより不透明度が0に近付く領域でも検知されなければならない。文書作成者は、ポインタイベントがマスクの透明部分の奥にある要素に渡されるように望む場合、マスクとクリッピングを併用するとよい。

16.7 ズームとパン

ズームとパンとは、全てのグラフィックス要素を同じ量だけ等倍/並進させるような、 SVG 文書片に対する一様かつ全体に渡る変換を表す。ズームとパンの演算は SVG 文書片の最も外側のレベル(即ち 最も外側の svg 要素 の外側)に追加の伸縮/並進変換を設置する効果を与える。

Magnification represents a complete, uniform transformation on an SVG document fragment, where the magnify operation scales all graphical elements by the same amount. A magnify operation has the effect of a supplemental scale and translate transformation placed at the outermost level on the SVG document fragment (i.e., outside the outermost 'svg' element).

パンは、UIアクションに対する応答として、 SVG 文書片に対する並進(即ちずらして移動させる)変換を表現する。

Panning represents a translation (i.e., a shift) transformation on an SVG document fragment in response to a user interface action.

対話的な利用者環境を利用する SVG-UAには、ズームとパン機能のサポートが要求される。

SVG user agents that operate in interaction-capable user environments are required to support the ability to magnify and pan.

SVG 文書片における 最も外側の svg 要素zoomAndPan 属性を持つ。 zoomAndPan 属性は disable または magnify いずれかの値をとり、既定値は magnify である。

The outermost 'svg' element in an SVG document fragment has attribute zoomAndPan, which takes the possible values of disable and magnify, with the default being magnify.

disable の場合、UAはズームとパンの制御を切り、利用者に文書片のズームとパンをさせないようにすることになる。

If disable, the user agent shall disable any magnification and panning controls and not allow the user to magnify or pan on the given document fragment.

magnify の場合、対話的な利用者環境においては、UAは利用者に文書片のズームとパンの操作機能を提供することになる。

If magnify, in environments that support user interactivity, the user agent shall provide controls to allow the user to perform a "magnify" operation on the document fragment.

内側の 'svg' 要素に zoomAndPan 属性が与えられても、 SVG-UAに対しては何の効果も生じさせない。

If a zoomAndPan attribute is assigned to an inner 'svg' element, the zoomAndPan setting on the inner 'svg' element will have no effect on the SVG user agent.

アニメーション:不可

Animatable: no.

16.8 カーソル

16.8.1 カーソルの概要

一部の対話的視覚表示環境は、いわゆるカーソルと呼ばれるポインタの見栄えを変更する機能が提供する。3種類のカーソルが利用できる:

Some interactive display environments provide the ability to modify the appearance of the pointer, which is also known as the cursor. Three types of cursors are available:

'cursor' プロパティはどのカーソルを用いるかを指定するために利用される。 'cursor' プロパティは crosshair のようなキーワードの指定による標準の組み込みカーソル、あるいは独自のカーソルへの参照に利用できる。独自のカーソルは <uri> により参照され、 プラットフォーム特有のカーソルファイルのような外部リソースや、プラットフォーム非依存のカーソルを定義する 'cursor' 要素を指すことが可能である。

The 'cursor' property is used to specify which cursor to use. The 'cursor' property can be used to reference standard built-in cursors by specifying a keyword such as crosshair or a custom cursor. Custom cursors are referenced via a <uri> and can point to either an external resource such as a platform-specific cursor file or to a 'cursor' element, which can be used to define a platform-independent cursor.

16.8.2 'cursor' プロパティ

'cursor'
値:   [ [<uri> ,]* [ auto | crosshair | default | pointer | move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize| text | wait | help ] ] | inherit
初期値:   auto
適用対象:   コンテナ要素グラフィックス要素
継承:   有り
パーセント:   N/A
メディア:   視覚, 対話的
アニメーション  
Value:   [ [ <uri> ,]* [ auto | crosshair | default | pointer | move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize| text | wait | help ] ] | inherit
Initial:   auto
Applies to:   container elements and graphics elements
Inherited:   yes
Percentages:   N/A
Media:   visual, interactive
Animatable:   yes

このプロパティはポインティング装置の表示カーソルの種類を指定する。それぞれの値は次の意味を持つ:

This property specifies the type of cursor to be displayed for the pointing device. Values have the following meanings:

auto
UAが現在の文脈に則してカーソルを定める。
The UA determines the cursor to display based on the current context.
crosshair
単純な十字カーソル( "+" 記号に似た短い縦横の線分)。
A simple crosshair (e.g., short line segments resembling a "+" sign).
default
プラットフォーム依存の既定のカーソル。矢印状のものがよく使われる。
The platform-dependent default cursor. Often rendered as an arrow.
pointer
カーソルはリンクを示唆するポインタ
The cursor is a pointer that indicates a link.
move
何かが動かされることを示唆する。
Indicates something is to be moved.
e-resize, ne-resize, nw-resize, n-resize, se-resize, sw-resize, s-resize, w-resize
何かの端が動かされることを示唆する。例えば、'se-resize' カーソルはボックスの右下隅(south-east - 南東)から動きが始まるときに利用される。
Indicate that some edge is to be moved. For example, the 'se-resize' cursor is used when the movement starts from the south-east corner of the box.
text
テキストが選択可能であることを示唆する。大文字の I の形状のものがよく使われる。
Indicates text that can be selected. Often rendered as an I-bar.
wait
プログラムが何らかの処理に忙しいことを示唆する。砂時計や時計の絵柄がよく使われる。
Indicates that the program is busy. Often rendered as a watch or hourglass.
help
カーソルに重なるオブジェクトについてのヘルプがあることを示唆する。疑問符あるいは気球の形状のものがよく使われる。
Help is available for the object under the cursor. Often rendered as a question mark or a balloon.
<uri>
UAは URI が指すリソースからカーソルを取得する。UAはカーソルのリストを先頭から順に調べて、自身が扱える最初のカーソルを利用する。どの利用者定義のカーソルも扱えない場合、UAはリストの最後の一般カーソルを利用しなければならない。
The user agent retrieves the cursor from the resource designated by the URI. If the user agent cannot handle the first cursor of a list of cursors, it shall attempt to handle the second, etc. If the user agent cannot handle any user-defined cursor, it must use the generic cursor at the end of the list.
P { cursor : url("mything.cur"), url("second.csr"), text; }

SVG-UAが 'cursor' 要素により定義されるカーソルもサポートしなければならないことを除き、 SVG の 'cursor' プロパティは CSS2 ("Cascading Style Sheets (CSS) level 2")仕様 [CSS2] で定義されている 'cursor' プロパティと同じである。

The 'cursor' property for SVG is identical to the 'cursor' property defined in the "Cascading Style Sheets (CSS) level 2" specification [ CSS2], with the exception that SVG user agents must support cursors defined by the 'cursor' element.

16.8.3 'cursor' 要素

プラットフォーム非依存の独自カーソルの定義に 'cursor' 要素を利用することができる。推奨される方法は、まず PNG [PNG01] 画像を作成し、 'cursor' 要素にその PNG 画像を参照させ、ポインタの画像内における正確な位置(いわゆるホットスポット)を指定することである。

The 'cursor' element can be used to define a platform-independent custom cursor. A recommended approach for defining a platform-independent custom cursor is to create a PNG [ PNG01] image and define a 'cursor' element that references the PNG image and identifies the exact position within the image which is the pointer position (i.e., the hot spot).

PNG 形式が推奨される理由は、アルファチャンネルによる透明度マスクを定義する機能がサポートされているからである。異なる画像形式が利用された場合、その形式は透明度マスクの定義(2通りの方法がある:明示的にアルファチャンネルを与えるか、特定の色が透明であることを指示するか)をサポートすべきである。透明度マスクが定められれば、マスクがカーソルの形状を定義する。そうでなければ、カーソルの形状は不透明な矩形となる。一般には、他の画素情報(例えば R, G, B チャンネル)はマスクで切り取られない部分におけるカーソルの色を定義する。カーソルは背景がどうであっても視認できるよう、通常は少なくとも2色以上は持たせることに注意。

The PNG format is recommended because it supports the ability to define a transparency mask via an alpha channel. If a different image format is used, this format should support the definition of a transparency mask (two options: provide an explicit alpha channel or use a particular pixel color to indicate transparency). If the transparency mask can be determined, the mask defines the shape of the cursor; otherwise, the cursor is an opaque rectangle. Typically, the other pixel information (e.g., the R, G and B channels) defines the colors for those parts of the cursor which are not masked out. Note that cursors usually contain at least two colors so that the cursor can be visible over most backgrounds.


 
<!ENTITY % SVG.cursor.extra.content "" >
<!ENTITY % SVG.cursor.element "INCLUDE" >
<![%SVG.cursor.element;[
<!ENTITY % SVG.cursor.content
    "( %SVG.Description.class; %SVG.cursor.extra.content; )*\
"
>
<!ELEMENT %SVG.cursor.qname; %SVG.cursor.content; >
<!-- end of SVG.cursor.element -->]]>
<!ENTITY % SVG.cursor.attlist "INCLUDE" >
<![%SVG.cursor.attlist;[
<!ATTLIST %SVG.cursor.qname;
    %SVG.Core.attrib;
    %SVG.Conditional.attrib;
    %SVG.XLinkRequired.attrib;
    %SVG.External.attrib;
    x %Coordinate.datatype; #IMPLIED
    y %Coordinate.datatype; #IMPLIED
>

属性定義:

x = " <coordinate>"
カーソルの座標系内におけるポインタの正確な位置を表わすX座標
この属性が指定されないときの効果は値 "0" が指定されたときと同じになる。
アニメーション:可
The x-coordinate of the position in the cursor's coordinate system which represents the precise position that is being pointed to.
If the attribute is not specified, the effect is as if a value of "0" were specified.
Animatable: yes.
y = " <coordinate>"
カーソルの座標系内におけるポインタの正確な位置を表わすY座標
この属性が指定されないときの効果は値 "0" が指定されたときと同じになる。
アニメーション:可
The y-coordinate of the position in the cursor's coordinate system which represents the precise position that is being pointed to.
If the attribute is not specified, the effect is as if a value of "0" were specified.
Animatable: yes.
xlink:href = " <uri>"
カーソルの画像を与えるファイルまたは要素への URI 参照
アニメーション:可
A URI reference to the file or element which provides the image of the cursor.
Animatable: yes.

SVG-UAには xlink:href プロパティの参照先として PNG 形式画像のサポートが要求される。

SVG user agents are required to support PNG format images as targets of the xlink:href property.

16.9 Document イベント属性モジュール

Document イベント属性モジュールは DocumentEvents.attrib 属性セットを定義する。

コレクション名 コレクションに含まれる属性
DocumentEvents.attrib onunload, onabort, onerror, onresize, onscroll, onzoom

16.10 Graphical Element イベント属性モジュール

Graphical Element イベント属性モジュールは GraphicalEvents.attrib 属性セットを定義する。

コレクション名 コレクションに含まれる属性
GraphicalEvents.attrib onfocusin, onfocusout, onactivate, onclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onload

16.11 Animation イベント属性モジュール

Animation イベント属性モジュールは AnimationEvents.attrib 属性セットを定義する。

コレクション名 コレクションに含まれる属性
AnimationEvents.attrib onbegin, onend, onrepeat, onload

16.12 Cursor モジュール

要素 属性 内容モデル
cursor Core.attrib, XLinkRequired.attrib, Conditional.attrib, External.attrib, x, y (Description.class)

16.12.1 Cursor 内容セット

Cursor モジュールは Cursor.class 内容セットを定義する。

内容セット名 内容セットに含まれる要素
Cursor.class cursor

16.12.2 Cursor 属性セット

Cursor モジュールは Cursor.attrib 属性セットを定義する。

コレクション名 コレクションに含まれる属性
Cursor.attrib cursor

16.13 DOM インターフェース

次に挙げるインターフェースが以下で定義される: SVGCursorElement


インターフェース SVGCursorElement

SVGCursorElement インターフェースは 'cursor' 要素に対応する。

IDL 定義
interface SVGCursorElement : 
                SVGElement,
                SVGURIReference,
                SVGTests,
                SVGExternalResourcesRequired { 
  readonly attribute SVGAnimatedLength x;
  readonly attribute SVGAnimatedLength y;
};

属性
readonly SVGAnimatedLength x
'cursor' 要素の x 属性に対応する。
readonly SVGAnimatedLength y
'cursor' 要素の y 属性に対応する。