SVG Tiny 1.2 – 20081222

C 実装の要件

目次

この付録は規定である。 This appendix is normative.

C.1 概要

この章では SVG 言語の種々の特色機能に対応する実装への要求事項を述べる。 The following are notes about implementation requirements corresponding to various features in the SVG language.

C.2 サポート外の要素, 属性, プロパティ, 属性値, プロパティ値

適合 SVG-UA は、未知の属性, 属性値, スタイル付けプロパティ, スタイル付けプロパティの値, 子孫要素を以下のように扱わなければならない: Conforming SVG user agents must treat unknown attributes, attribute values, styling properties, styling property values, and descendant elements as follows:

下の Example ignored-fill では、 circle 要素の fill プロパティは上の規則により無視される。 fill は継承プロパティなので、 円の 内部への塗り は黒ではなく緑になる。 In Example ignored-fill below, the 'fill' property on the 'circle' element is ignored due to the above rules. Since 'fill' is an inherited property, the circle's fill is indeed green, and not black.

Example: ignored-fill.svg
<g fill="green">
  <circle fill="hey baby, like wow" r="50"/>
</g>

サポート外の内容に遭遇した場合、エラーコンソールへのアクセスを提供する SVG-UA は、文書作成者に有用になり得るような、サポート外の内容の発生の程度, 遭遇した場所, その他の適切なメッセージをエラーコンソールへ出力すべきである。 When unsupported content is encountered, an SVG user agent which provides access to an error console should report the incidence of unsupported content, the location where it was encountered, and other appropriate messages that may help the author, to the error console.

C.3 エラー処理

適合 SVG-UA は以下のようにエラーを処理しなければならない。 A conforming SVG user agent must process errors in the following manner.

SVG 文書片 が形式上(technically) エラー状態 と見なされなければならない様々な状況がある: There are various scenarios where an SVG document fragment must be considered technically in error:

文書は時経過に伴って エラー状態 とそうでない状態を行き来し得る。例えば SVG uDOMアニメーション により、文書が変更されて エラー状態 になり、更に変更が加わることにより正常な状態に戻る場合など。 A document can go in and out of error over time. For example, document changes from the SVG uDOM or from animation can cause a document to become in error and a further change can cause the document to become correct again.

文書が エラー状態 になった場合、 SVG-UA は明白な形でエラーを通知しなければならない。加えて、エラーコンソールへのアクセスを提供する SVG-UA は文書作成者に有益になり得るような、エラーに遭遇した場所その他の適切なメッセージをエラーコンソールへ出力すべきである。 When a document is in error the SVG user agent must provide a highly perceivable indication of error. Additionally, an SVG user agent which provides access to an error console should report the error, the location where it was encountered, and other appropriate messages that may help the author, to the error console.

スクリプトによる一連の変更により SVG 文書片エラー状態 とそうでない状態を行き来し得るので、エラー処理は文書の表示が(ディスプレイへ描画する際など)更新される際のみに行われるものとする。 Because of situations where a block of scripting changes might cause a given SVG document fragment to go into and out of error, error processing shall occur only at times when document presentation (e.g., rendering to the display device) is updated.

C.4 名前空間, バージョン, baseProfile, requiredFeatures, requiredExtensions

SVG-UA は、要素に対し SVG 名前空間に明示的に属する SVG 要素 のみを対象にしなければならない。例えば文書のパース時点においては、 SVG-UA は文書内の XML 名前空間宣言により SVG 名前空間の SVG 要素 として配置された要素のみを対象にしなければならない。同様に、uDOM のメソッド Document::createElementNS により作成された要素が SVG 要素 として扱われるためには、メソッドの namespaceURI パラメタに SVG 名前空間が渡されていなければならない。 SVG user agents must only consider elements explicitly placed in the SVG namespace as being SVG elements. For example, when parsing a document, SVG user agents must only consider elements explicitly placed in the SVG namespace by XML namespace declarations in the document to be SVG elements. Similarly, any element created with the Document::createElementNS uDOM method must have had the SVG namespace passed as the namespaceURI parameter for it to be considered considered to be an SVG element.

SVG 内容においては、内容の正確な描画のために SVG-UA が最小限サポートしなければならない機能を明示的に指示する requiredFeatures requiredExtensions 属性が利用できる。また、 SVG 内容においては、内容の正確な描画のために最小限サポートされなければならない機能を明示的に指示するための version 属性とそれに伴う baseProfile 属性も利用できる。例えば version'1.2'baseProfile'tiny' であれば、これらの属性は、内容が SVG-UA に対し少なくとも SVG Tiny 1.2 仕様のサポートを要していることを指示する。 SVG-UA が最低限要求される特色機能セットをサポートしない場合、 UA は警告を発するか、あるいは内容を正確に描画できない旨を利用者に明白な形で通知すべきである。 SVG content can use attributes 'requiredFeatures' and 'requiredExtensions' to provide explicit indication of the minimal features that must be supported by the SVG user agent in order to render the SVG content correctly. SVG content can also use the 'version' attribute in conjunction with 'baseProfile' to provide explicit indication of the minimal features that must be supported. For example, if 'version' is '1.2' and 'baseProfile' is 'tiny', then these attributes indicate that the content requires a SVG user agent that minimally supports the SVG Tiny 1.2 specification. If an SVG user agent does not support the minimal required feature set, then the user agent should alert or otherwise provide a highly visible notification to the user that it may not be able to render the content correctly.

しかしながら、 SVG 内容において version には特定の値が指定されているが baseProfile は指定されていない場合、 UA には単に内容が準拠する仕様のレベル( 1.0, 1.1, 1.2 )が指示されるのみになる。この場合、 UA には正確な描画に最低限必要な機能セットを知り得るための十分な情報が渡らず、文書作成者が言語の過去のバージョンでは未定義だった SVG 言語の機能を利用しているかもしれないことを知り得るのみになる。従って、 SVG 内容が UA に未知の SVG 言語のバージョンを指定している場合、 UA は警告を発するか、あるいは内容を正確に描画できない旨を利用者に明白な形で通知すべきである。 However, SVG content that provides a specified value for 'version' but does not provide a specified value for 'baseProfile' simply indicates to the user agent the specification level (1.0, 1.1, 1.2) to which the content conforms. If 'version' is specified but not 'baseProfile', the SVG content does not provide sufficient information to the user agent to determine the minimum feature set that is required to render the content; the user agent can only know that the author might be using SVG language features that were not defined in earlier versions of the language. Therefore, if the SVG content specifies a version of the SVG language unknown to the user agent, then the user agent should alert or otherwise provide a highly perceivable notification to the user that it may not be able to render the content correctly.

SVG 内容が利用中の UA でサポートされない SVG 言語のバージョン, プロファイル, 機能, 拡張を含む場合、 UA はそれらの機能をサポートする新しいバージョンの SVG-UA へ更新する方法を利用者に通知してよい。 When SVG content specifies SVG language versions, profiles, features or extensions not supported by the currently installed user agent, the user agent may notify the user how to update the SVG user agent should a newer version be available which does support these features.

バージョン番号の目的は内容に対する最小限の実装バージョンを指示する所にある。 SVG-UA は未知のバージョン番号に遭遇した場合でも、サポートする要素と属性については描画しなければならず、ルート要素がサポートされない要素あるいは文書片については描画してはならない。 Note that the intent of the version number is to indicate the minimum implementation version for the content; an SVG user agent which encounters content with a version number unknown to the user agent must still render those elements and attributes that it does support, and must not render elements or document fragments with root elements which it does not support.

C.5 色と不透明度値の切り上げ/下げ

この節では SVG-UA のふるまいについて述べる。 This section describes the behaviour of SVG user agents.

色成分値など、一部の数値属性値とプロパティ値は範囲が制限されている。色値あるいは不透明度において範囲外の値が与えられた場合、処理の中間段階における値は範囲外であっても最終結果の値は範囲に収まることがあるので、 UA は結果を表示する時点までエラーチェックを遅延すべきである。 Some numeric attribute and property values have restricted ranges, such as color component values. When out-of-range color or opacity values are provided, the user agent should defer any error checking until after presentation time, as composited actions might produce intermediate values which are out-of-range but final values which are within range.

色値は表示時点における最終結果が範囲外であっても エラー状態 にはならない。 UA は範囲外の色値をシステムが処理可能な最も近い色値に収める(単純な値の切り上げ/下げによることもあろう)ことを可能な限り遅延させるべきである(例えば表示時点まで)。もっとも、パース時などの早期に SVG-UA が色値を切り詰めることも許容されている。従って範囲外の色値が利用される状況では、実装依存により異なるシステム間でふるまいが一貫しないことが有り得る。 【 "clamp" を「切り上げ/下げ」と訳しているがこれは語弊のある表現で、範囲への収め方として(単純な)値の切り上げ/下げが強要されてはいない模様。画像など多数の値の標本の場合は他の範囲内の値も連動して圧縮した方が品質的には良くなる場合が多いと思われる。】 Color values are not in error if they are out-of-range, even if final computations produce an out-of-range color value at presentation time. User agents should clamp color values to the nearest color value (possibly determined by simple clipping) which the system should process as late as possible (e.g., presentation time), although it is acceptable for SVG user agents to clamp color values as early as parse time. Thus, implementation dependencies might preclude consistent behavior across different systems when out-of-range color values are used.

範囲外の不透明度値は エラー状態 にはならず、その値による処理が必要になった時点で(例えば表示時点やフィルタ効果における中間処理で必要になった時点で)0 から 1 までの範囲内に切り上げ/下げされるべきである。 Opacity values out-of-range are not in error and should be clamped to the range 0 to 1 at the time which opacity values have to be processed (e.g., at presentation time or when it is necessary to perform intermediate filter effect calculations).

C.6 path 要素の実装における注意

適合 SVG-UA はパスの描画を次のように実装しなければならない: A conforming SVG user agent must implement path rendering as follows:

C.7 テキスト選択の実装における注意

この仕様はテキスト選択に関する視覚的フィードバックに関し特定の体系を義務付けるものではないが、適合 SVG-UA は、システムの規範と一貫する形でフィードバックを提供すべきである。 This specification does not mandate any particular scheme for visual feedback for text selection, but a conforming SVG user agent should provide such feedback as is consistent with system norms.

テキスト選択 処理の間にどの文字が選択されるかを決めるにあたり利用しなければならないアルゴリズムを以下に述べる。適合 SVG-UA は、このアルゴリズムに定められたふるまいを実装しなければならない。 The following implementation notes describe the algorithm that must be used for deciding which characters are selected during a text selection operation. A conforming SVG user agent must implement the behavior specified by this algorithm.

テキスト選択処理の過程で(例えば利用者によるマウスのクリックとドラッグ操作で選択部分を特定する間)、 UA は選択開始位置選択終止位置を決定する。それぞれ、テキスト文字列内の(文字の隙間の)位置を表現する。選択開始位置と選択終止位置の決定後、 UA は適切な文字を選択する。結果における選択部分は次のいずれかでなければならない: As the text selection operation occurs (e.g., while the user clicks and drags the mouse to identify the selection), the user agent determines a start selection position and an end selection position, each of which represents a position in the text string between two characters. After determining start selection position and end selection position, the user agent selects the appropriate characters, where the resulting text selection must consist of either:

ポインタ装置を有するシステムにおける選択開始位置の決定においては、SVG-UA は選択処理を誘発するイベント(例えばマウスボタン押下イベント)が生じた時点で現在のポインタの位置に基づいて描画されたどのグリフに対応する文字の隙間が最良の対象(例えば、最も近いもの)になるかを決定することになる。 UA は選択処理の完了(例えばマウスのドラッグに続くボタンの解放)まで追跡する。選択処理終了時に、 UA はどの文字の隙間が選択終止位置として最良の対象(例えば、最も近いもの)になるかを決定することになる。 On systems with pointer devices, to determine the start selection position, the SVG user agent should determine which boundary between characters corresponding to rendered glyphs is the best target (e.g., closest) based on the current pointer location at the time of the event that initiates the selection operation (e.g., the mouse down event). The user agent should then track the completion of the selection operation (e.g., the mouse drag, followed ultimately by the mouse up). At the end of the selection operation, the user agent should determine which boundary between characters is the best target (e.g., closest) for the end selection position.

双方向性による文字の再配列が生じていない場合、選択開始位置選択終止位置の間の全ての文字が選択部分とならなければならない。例えば、 text 要素が文字列 "abcdef" を含んでおり、選択開始位置が 0 、選択終止位置が 3 ならば("a" の左側の位置を 0 とみなす)、選択部分は "abc" になるものとする。 If no character reordering has occurred due to bidirectionality, then the selection must consist of all characters between the start selection position and end selection position. For example, if a 'text' element contains the string "abcdef" and the start selection position and end selection positions are 0 and 3 respectively (assuming the left side of the "a" is position zero), then the selection shall consist of "abc".

UA が双方向テキストの選択を実装している場合、選択開始(または終止)位置が論理順序において不連続な文字の隙間にあるとき、複数組の文字組が選択部分の候補となり得る。選択部分の複数の候補から選び出すアルゴリズムでは、テキスト文字列の視覚的描画順序に最も近く一致するものを選ぶものとする。 When the user agent is implementing selection of bidirectional text, and when the selection starts (or ends) between characters which are not contiguous in logical order, then there may be multiple potential combinations of characters that can be considered part of the selection. The algorithms to choose among the combinations of potential selection options shall choose the selection option which most closely matches the text string's visual rendering order.

複数個の文字が一つ以上のグリフからなる集合に不可分に対応している場合、 UA はグリフの集合の途中部分からの選択を開始させないか、あるいはグリフの集合に対応する文字をまとめて選択するかのいずれを選んでも良い。 When multiple characters map inseparably to a given set of one or more glyphs, the user agent may either disallow the selection to start in the middle of the glyph set or may attempt to allocate portions of the area taken up by the glyph set to the characters that correspond to the glyph.

テキスト選択をサポートするシステムにおいては、たとえテキストがリンクの一部であっても、 UA は少なくとも利用可能な UI 機器すべてにおいてテキスト選択の仕組みを提供しなければならない(キーボード, マウス, ペン, その他のポインタ装置など)。 マウスなどのポインタ装置をサポートするプラットフォームにおける、 UA の実装の一例として、文字セルの周囲に小さな追加領域を与え、そこではテキスト選択処理は誘発させるがイベントハンドラやリンクは誘発させないようにすることなどが考えられる。 加えて、 UA は常に、スクリプトやプログラムからの、すべてのテキスト内容に対する、特に選択あるいはフォーカスを得た内容に対する、 DOM アクセスを許容しなければならない。 For systems which support selection, the user agent must provide a mechanism for selecting text with a full range of available UI devices (e.g. keyboard, mouse, pen, or any other pointer device) as a default, even when the given text is part of a link. One implementation option for platforms which support selection via a pointer device such as a mouse is for the user agent to provide for a small additional region around character cells which initiates text selection operations but does not initiate event handlers or links. Additionally, the user agent must allow scripted or programmatic DOM access to all text content, and specifically any selected or focused content, at all times.

C.8 印刷の実装における注意

ディスプレイ装置におけるズームおよび印刷の両方をサポートする適合 SVG-UA においては、印刷における既定の動作として、 現在の SVG 文書片 のディスプレイ装置における現在の表示(但しメディア固有のスタイル付けはされていないものとする)を反映させた、すなわち、利用者によるズームやパン, アニメーションの状態, DOM とスクリプトによる文書への変更を考慮に入れた出力を生成すべきである。利用者が図面の特定の領域をディスプレイ装置で拡大表示させて印刷させた場合、その印刷出力はディスプレイ装置に現れた図面の表示どおりにすべきである。利用者がアニメーションを休止させて印刷した場合、印刷出力はディスプレイ装置で休止状態にされた画像と同じグラフィックになるべきである。スクリプトにより要素が文書に追加されたり文書から削除された場合、印刷出力はディスプレイに現れるものと同じ変化を反映すべきである。 In conforming SVG user agents which support both zooming on display devices and printing, the default printing option should produce printed output that reflects the display device's current view of the current SVG document fragment (assuming there is no media-specific styling), taking into account any zooming and panning done by the user, the current state of animation, and any document changes due to DOM and scripting. Thus, if the user zooms into a particular area of a map on the display device and then requests a hardcopy, the hardcopy should show the same view of the map as appears on the display device. If a user pauses an animation and prints, the hardcopy should show the same graphics as the currently paused picture on the display device. If scripting has added or removed elements from the document, then the hardcopy should reflect the same changes that would be reflected on the display.

SVG 文書が SVG のアニメーションおよびスクリプトの仕組みをサポートしないプリンタなどの静的装置に描画される際には、 UA は文書の全てのアニメーションとスクリプト要素を無視し、この仕様の規則に従って残りのグラフィックス要素を描画するものとする。 When an SVG document is rendered on a static-only device such as a printer which does not support SVG's animation and scripting and facilities, then the user agent shall ignore any animation and scripting elements in the document and render the remaining graphics elements according to the rules in this specification.