1. 序論
~INFORMATIVEこの仕様は、[ 点, 矩形, 四辺形, [ ~3x2/~4x4 ]変形~行列 ]を表現するための,数種の幾何~interfaceを述べる。 ◎ This specification describes several geometry interfaces for the representation of points, rectangles, quadrilaterals and transformation matrices with the dimension of 3x2 and 4x4.
~SVGの~interface[ `SVGPoint^I, `SVGRect^I, `SVGMatrix^I ]は、ここに定義される各種~interfaceの別名とされることになる — それらの~interfaceを[ ~SVG / Canvas 2D Context / CSS Transforms ]から共通して利用することの支持を受けて。 `SVG11$r `HTML$r `CSS3-TRANSFORMS$r ◎ The SVG interfaces SVGPoint, SVGRect and SVGMatrix are aliasing the here defined interfaces in favor for common interfaces used by SVG, Canvas 2D Context and CSS Transforms. [SVG11] [HTML] [CSS3-TRANSFORMS]
【この訳に固有の表記規約】
この訳の,~algoや定義の記述に利用されている各種記号( ~LET, 此れ, ~IF, ~THROW 等々)の意味や定義の詳細は,~SYMBOL_DEF_REFを~~参照されたし。
浮動小数点数(有限でないものも含む)の比較における記号 ~EQ に添えられる “±0” は、[ `-0^jV, `+0^jV ]も互いに同じと見なす(すなわち, `-0^jV ~EQ~SameValueZero `+0^jV )ことを除き,通常の ~EQ と同じ意味とする(特に, `NaN^jV ~EQ~SameValueZero `NaN^jV )。 記号 ~NEQ に添えられたときは ~EQ~SameValueZero の否定を表すとする。
【 原文では,この比較を表すために `SameValueZero$jA() 抽象演算も一部~用いられているが( `SameValueZero^jA( `-0^jV, `+0^jV) は ~T を返す)、表記を一貫させるため,上の定義を用いることにする。 】
2. `DOMPoint^I ~interface
~2D/~3Dの `点@ は、次の~IDL~interfaceで表現できる: ◎ A 2D or a 3D point can be represented by the following WebIDL interfaces:
[`DOMPointReadOnly$mC( optional unrestricted double %x = 0, optional unrestricted double %y = 0, optional unrestricted double %z = 0, optional unrestricted double %w = 1), `Exposed$=(Window,Worker), `Serializable$] interface `DOMPointReadOnly@I { [`NewObject$] static `DOMPointReadOnly$I `fromPoint$pR(optional `DOMPointInit$I %other); readonly attribute unrestricted double `x$pR; readonly attribute unrestricted double `y$pR; readonly attribute unrestricted double `z$pR; readonly attribute unrestricted double `w$pR; `DOMPoint$I `matrixTransform$pR(optional `DOMMatrixInit$I %matrix); [`Default$] object `toJSON@pR(); }; [`DOMPoint$mC( optional unrestricted double %x = 0, optional unrestricted double %y = 0, optional unrestricted double %z = 0, optional unrestricted double %w = 1), `Exposed$=(Window,Worker), `Serializable$, `LegacyWindowAlias$=`SVGPoint@I] interface `DOMPoint@I : `DOMPointReadOnly$I { [`NewObject$] static `DOMPoint$I `fromPoint$pM(optional `DOMPointInit$I %other); inherit attribute unrestricted double `x$pR; inherit attribute unrestricted double `y$pR; inherit attribute unrestricted double `z$pR; inherit attribute unrestricted double `w$pR; }; dictionary `DOMPointInit@I { unrestricted double `x@pI = 0; unrestricted double `y@pI = 0; unrestricted double `z@pI = 0; unrestricted double `w@pI = 1; };
各 `DOMPointReadOnly$I ~obj %P は、次に挙げる内部~member変数を持つものと見做される:
- `~x座標@, `~y座標@, `~z座標@, `~w視座@
- これらは、 %P が表現する`点$ — 単に “%P の点” とも記される — を成す各 成分を与える。
- 【 ~3D射影空間~内の点を表現する。 `~w視座$( w-perspective )は “遠近感” を与えるためにある。 】
`DOMPointReadOnly$I ~interfaceは、これらの変数に~accessでき~MUST。 それを継承している `DOMPoint$I ~interfaceは、これらの変数の値も設定でき~MUST。
◎ The following algorithms assume that DOMPointReadOnly objects have the internal member variables x coordinate, y coordinate, z coordinate and w perspective. DOMPointReadOnly as well as the inheriting interface DOMPoint must be able to access and set the value of these variables.`DOMPointReadOnly$I ~objを返す各種~interfaceは、内部~member変数~値を改変してよい。 そのような~interfaceは、その能を注釈文にて明示的に指定し~MUST。 ◎ An interface returning an DOMPointReadOnly object by an attribute or function may be able to modify internal member variable values. Such an interface must specify this ability explicitly in prose.
内部~member変数は、公開されては~MUST_NOT。 ◎ Internal member variables must not be exposed in any way.
- `DOMPointReadOnly(x, y, z, w)@m
- `DOMPoint(x, y, z, w)@m
- これらの構築子の被呼出時には、次の結果を返さ~MUST ⇒ `~listから点を作成する$( «%x, %y, %z, %w» ), それぞれの~interface型 ) ◎ The DOMPointReadOnly(x, y, z, w) and DOMPoint(x, y, z, w) constructors, when invoked, must run the following steps: ◎ Let point be a new DOMPointReadOnly or DOMPoint object as appropriate. ◎ Set point’s variables x coordinate to x, y coordinate to y, z coordinate to z and w perspective to w. ◎ Return point.
- `DOMPointReadOnly$I . `fromPoint(other)@pR
- `DOMPoint$I . `fromPoint(other)@pM
- これらの静的~methodの被呼出時には、次の結果を返さ~MUST ⇒ `辞書から点を作成する$( %other, それぞれの~interface型 ) ◎ The fromPoint(other) static method on DOMPointReadOnly must create a DOMPointReadOnly from the dictionary other. ◎ The fromPoint(other) static method on DOMPoint must create a DOMPoint from the dictionary other.
`辞書から点を作成する@ ときは、所与の ( `DOMPointInit$I 型の辞書 %other, 型 %T ) に対し,次の結果を返す ⇒ `~listから点を作成する$( 次に与える~list, %T ) ⇒ %other の辞書~member ( `x$pI, `y$pI, `z$pI, `w$pI ) 値が成す同順の~list
【 この手続きを呼出している一部の~methodは,[ %other として渡す `DOMPointInit$I 型の引数 ]を省略して呼出せるが、その場合でも `WEBIDL$r に則って,省略された引数は自動的に[ 各~memberが既定~値に初期化された `DOMPointInit$I 値(点 ( 0, 0, 0, 1 ) を表現する) ]に変換されることになる。 】
`~listから点を作成する@ ときは所与の ( ~list « %x, %y, %z, %w », %T ~IN { `DOMPointReadOnly$I, `DOMPoint$I } ) に対し,型 %T の新たな~instanceを その内部~変数を次のように初期化した上で返す ⇒ ( `~x座標$, `~y座標$, `~z座標$, `~w視座$ ) ~SET ( %x, %y, %z, %w )
◎ To create a DOMPointReadOnly from a dictionary other, or to create a DOMPoint from a dictionary other, follow these steps: • Let point be a new DOMPointReadOnly or DOMPoint as appropriate. • Set point’s variables x coordinate to other’s x dictionary member, y coordinate to other’s y dictionary member, z coordinate to other’s z dictionary member and w perspective to other’s w dictionary member. • Return point.- `x@pR, `y@pR, `z@pR, `w@pR
- これらの属性の取得子は、それぞれ順に,此れの[ `~x座標$, `~y座標$, `~z座標$, `~w視座$ ]値を返さ~MUST。 ◎ ↓
- `DOMPoint$I 上のこれらの属性の設定子は、それぞれ順に,此れの[ `~x座標$, `~y座標$, `~z座標$, `~w視座$ ]を所与の値に設定し~MUST。 ◎ The x attribute, on getting, must return the x coordinate value. For the DOMPoint interface, setting the x attribute must set the x coordinate to the new value. ◎ The y attribute, on getting, must return the y coordinate value. For the DOMPoint interface, setting the y attribute must set the y coordinate to the new value. ◎ The z attribute, on getting, must return the z coordinate value. For the DOMPoint interface, setting the z attribute must set the z coordinate to the new value. ◎ The w attribute, on getting, must return the w perspective value. For the DOMPoint interface, setting the w attribute must set the w perspective to the new value.
- `matrixTransform(matrix)@pR
-
被呼出時には、次を走らせ~MUST: ◎ The matrixTransform(matrix) method, when invoked, must run the following steps:
- %M ~LET `辞書から行列を作成する$( %matrix, `DOMMatrix$I ) ◎ Let matrixObject be the result of invoking create a DOMMatrix from the dictionary matrix.
- ~RET `点を行列で変形する$( 此れ, %M ) ◎ Return the result of invoking transform a point with a matrix, given the current point and matrixObject. The current point does not get modified.
- `matrixTransform()$pR は現在の `DOMPointReadOnly$I ~objを改変することなく,新たな `DOMPoint$I ~objを返す。 ◎ matrixTransform() does not modify the current DOMPointReadOnly object and returns a new DOMPoint object.
`DOMPoint$I ~instance %point 上の `matrixTransform()$pR ~methodを, `DOMMatrix$I ~instance %matrix を引数に~callする例: ◎ In this example the method matrixTransform() on a DOMPoint instance is called with a DOMMatrix instance as argument.
var %point = new DOMPoint(5, 4); var %matrix = new DOMMatrix([2, 0, 0, 2, 10, 10]); var %transformedPoint = %point.matrixTransform(%matrix);
変数 %point は、 ( `~x座標$, `~y座標$ ) が ( 5, 4 ) に初期化された,新たな `DOMPoint$I ~objに設定される。 次に,この新たな `DOMPoint$I は、 %matrix により拡縮され並進される。 結果の %transformedPoint の ( `~x座標$, `~y座標$ ) は ( 20, 18 ) になる。 ◎ The point variable is set to a new DOMPoint object with x coordinate initialized to 5 and y coordinate initialized to 4. This new DOMPoint is now scaled and the translated by matrix. This resulting transformedPoint has the x coordinate 20 and y coordinate 18.
2.1. 点を行列で変形する
`点を行列で変形する@ ときは、所与の ( `DOMPointReadOnly$I ~obj %P, `DOMMatrixReadOnly$I ~obj %M ) に対し,次の結果を返す ⇒ `~listから点を作成する$( 次の結果, `DOMPoint$I ) ⇒ %P の ( `~x座標$, `~y座標$, `~z座標$, `~w視座$ ) が成す新たな縦~vectorに %M の`行列$を`左から乗算-$した結果からなる~list ◎ To transform a point with a matrix, given point and matrix: • Let x be point’s x coordinate. • Let y be point’s y coordinate. • Let z be point’s z coordinate. • Let w be point’s w perspective. • Let pointVector be a new column vector with the elements being x, y, z, and w, respectively. • x y z w • Set pointVector to pointVector post-multiplied by matrix.*原文誤 • Let transformedPoint be a new DOMPoint object. • Set transformedPoint’s x coordinate to pointVector’s first element. • Set transformedPoint’s y coordinate to pointVector’s second element. • Set transformedPoint’s z coordinate to pointVector’s third element. • Set transformedPoint’s w perspective to pointVector’s fourth element. • Return transformedPoint.
注記: [ %M の`~is-2D$ ~EQ ~T ]~AND[ %P の`~z座標$ ~EQ~SameValueZero `0^jV ]~AND[ %P の`~w視座$ ~EQ `1^jV ]ならば,これは~2D変形になり、他の場合は~3D変形になる。 ◎ If matrix’s is 2D is true, point’s z coordinate is 0 or -0, and point’s w perspective is 1, then this is a 2D transformation. Otherwise this is a 3D transformation.
3. `DOMRect^I ~interface
`DOMRectReadOnly$I ~interfaceを実装している~objは、 `矩形@ を表現する。 ◎ Objects implementing the DOMRectReadOnly interface represent a rectangle.
各 矩形は次の~propを持つ: ◎ Rectangles have the following properties:
- `原点@ ◎ origin
- 矩形の横方向~原点は、矩形の`横幅~寸法$が[ 負でなければ左端 /負ならば右端 ]辺に位置する。 同様に,矩形の縦方向~原点は、矩形の`縦幅~寸法$が[ 負でなければ上端 /負ならば下端 ]辺に位置する。 ◎ When the rectangle has a non-negative width dimension, the rectangle’s horizontal origin is the left edge; otherwise, it is the right edge. Similarly, when the rectangle has a non-negative height dimension, the rectangle’s vertical origin is the top edge; otherwise, it is the bottom edge.
- `~x座標@rT ◎ x coordinate
- 表示域の左端~辺から相対的な,矩形の`原点$の横方向~~位置を与える。 ◎ The horizontal distance between the viewport’s left edge and the rectangle’s origin.
- `~y座標@rT ◎ y coordinate
- 表示域の上端~辺から相対的な,矩形の`原点$の縦方向~~位置を与える。 ◎ The vertical distance between the viewport’s top edge and the rectangle’s origin.
- `横幅~寸法@ ◎ width dimension
- 矩形の横幅を表す — 負にもなり得る。 ◎ The width of the rectangle. Can be negative.
- `縦幅~寸法@ ◎ height dimension
- 矩形の縦幅を表す — 負にもなり得る。 ◎ The height of the rectangle. Can be negative.
[`DOMRectReadOnly$mC( optional unrestricted double %x = 0, optional unrestricted double %y = 0, optional unrestricted double %width = 0, optional unrestricted double %height = 0), `Exposed$=(Window,Worker), `Serializable$] interface `DOMRectReadOnly@I { [`NewObject$] static `DOMRectReadOnly$I `fromRect$rR(optional `DOMRectInit$I %other); readonly attribute unrestricted double `x@rR; readonly attribute unrestricted double `y@rR; readonly attribute unrestricted double `width@rR; readonly attribute unrestricted double `height@rR; readonly attribute unrestricted double `top@rR; readonly attribute unrestricted double `right@rR; readonly attribute unrestricted double `bottom@rR; readonly attribute unrestricted double `left@rR; [`Default$] object `toJSON@rR(); }; [`DOMRect$mC( optional unrestricted double %x = 0, optional unrestricted double %y = 0, optional unrestricted double %width = 0, optional unrestricted double %height = 0), `Exposed$=(Window,Worker) `Serializable$, `LegacyWindowAlias$=`SVGRect@I] interface `DOMRect@I : `DOMRectReadOnly$I { [`NewObject$] static `DOMRect$I `fromRect$rM(optional `DOMRectInit$I %other); inherit attribute unrestricted double `x@rM; inherit attribute unrestricted double `y@rM; inherit attribute unrestricted double `width@rM; inherit attribute unrestricted double `height@rM; }; dictionary `DOMRectInit@I { unrestricted double `x@rI = 0; unrestricted double `y@rI = 0; unrestricted double `width@rI = 0; unrestricted double `height@rI = 0; };
各 `DOMRectReadOnly$I ~objは、次に挙げる内部~member変数を持つものと見做される ⇒ `~x座標$rT, `~y座標$rT, `横幅~寸法$, `縦幅~寸法$
`DOMRectReadOnly$I ~interfaceは、これらの変数に~accessでき~MUST。 それを継承している `DOMRect$I ~interfaceは、これらの変数の値も設定でき~MUST。
◎ The following algorithms assume that DOMRectReadOnly objects have the internal member variables x coordinate, y coordinate, width dimension and height dimension. DOMRectReadOnly as well as the inheriting interface DOMRect must be able to access and set the value of these variables.`DOMRectReadOnly$I ~objを返す各種~interfaceは、内部~member変数~値を改変してよい。 そのような~interfaceは、その能を注釈文にて明示的に指定し~MUST。 ◎ An interface returning an DOMRectReadOnly object by an attribute or function may be able to modify internal member variable values. Such an interface must specify this ability explicitly in prose.
内部~member変数は、公開されては~MUST_NOT。 ◎ Internal member variables must not be exposed in any way.
- `DOMRectReadOnly(x, y, width, height)@m
- `DOMRect(x, y, width, height)@m
- これらの構築子の被呼出時には、次の結果を返さ~MUST ⇒ `~listから矩形を作成する$( « %x, %y, %width, %height », それぞれの~interface型 ) ◎ The DOMRectReadOnly(x, y, width, height) and DOMRect(x, y, width, height) constructors, when invoked, must run the following steps: ◎ Let rect be a new DOMRectReadOnly or DOMRect object as appropriate. ◎ Set rect’s variables x coordinate to x, y coordinate to y, width dimension to width and height dimension to height. ◎ Return rect.
- `DOMRectReadOnly$I . `fromRect(other)@rR
- `DOMRect$I . `fromRect(other)@rM
- これらの静的~methodの被呼出時には、次の結果を返さ~MUST ⇒ `辞書から矩形を作成する$( %other, それぞれの~interface型 ) ◎ The fromRect(other) static method on DOMRectReadOnly must create a DOMRectReadOnly from the dictionary other. ◎ The fromRect(other) static method on DOMRect must create a DOMRect from the dictionary other.
`辞書から矩形を作成する@ ときは、所与の ( 辞書 %other, 型 %T ~IN { `DOMRect$I, `DOMRectReadOnly$I } ) に対し,次の結果を返す ⇒ `~listから矩形を作成する$( 次に与える~list, %T ) ⇒ %other の ( `x$rI, `y$rI,`width$rI, `height$rI ) ~member値が成す同順の~list
【 ここでも、`辞書から点を作成する$ときに述べたのと同様のことが該当する。 】
`~listから矩形を作成する@ ときは、所与の ( ~list « %x, %y,%width, %height », 型 %T ~IN { `DOMRect$I, `DOMRectReadOnly$I } ) に対し,型 %T の新たな~instanceを その各種 内部~変数を次のように設定した上で返す ⇒ ( `~x座標$rT, `~y座標$rT, `横幅~寸法$, `縦幅~寸法$ ) ~SET ( %x, %y,%width, %height )
◎ To create a DOMRectReadOnly from a dictionary other, or to create a DOMRect from a dictionary other, follow these steps: • Let rect be a new DOMRectReadOnly or DOMRect as appropriate. • Set rect’s variables x coordinate to other’s x dictionary member, y coordinate to other’s y dictionary member, width dimension to other’s width dictionary member and height dimension to other’s height dictionary member. • Return rect.- `x@r0, `y@r0, `width@r0, `height@r0
- これらの属性の取得子は、順に,此れの[ `~x座標$rT, `~y座標$rT, `横幅~寸法$, `縦幅~寸法$ ]値を返さ~MUST。 ◎ ↓
- `DOMRect$I 上の これらの属性の設定子は、順に,此れの[ `~x座標$rT, `~y座標$rT, `横幅~寸法$, `縦幅~寸法$ ]を所与の値に設定し~MUST。 ◎ The x attribute, on getting, must return the x coordinate value. For the DOMRect interface, setting the x attribute must set the x coordinate to the new value. ◎ The y attribute, on getting, it must return the y coordinate value. For the DOMRect interface, setting the y attribute must set the y coordinate to the new value. ◎ The width attribute, on getting, must return the width dimension value. For the DOMRect interface, setting the width attribute must set the width dimension to the new value. ◎ The height attribute, on getting, must return the height dimension value. For the DOMRect interface, setting the height attribute must set the height dimension value to the new value.
- `top@r0
- 取得子は、 ~min( 此れの`~y座標$rT, 此れの`~y座標$rT + 此れの`縦幅~寸法$ ) を返さ~MUST。 ◎ The top attribute, on getting, must return min(y coordinate, y coordinate + height dimension).
- `right@r0
- 取得子は、 ~max( 此れの`~x座標$rT, 此れの`~x座標$rT + 此れの`横幅~寸法$ ) を返さ~MUST。 ◎ The right attribute, on getting, must return max(x coordinate, x coordinate + width dimension).
- `bottom@r0
- 取得子は、 ~max( 此れの`~y座標$rT, 此れの`~y座標$rT + 此れの`縦幅~寸法$ ) を返さ~MUST。 ◎ The bottom attribute, on getting, must return max(y coordinate, y coordinate + height dimension).
- `left@r0
- 取得子は、 ~min( 此れの`~x座標$rT, 此れの`~x座標$rT + 此れの`横幅~寸法$ ) を返さ~MUST。 ◎ The left attribute, on getting, must return min(x coordinate, x coordinate + width dimension).
4. `DOMRectList^I ~interface
interface `DOMRectList@I { readonly attribute unsigned long `length$m; getter `DOMRect$I? `item$m(unsigned long %index); };
- `length@m
- 取得子は、此れに結付けられている `DOMRect$I ~objの総数を返さ~MUST。 ◎ The length attribute must return the total number of DOMRect objects associated with the object.
- `item(index)@m
- 被呼出時には、[[ 0 ~LTE %index ~LT ( 此れに結付けられている `DOMRect$I ~objの総数 ) ]ならば それらのうち %index 番の `DOMRect$I ~obj / ~ELSE_ ~NULL ]を返さ~MUST。 ◎ The item(index) method, when invoked, must return null when index is greater than or equal to the number of DOMRect objects associated with the DOMRectList. Otherwise, the DOMRect object at index must be returned. Indices are zero-based.
`DOMRectList$I が存在するのは、旧来の~Web内容との互換性のために限られる。 新たな~APIを指定するときには、利用しては~MUST_NOT — 代わりに `sequence<DOMRect>^c を利用すること。 `WEBIDL$r ◎ DOMRectList only exists for compatibility with legacy Web content. When specifying a new API, DOMRectList must not be used. Use sequence<DOMRect> instead. [WEBIDL]
5. `DOMQuad^I ~interface
`DOMQuad$I ~interfaceを実装している~objは、 `四辺形@ を表現する。 ◎ Objects implementing the DOMQuad interface represents a quadrilateral.
【 4 個の頂点には、同一平面内などの制約はない。 】
[`DOMQuad$mC( optional `DOMPointInit$I %p1, optional `DOMPointInit$I %p2, optional `DOMPointInit$I %p3, optional `DOMPointInit$I %p4), `Exposed$=(Window,Worker) `Serializable$] interface `DOMQuad@I { [`NewObject$] static `DOMQuad$I `fromRect$q(optional `DOMRectInit$I %other); [`NewObject$] static `DOMQuad$I `fromQuad$q(optional `DOMQuadInit$I %other); [`SameObject$] readonly attribute `DOMPoint$I `p1$q; [`SameObject$] readonly attribute `DOMPoint$I `p2$q; [`SameObject$] readonly attribute `DOMPoint$I `p3$q; [`SameObject$] readonly attribute `DOMPoint$I `p4$q; [`NewObject$] `DOMRect$I `getBounds$q(); [`Default$] object `toJSON@q(); }; dictionary `DOMQuadInit@I { `DOMPointInit$I `p1@qI; `DOMPointInit$I `p2@qI; `DOMPointInit$I `p3@qI; `DOMPointInit$I `p4@qI; };
各 `DOMQuad$I ~obj %Q は、次に挙げる内部~member変数を持つものと見做される:
- `点1@, `点2@, `点3@, `点4@
- これらは、 `DOMPoint$I ~objを保持し, %Q を通して[ 取得-/設定- ]でき~MUST。
- 作者は,これらの `DOMPoint$I ~objを改変して, %Q が表現する四辺形に直に影響させれる。
- 【 四辺形を成す各~辺の順序は,これらの点の番号順に従うものと見受けられるが、この仕様の中では,この順序に幾何学的な意味は定義されていない。 】
`DOMQuad$I ~objを返す各種~interfaceは、内部~member変数~値を改変してよい。 そのような~interfaceは、その能を注釈文にて明示的に指定し~MUST。 ◎ An interface returning a DOMQuad object by an attribute or function may be able to modify internal member variable values. Such an interface must specify this ability explicitly in prose.
内部~member変数は、公開されては~MUST_NOT。 ◎ Internal member variables must not be exposed in any way.
- `DOMQuad(p1, p2, p3, p4)@m
- これらの構築子の被呼出時には、新たな `DOMQuad$I を,その内部~変数を次のように設定した上で返さ~MUST ⇒ [ `点1$ / `点2$ / `点3$ / `点4$ ] ~SET それぞれ順に,`辞書から点を作成する$([ %p1 / %p2 / %p3 / %p4 ], `DOMPoint$I ) ◎ The DOMQuad(p1, p2, p3, p4) constructor, when invoked, must run the following steps: • Let point1 be a new DOMPoint object with its attributes set to the values of the namesake dictionary members in p1. • Let point2 be a new DOMPoint object with its attributes set to the values of the namesake dictionary members in p2. • Let point3 be a new DOMPoint object with its attributes set to the values of the namesake dictionary members in p3. • Let point4 be a new DOMPoint object with its attributes set to the values of the namesake dictionary members in p4. • Return a new DOMQuad with point 1 set to point1, point 2 set to point2, point 3 set to point3 and point 4 set to point4.
- 注記: `DOMPoint$I / `DOMPointReadOnly$I を引数に渡すことも可能である。 渡された引数は、 `WEBIDL$r の規則に従って,内部的に正しい~obj型に変換されることになる†。 【†単に同じ名前の~propを持つ JS Object 値として解釈されるので。】 ◎ It is possible to pass DOMPoint/DOMPointReadOnly arguments as well. The passed arguments will be transformed to the correct object type internally following the WebIDL rules. [WEBIDL]
- `fromRect(other)@q
- この静的~methodの被呼出時には、次の結果を返さ~MUST ⇒ `DOMRectInit$I `辞書から四辺形を作成する$R( %other ) ◎ The fromRect(other) static method on DOMQuad must create a DOMQuad from the DOMRectInit dictionary other.
-
`DOMRectInit$I `辞書から四辺形を作成する@R ときは、所与の ( `DOMRectInit$I 辞書 %other ) に対し,次の手続きに従う: ◎ To create a DOMQuad from a DOMRectInit dictionary other, follow these steps:
- ( %x, %y, %width, %height ) ~LET %other の ( `x$rI, `y$rI, `width$rI, `height$rI ) ~member値 ◎ Let x, y, width and height be the value of other’s x, y, width and height dictionary members, respectively.
-
~RET 内部~変数が次のように設定された新たな `DOMQuad$I ~obj: ◎ ↓
- `点1$ ~SET `~listから点を作成する$( « %x, %y, 0, 1 », `DOMPoint$I ) ◎ Let point1 be a new DOMPoint object with x coordinate set to x, y coordinate set to y, z coordinate set to 0 and w perspective set to 1.
- `点2$ ~SET `~listから点を作成する$( « %x + %width, %y, 0, 1 », `DOMPoint$I ) ◎ Let point2 be a new DOMPoint object with x coordinate set to x + width, y coordinate set to y, z coordinate set to 0 and w perspective set to 1.
- `点3$ ~SET `~listから点を作成する$( « %x + %width, %y + %height, 0, 1 », `DOMPoint$I ) ◎ Let point3 be a new DOMPoint object with x coordinate set to x + width, y coordinate set to y + height, z coordinate set to 0 and w perspective set to 1.
- `点4$ ~SET `~listから点を作成する$( « %x, %y + %height, 0, 1 », `DOMPoint$I ) ◎ Let point4 be a new DOMPoint object with x coordinate set to x, y coordinate set to y + height, z coordinate set to 0 and w perspective set to 1. ◎ Return a new DOMQuad with point 1 set to point1, point 2 set to point2, point 3 set to point3 and point 4 set to point4.
- `fromQuad(other)@q
- この静的~methodの被呼出時には、次の結果を返さ~MUST ⇒ `DOMQuadInit$I `辞書から四辺形を作成する$( %other ) ◎ The fromQuad(other) static method on DOMQuad must create a DOMQuad from the DOMQuadInit dictionary other.
-
`DOMQuadInit$I `辞書から四辺形を作成する@ ときは、所与の ( `DOMQuadInit$I 辞書 %other ) に対し,次の手続きに従う:
- ~RET 内部~変数が次のように設定された新たな `DOMQuad$I ~obj ⇒ [ `点1$ / `点2$ / `点3$ / `点4$ ] ~SET それぞれ順に,`辞書から点を作成する$( 次に与える値, `DOMPoint$I ) ⇒ %other に[ `p1$qI / `p2$qI / `p3$qI / `p4$qI ]~memberは在するならば その値 / ~ELSE_ 新たな `DOMPointInit$I 値 ]
- `p1@q, `p2@q, `p3@q, `p4@q
- これらの属性の取得子は、順に,[ `点1$, `点2$, `点3$, `点4$ ]を返さ~MUST。 ◎ The p1 attribute must return point 1. ◎ The p2 attribute must return point 2. ◎ The p3 attribute must return point 3. ◎ The p4 attribute must return point 4.
- `getBounds()@q
-
被呼出時には、次を走らせ~MUST: ◎ The getBounds() method, when invoked, must run the following algorithm:
- %S ~LET 此れの 4 点 { `点1$, `点2$, `点3$, `点4$ } からなる集合 ◎ Let bounds be a DOMRect object.
- %左端 ~LET %S 内の各~点の`~x座標$の最小~値 ◎ Let left be the minimum of point 1’s x coordinate, point 2’s x coordinate, point 3’s x coordinate and point 4’s x coordinate.
- %上端 ~LET %S 内の各~点の`~y座標$の最小~値 ◎ Let top be the minimum of point 1’s y coordinate, point 2’s y coordinate, point 3’s y coordinate and point 4’s y coordinate.
- %右端 ~LET %S 内の各~点の`~x座標$の最大~値 ◎ Let right be the maximum of point 1’s x coordinate, point 2’s x coordinate, point 3’s x coordinate and point 4’s x coordinate.
- %下端 ~LET %S 内の各~点の`~y座標$の最大~値 ◎ Let bottom be the maximum of point 1’s y coordinate, point 2’s y coordinate, point 3’s y coordinate and point 4’s y coordinate.
- ~RET 次のように設定された 新たな `DOMRect$I ~obj ⇒ ( `~x座標$rT, `~y座標$rT, `横幅~寸法$, `縦幅~寸法$ ) ~SET ( %左端, %上端, %右端 − %左端, %下端 − %上端 ) ◎ Set x coordinate of bounds to left, y coordinate of bounds to top, width dimension of bounds to right - left and height dimension of bounds to bottom - top. ◎ Return bounds.
次の例では、 `DOMQuad()$m 構築子は、 `DOMPoint$I / `DOMPointInit$I 型の値を引数に~callされている。 両~型の引数とも受容され,利用できる: ◎ In this example the DOMQuad constructor is called with arguments of type DOMPoint and DOMPointInit. Both arguments are accepted and can be used.
var %point = new DOMPoint(2, 0); var %quad1 = new DOMQuad(%point, {x: 12, y: 0}, {x: 12, y: 10}, {x: 2, y: 10});
上による結果, および次による結果の `DOMQuad$I %quad1, %quad2 の互いに対応する属性が表現する点は、互いに等価になる: ◎ The attribute values of the resulting DOMQuad quad1 above are also equivalent to the attribute values of the following DOMQuad quad2:
var %rect = new DOMRect(2, 0, 10, 10); var %quad2 = DOMQuad.fromRect(%rect);
不規則な四辺形の例: ◎ This is an example of an irregular quadrilateral:
new DOMQuad({x: 40, y: 25}, {x: 180, y: 8}, {x: 210, y: 150}, {x: 10, y: 180});
6. `DOMMatrix^I ~interface
`DOMMatrix$I / `DOMMatrixReadOnly$I ~interfaceは、~graphic上の文脈における変形を表すための,数学的な `行列@ を表現する。 以下の各~節では、この~interfaceの詳細を述べる。 ◎ The DOMMatrix and DOMMatrixReadOnly interfaces each represent a mathematical matrix with the purpose of describing transformations in a graphical context. The following sections describe the details of the interface.
%m11 | %m21 | %m31 | %m41 |
%m12 | %m22 | %m32 | %m42 |
%m13 | %m23 | %m33 | %m43 |
%m14 | %m24 | %m34 | %m44 |
以下の節では、次の用語が用いられる: ◎ In the following sections, terms have the following meaning:
- `右から乗算-@( post-multiply )
- 項 %A に項 %B を右から乗算するときは、 %A を %A × %B の結果に改変する。 ◎ Term A post-multiplied by term B is equal to A · B.
- 【 この × は行列の乗算。 %A や %B は正方~行列に限られない。 】【 原文には, “( %A を)改変する” とは記されていないが、概ね,そのような用法で用いられており、この区別は重要なので,ここでは明示的に記す。 改変しない必要がある場合、下の`乗算-$を用いて記述することにする。 】
- `左から乗算-@( pre-multiply )
- 項 %A に項 %B を左から乗算するときは、 %A を %B × %A の結果に改変する。 ◎ Term A pre-multiplied by term B is equal to B · A.
- 【 点 %A に行列 %B を左から乗算する場合、 %A を,その各~成分が成す縦~vectorによる 1×4 の行列と見なすことになる。 】
- `乗算-@( multiply )
- 項 %A, %B を乗算するときは、 %A × %B の結果を返す( %A, %B は改変されない)。 ◎ Multiply term A by term B is equal to A · B.
- 【 可換でないので、 %A, %B の順序は有意になる。 】
[`DOMMatrixReadOnly$mC(optional (DOMString or sequence<unrestricted double>) %init), `Exposed$=(Window,Worker) `Serializable$] interface `DOMMatrixReadOnly@I { [`NewObject$] static `DOMMatrixReadOnly$I `fromMatrix$xR(optional `DOMMatrixInit$I %other); [`NewObject$] static `DOMMatrixReadOnly$I `fromFloat32Array$xR(`Float32Array$I %array32); [`NewObject$] static `DOMMatrixReadOnly$I `fromFloat64Array$xR(`Float64Array$I %array64); /* これらの属性は、単に,~4x4行列のある成分の別名 ◎ These attributes are simple aliases for certain elements of the 4x4 matrix */ readonly attribute unrestricted double `a$xR; readonly attribute unrestricted double `b$xR; readonly attribute unrestricted double `c$xR; readonly attribute unrestricted double `d$xR; readonly attribute unrestricted double `e$xR; readonly attribute unrestricted double `f$xR; readonly attribute unrestricted double `m11$xR; readonly attribute unrestricted double `m12$xR; readonly attribute unrestricted double `m13$xR; readonly attribute unrestricted double `m14$xR; readonly attribute unrestricted double `m21$xR; readonly attribute unrestricted double `m22$xR; readonly attribute unrestricted double `m23$xR; readonly attribute unrestricted double `m24$xR; readonly attribute unrestricted double `m31$xR; readonly attribute unrestricted double `m32$xR; readonly attribute unrestricted double `m33$xR; readonly attribute unrestricted double `m34$xR; readonly attribute unrestricted double `m41$xR; readonly attribute unrestricted double `m42$xR; readonly attribute unrestricted double `m43$xR; readonly attribute unrestricted double `m44$xR; readonly attribute boolean `is2D$xR; readonly attribute boolean `isIdentity$xR; /* 変異-不能な変形~method ◎ Immutable transform methods */ [`NewObject$] `DOMMatrix$I `translate$xR( optional unrestricted double %tx = 0, optional unrestricted double %ty = 0, optional unrestricted double %tz = 0); [`NewObject$] `DOMMatrix$I `scale$xR( optional unrestricted double %scaleX = 1, optional unrestricted double %scaleY, optional unrestricted double %scaleZ = 1, optional unrestricted double %originX = 0, optional unrestricted double %originY = 0, optional unrestricted double %originZ = 0); [`NewObject$] `DOMMatrix$I `scale3d$xR( optional unrestricted double %scale = 1, optional unrestricted double %originX = 0, optional unrestricted double %originY = 0, optional unrestricted double %originZ = 0); [`NewObject$] `DOMMatrix$I `rotate$xR( optional unrestricted double %rotX = 0, optional unrestricted double %rotY, optional unrestricted double %rotZ); [`NewObject$] `DOMMatrix$I `rotateFromVector$xR( optional unrestricted double %x = 0, optional unrestricted double %y = 0); [`NewObject$] `DOMMatrix$I `rotateAxisAngle$xR( optional unrestricted double %x = 0, optional unrestricted double %y = 0, optional unrestricted double %z = 0, optional unrestricted double %angle = 0); [`NewObject$] `DOMMatrix$I `skewX$xR(optional unrestricted double %sx = 0); [`NewObject$] `DOMMatrix$I `skewY$xR(optional unrestricted double %sy = 0); [`NewObject$] `DOMMatrix$I `multiply$xR(optional `DOMMatrixInit$I %other); [`NewObject$] `DOMMatrix$I `flipX$xR(); [`NewObject$] `DOMMatrix$I `flipY$xR(); [`NewObject$] `DOMMatrix$I `inverse$xR(); [`NewObject$] `DOMPoint$I `transformPoint$xR(optional `DOMPointInit$I %point); [`NewObject$] `Float32Array$I `toFloat32Array$xR(); [`NewObject$] `Float64Array$I `toFloat64Array$xR(); [`Exposed$=Window] `stringifier$xR; [`Default$] object `toJSON@xR(); }; [`DOMMatrix$mC(optional (DOMString or sequence<unrestricted double>) %init), `Exposed$=(Window,Worker) `Serializable$, `LegacyWindowAlias$=(`SVGMatrix@I,`WebKitCSSMatrix@I)] interface `DOMMatrix@I : `DOMMatrixReadOnly$I { [`NewObject$] static `DOMMatrix$I `fromMatrix$xM(optional `DOMMatrixInit$I %other); [`NewObject$] static `DOMMatrix$I `fromFloat32Array$xM(`Float32Array$I %array32); [`NewObject$] static `DOMMatrix$I `fromFloat64Array$xM(`Float64Array$I %array64); /* これらの属性は、単に,~4x4行列のある成分の別名 ◎ These attributes are simple aliases for certain elements of the 4x4 matrix */ inherit attribute unrestricted double `a$xR; inherit attribute unrestricted double `b$xR; inherit attribute unrestricted double `c$xR; inherit attribute unrestricted double `d$xR; inherit attribute unrestricted double `e$xR; inherit attribute unrestricted double `f$xR; inherit attribute unrestricted double `m11$xR; inherit attribute unrestricted double `m12$xR; inherit attribute unrestricted double `m13$xR; inherit attribute unrestricted double `m14$xR; inherit attribute unrestricted double `m21$xR; inherit attribute unrestricted double `m22$xR; inherit attribute unrestricted double `m23$xR; inherit attribute unrestricted double `m24$xR; inherit attribute unrestricted double `m31$xR; inherit attribute unrestricted double `m32$xR; inherit attribute unrestricted double `m33$xR; inherit attribute unrestricted double `m34$xR; inherit attribute unrestricted double `m41$xR; inherit attribute unrestricted double `m42$xR; inherit attribute unrestricted double `m43$xR; inherit attribute unrestricted double `m44$xR; /* 変異-可能な変形~method ◎ Mutable transform methods */ `DOMMatrix$I `multiplySelf$xM(optional `DOMMatrixInit$I %other); `DOMMatrix$I `preMultiplySelf$xM(optional `DOMMatrixInit$I %other); `DOMMatrix$I `translateSelf$xM( optional unrestricted double %tx = 0, optional unrestricted double %ty = 0, optional unrestricted double %tz = 0); `DOMMatrix$I `scaleSelf$xM( optional unrestricted double %scaleX = 1, optional unrestricted double %scaleY, optional unrestricted double %scaleZ = 1, optional unrestricted double %originX = 0, optional unrestricted double %originY = 0, optional unrestricted double %originZ = 0); `DOMMatrix$I `scale3dSelf$xM( optional unrestricted double %scale = 1, optional unrestricted double %originX = 0, optional unrestricted double %originY = 0, optional unrestricted double %originZ = 0); `DOMMatrix$I `rotateSelf$xM( optional unrestricted double %rotX = 0, optional unrestricted double %rotY, optional unrestricted double %rotZ); `DOMMatrix$I `rotateFromVectorSelf$xM( optional unrestricted double %x = 0, optional unrestricted double %y = 0); `DOMMatrix$I `rotateAxisAngleSelf$xM( optional unrestricted double %x = 0, optional unrestricted double %y = 0, optional unrestricted double %z = 0, optional unrestricted double %angle = 0); `DOMMatrix$I `skewXSelf$xM(optional unrestricted double %sx = 0); `DOMMatrix$I `skewYSelf$xM(optional unrestricted double %sy = 0); `DOMMatrix$I `invertSelf$xM(); [`Exposed$=Window] `DOMMatrix$I `setMatrixValue$xM(DOMString %transformList); }; dictionary `DOMMatrix2DInit@I { unrestricted double `a@xI; unrestricted double `b@xI; unrestricted double `c@xI; unrestricted double `d@xI; unrestricted double `e@xI; unrestricted double `f@xI; unrestricted double `m11@xI; unrestricted double `m12@xI; unrestricted double `m21@xI; unrestricted double `m22@xI; unrestricted double `m41@xI; unrestricted double `m42@xI; }; dictionary `DOMMatrixInit@I : `DOMMatrix2DInit$I { unrestricted double `m13@xI = 0; unrestricted double `m14@xI = 0; unrestricted double `m23@xI = 0; unrestricted double `m24@xI = 0; unrestricted double `m31@xI = 0; unrestricted double `m32@xI = 0; unrestricted double `m33@xI = 1; unrestricted double `m34@xI = 0; unrestricted double `m43@xI = 0; unrestricted double `m44@xI = 1; boolean `is2D@xI; };
各 `DOMMatrixReadOnly$I ~obj %M は、次に挙げる内部~member変数を持つものと見做される:
- `m11@xE, `m12@xE, `m13@xE, `m14@xE, `m21@xE, `m22@xE, `m23@xE, `m24@xE, `m31@xE, `m32@xE, `m33@xE, `m34@xE, `m41@xE, `m42@xE, `m43@xE, `m44@xE
- %M が表現する`行列$ — 単に “%M の行列” とも記される — を成す各 成分を与える。 それぞれ、この節の冒頭に示した~4x4`行列$の同~名の成分に対応する。
- `列主導順@ とは、上に挙げた順による成分の順序を意味する。
- `~is-2D$
- ~T または ~F。 ~T ならば、 %M は~2D行列を表現することを指示する(が、逆は真でない)。
`DOMMatrixReadOnly$I ~interfaceは、これらの変数に~accessでき~MUST。 それを継承している `DOMMatrix$I ~interfaceは、これらの変数の値も設定でき~MUST。
◎ The following algorithms assume that DOMMatrixReadOnly objects have the internal member variables m11 element, m12 element, m13 element, m14 element, m21 element, m22 element, m23 element, m24 element, m31 element, m32 element, m33 element, m34 element, m41 element, m42 element, m43 element, m44 element and is 2D. DOMMatrixReadOnly as well as the inheriting interface DOMMatrix must be able to access and set the value of these variables.`DOMMatrixReadOnly$I ~objを返す各種~interfaceは、内部~member変数~値を改変してよい。 そのような~interfaceは、その能を注釈文にて明示的に指定し~MUST。 ◎ An interface returning an DOMMatrixReadOnly object by an attribute or function may be able to modify internal member variable values. Such an interface must specify this ability explicitly in prose.
内部~member変数は、公開されては~MUST_NOT。 ◎ Internal member variables must not be exposed in any way.
`DOMMatrix$I / `DOMMatrixReadOnly$I ~interfaceは `SVG11$r の `SVGMatrix^I ~interfaceを置換する。 ◎ The DOMMatrix and DOMMatrixReadOnly interfaces replace the SVGMatrix interface from SVG. [SVG11]
6.1. `DOMMatrix2DInit^I, `DOMMatrixInit^I 辞書
`~2D用に辞書を検証して修復する@ ときは、所与の ( [ `DOMMatrix2DInit$I / `DOMMatrixInit$I ]辞書 %辞書 ) に対し,次を走らす: ◎ To validate and fixup (2D) a DOMMatrix2DInit or DOMMatrixInit dictionary dict, run the following steps:
-
下の表 A の ~EACH( %行 ) に対し ⇒ ~IF[ %行 の 1 列目の~member %m1 は %辞書 に在する ]~AND[ %行 の 2 列目の~member %m2 は %辞書 に在する ]~AND[ %m1 の値 ~NEQ~SameValueZero %m2 の値 ] ⇒ ~THROW `TypeError^E
◎ If if at least one of the following conditions are true for dict, then throw a TypeError exception and abort these steps. • a and m11 are both present and SameValueZero(a, m11) is false. • b and m12 are both present and SameValueZero(b, m12) is false. • c and m21 are both present and SameValueZero(c, m21) is false. • d and m22 are both present and SameValueZero(d, m22) is false. • e and m41 are both present and SameValueZero(e, m41) is false. • f and m42 are both present and SameValueZero(f, m42) is false.表 A `m11$xI `a$xI 1 `m12$xI `b$xI 0 `m21$xI `c$xI 0 `m22$xI `d$xI 1 `m41$xI `e$xI 0 `m42$xI `f$xI 0 - 上の表 A の ~EACH( %行 ) に対し ⇒ ~IF[ %行 の 1 列目の~member %m は %辞書 に不在 ] ⇒ %辞書 の %m ~memberの値 ~SET [ %行 の 2 列目の~memberは %辞書 に在するならば その値 / ~ELSE_ %行 の 3 列目の値 ] ◎ If m11 is not present then set it to the value of member a, or value 1 if a is also not present. ◎ If m12 is not present then set it to the value of member b, or value 0 if b is also not present. ◎ If m21 is not present then set it to the value of member c, or value 0 if c is also not present. ◎ If m22 is not present then set it to the value of member d, or value 1 if d is also not present. ◎ If m41 is not present then set it to the value of member e, or value 0 if e is also not present. ◎ If m42 is not present then set it to the value of member f, or value 0 if f is also not present. ◎ The SameValueZero comparison algorithm returns true for two NaN values, and also for 0 and -0. [ECMA-262]
`辞書を検証して修復する@ ときは、所与の ( `DOMMatrixInit$I 辞書 %辞書 ) に対し,次を走らす: ◎ To validate and fixup a DOMMatrixInit dictionary dict, run the following steps:
- `~2D用に辞書を検証して修復する$( %辞書 ) ◎ Validate and fixup (2D) dict.
- %is2D ~LET [ 次が満たされるならば ~T / ~ELSE_ ~F ] ⇒ どの %m ~IN { `m13$xI, `m14$xI, `m23$xI, `m24$xI, `m31$xI, `m32$xI, `m33$xI, `m34$xI, `m43$xI, `m44$xI } に対しても ⇒ %辞書 の %m ~memberの値 ~EQ~SameValueZero %m の既定~値 ◎ ↓
- ~IF[ %is2D ~EQ ~F ]~AND[ `is2D$xI ~memberは %辞書 に在する ~AND その値 ~EQ ~T ] ⇒ ~THROW `TypeError^E ◎ If is2D is true and: at least one of m13, m14, m23, m24, m31, m32, m34, m43 are present with a value other than 0 or -0, or at least one of m33, m44 are present with a value other than 1, then throw a TypeError exception and abort these steps.
- %辞書 の `is2D$xI ~memberの値 ~SET %is2D ◎ If is2D is not present and at least one of m13, m14, m23, m24, m31, m32, m34, m43 are present with a value other than 0 or -0, or at least one of m33, m44 are present with a value other than 1, set is2D to false. ◎ If is2D is still not present, set it to true.
6.2. 文字列を構文解析して抽象~行列を得る
`行列として構文解析する@ ときは、所与の ( 文字列 %変形~list~文字列 ) に対し,次を走らせた結果を返す: ◎ To parse a string into an abstract matrix, given a string transformList, means to run the following steps. It will either return a 4x4 abstract matrix and a boolean 2dTransform, or failure.
- ( %行列, %is2D ) ~LET ( 単位~行列を成す`~4x4抽象~行列$, ~T ) ◎ ↓
- ~IF[ %変形~list~文字列 ~EQ 空~文字列 ] ⇒ ~RET ( %行列, %is2D ) ◎ If transformList is the empty string, set it to the string "matrix(1, 0, 0, 1, 0, 0)".
- %変形~list ~LET ~CSS `transform$p ~propの文法を与える下で, %変形~list~文字列 を`構文解析-$した結果 `CSS3-TRANSFORMS$r `CSS3-SYNTAX$r ◎ Parse transformList into parsedValue given the grammar for the CSS transform property. The result will be a <transform-list>, the keyword none, or failure.\
-
%変形~list に応じて:
- `失敗^i
- `none^v 以外の~keywordが利用されている
- ~RET ( ε, ε )
- ~keyword `none^v
- ~RET ( %行列, %is2D )
- `transform-list$t
- ~IF[ %変形~list 内の,ある `transform-function$t 内の ある `length$t 値の単位は、`絶対~長さ$でない ] ⇒ ~RET ( ε, ε )
-
%変形~list 内の ~EACH ( `transform-function$t %変形~関数 ) に対し:
◎ Let 2dTransform track the 2D/3D dimension status of parsedValue. ◎ If parsedValue consists of any three-dimensional transform functions • Set 2dTransform to false. Otherwise • Set 2dTransform to true. ◎ Transform all <transform-function>s to 4x4 abstract matrices by following the “Mathematical Description of Transform Functions”. [CSS3-TRANSFORMS] ◎ Let matrix be a 4x4 abstract matrix as shown in the initial figure of this section. Post-multiply all matrices from left to right and set matrix to this product. - ~RET ( %行列, %is2D ) ◎ Return matrix and 2dTransform.
6.3. `DOMMatrixReadOnly^I / `DOMMatrix^I ~objの作成-法
`~2D行列を作成する@ ときは、所与の ( ~list « %a, %b, %c, %d, %e, %f », 型 %T ~IN { `DOMMatrixReadOnly$I, `DOMMatrix$I } ) に対し,型 %T の新たな~instanceをその各種 内部~変数を次のように設定した上で返す: ◎ To create a 2d matrix of type type being either DOMMatrixReadOnly or DOMMatrix, with a sequence init of 6 elements, follow these steps:
- ( `m11$xE, `m12$xE, `m21$xE, `m22$xE, `m41$xE, `m42$xE ) ~SET ( %a, %b, %c, %d, %e, %f ) ◎ Let matrix be a new instance of type. ◎ Set m11 element, m12 element, m21 element, m22 element, m41 element and m42 element to the values of init in order starting with the first value.
- ( `m13$xE, `m14$xE, `m23$xE, `m24$xE, `m31$xE, `m32$xE, `m34$xE, `m43$xE ) ~SET ( 0, 0, 0, 0, 0, 0, 0, 0 ) ◎ Set m13 element, m14 element, m23 element, m24 element, m31 element, m32 element, m34 element, and m43 element to 0.
- ( `m33$xE, `m44$xE ) ~SET ( 1, 1 ) ◎ Set m33 element and m44 element to 1.
- `~is-2D$ ~SET ~T ◎ Set is 2D to true. ◎ Return matrix
`~3D行列を作成する@ ときは、所与の ( ~4x4行列 %行列, 型 %T ~IN { `DOMMatrixReadOnly$I, `DOMMatrix$I } ) に対し,次を走らす: ◎ To create a 3d matrix with type being either DOMMatrixReadOnly or DOMMatrix, with a sequence init of 16 elements, follow these steps:
- %M ~LET 型 %T の新たな~instance ◎ Let matrix be a new instance of type.
- %M の行列 ~SET %行列 ◎ Set m11 element to m44 element to the values of init in column-major order.
- %M の`~is-2D$ ~SET ~F ◎ Set is 2D to false.
- ~RET %M ◎ Return matrix
- `DOMMatrixReadOnly(init)@m
- `DOMMatrix(init)@m
-
これらの構築子の被呼出時には、次を走らせ~MUST: ◎ The DOMMatrixReadOnly(init) and the DOMMatrix(init) constructors must follow these steps:
- %T ~LET [ `DOMMatrixReadOnly()$m に対しては `DOMMatrixReadOnly$I 型 / `DOMMatrix()$m に対しては `DOMMatrix$I 型 ] ◎ ↓
- ~IF[ %init は省略されている ] ⇒ ~RET `~2D行列を作成する$( « 1, 0, 0, 1, 0, 0 », %T ) ◎ If init is omitted • Return the result of invoking create a 2d matrix of type DOMMatrixReadOnly or DOMMatrix as appropriate, with the sequence [1, 0, 0, 1, 0, 0].
-
~IF[ %init は `DOMString$I である ]: ◎ If init is a DOMString
- ~IF[ `現在の大域~obj$は `Window$I ~objでない ] ⇒ ~THROW `TypeError^E ◎ If current global object is not a Window object, then throw a TypeError exception.
- ( %行列, %is2D ) ~LET `行列として構文解析する$( %init ) ◎ Parse init into an abstract matrix, and let matrix and 2dTransform be the result.\
- ~IF[ %行列 ~EQ ε ] ⇒ ~THROW `SyntaxError$E ◎ If the result is failure, then throw a "SyntaxError" DOMException.
- ~IF[ %is2D ~EQ ~T ] ⇒ ~RET `~2D行列を作成する$( 次に与える~list, %T ) ⇒ %行列 の[ %m11, %m12, %m21, %m22, %m41, %m42 ]成分からなる同順の~list ◎ If 2dTransform is true • Return the result of invoking create a 2d matrix of type DOMMatrixReadOnly or DOMMatrix as appropriate, with a sequence of numbers, the values being the elements m11, m12, m21, m22, m41 and m42 of matrix.
- ~RET `~3D行列を作成する$( %行列, %T ) ◎ Otherwise • Return the result of invoking create a 3d matrix of type DOMMatrixReadOnly or DOMMatrix as appropriate, with a sequence of numbers, the values being the 16 elements of matrix.
- ~IF[ %init は~IDL連列~型である ] ⇒ ~RET `~listから行列を作成する$( %init に等価な~list, %T ) ◎ If init is a sequence with 6 elements ◎ Return the result of invoking create a 2d matrix of type DOMMatrixReadOnly or DOMMatrix as appropriate, with the sequence init. ◎ If init is a sequence with 16 elements ◎ Return the result of invoking create a 3d matrix of type DOMMatrixReadOnly or DOMMatrix as appropriate, with the sequence init. ◎ Otherwise ◎ Throw a TypeError exception.
- `DOMMatrixReadOnly$I . `fromMatrix(other)@xR
- `DOMMatrix$I . `fromMatrix(other)@xM
- これらの静的~methodの被呼出時には、次の結果を返さ~MUST ⇒ `辞書から行列を作成する$( %other, それぞれの~interface型 ) ◎ The fromMatrix(other) static method on DOMMatrixReadOnly must create a DOMMatrixReadOnly from the dictionary other. ◎ The fromMatrix(other) static method on DOMMatrix must create a DOMMatrix from the dictionary other.
`~2D辞書から行列を作成する@ ときは、所与の ( 辞書 %other, 型 %T ~IN { `DOMMatrix$I, `DOMMatrixReadOnly$I } ) に対し,次の手続きに従う: ◎ To create a DOMMatrixReadOnly from a 2D dictionary other or to create a DOMMatrix from a 2D dictionary other, follow these steps:
- `~2D用に辞書を検証して修復する$( %other ) ◎ Validate and fixup (2D) other.
- ~RET `~2D行列を作成する$( 次に与える~list, %T ) ⇒ %other の 6 成分 ( `m11$xI, `m12$xI, `m21$xI, `m22$xI, `m41$xI, `m42$xI ) からなる同順の~list ◎ Return the result of invoking create a 2d matrix of type DOMMatrixReadOnly or DOMMatrix as appropriate, with a sequence of numbers, the values being the 6 elements m11, m12, m21, m22, m41 and m42 of other in the given order.
`辞書から行列を作成する@ ときは、所与の ( 辞書 %other, 型 %T ~IN { `DOMMatrix$I, `DOMMatrixReadOnly$I } ) に対し,次の手続きに従う: ◎ To create a DOMMatrixReadOnly from a dictionary other or to create a DOMMatrix from a dictionary other, follow these steps:
- `辞書を検証して修復する$( %other ) ◎ Validate and fixup other.
- ~IF[ %other の `is2D$xI 辞書~member ~EQ ~T ] ⇒ ~RET `~2D行列を作成する$( 次に与える~list, %T ) ⇒ %other の 6 成分 ( `m11$xI, `m12$xI, `m21$xI, `m22$xI, `m41$xI, `m42$xI ) からなる同順の~list ◎ If the is2D dictionary member of other is true • Return the result of invoking create a 2d matrix of type DOMMatrixReadOnly or DOMMatrix as appropriate, with a sequence of numbers, the values being the 6 elements m11, m12, m21, m22, m41 and m42 of other in the given order.
- ~RET `~3D行列を作成する$( 次に与える行列, %T ) ⇒ 各~成分が %other の同~名の~memberで与えられる~4x4行列 ◎ Otherwise • Return the result of invoking create a 3d matrix of type DOMMatrixReadOnly or DOMMatrix as appropriate, with a sequence of numbers, the values being the 16 elements m11, m12, m13, ..., m44 of other in the given order.
- `DOMMatrixReadOnly$I . `fromFloat32Array(array32)@xR
- `DOMMatrix$I . `fromFloat32Array(array32)@xM
- `DOMMatrixReadOnly$I . `fromFloat64Array(array64)@xR
- `DOMMatrix$I . `fromFloat64Array(array64)@xM
- これらの静的~methodの被呼出時には、次の結果を返さ~MUST ⇒ `~listから行列を作成する$( [ %array32 / %array64 ]に等価な~list, それぞれの~interface型 ) ◎ The fromFloat32Array(array32) static method on DOMMatrixReadOnly and the fromFloat32Array(array32) static method on DOMMatrix must follow these steps: • If array32 has 6 elements •• Return the result of invoking create a 2d matrix of type DOMMatrixReadOnly or DOMMatrix as appropriate, with a sequence of numbers taking the values from array32 in the provided order. • If array32 has 16 elements •• Return the result of invoking create a 3d matrix of type DOMMatrixReadOnly or DOMMatrix as appropriate, with a sequence of numbers taking the values from array32 in the provided order. • Otherwise •• Throw a TypeError exception. ◎ The fromFloat64Array(array64) static method on DOMMatrixReadOnly and the fromFloat64Array(array64) static method on DOMMatrix must follow these steps: • If array64 has 6 elements •• Return the result of invoking create a 2d matrix of type DOMMatrixReadOnly or DOMMatrix as appropriate, with a sequence of numbers taking the values from array64 in the provided order. • If array32 has 16 elements •• Return the result of invoking create a 3d matrix of type DOMMatrixReadOnly or DOMMatrix as appropriate, with a sequence of numbers taking the values from array64 in the provided order. • Otherwise •• Throw a TypeError exception.
`~listから行列を作成する@ ときは、所与の ( ~list %成分~list, 型 %T ~IN { `DOMMatrixReadOnly$I, `DOMMatrix$I } ) に対し, %成分~list の長さに応じて:
- 6 個
- ~RET `~2D行列を作成する$( %成分~list, %T )
- 16 個
- ~RET `~3D行列を作成する$( 次に与える行列, %T ) ⇒ %成分~list により,各 成分~値が`列主導順$で与えられる~4x4行列
- その他
- ~THROW `TypeError^E
6.4. `DOMMatrix^I 属性
- `m11@xR, `m12@xR, `m13@xR, `m14@xR, `m21@xR, `m22@xR, `m23@xR, `m24@xR, `m31@xR, `m32@xR, `m33@xR, `m34@xR, `m41@xR, `m42@xR, `m43@xR, `m44@xR
- これら 16 個の属性は、それぞれ,[ 当の属性と同~名の,此れの`行列~成分$ ]に対応する。 ◎ The following attributes m11 to m44 correspond to the 16 items of the matrix interfaces.
- これらの属性の取得子は、[ 当の属性と同~名の,此れの`行列~成分$ ]の値を返さ~MUST。 ◎ ↓
-
`DOMMatrix$I 上の これらの属性の設定子は、次を走らせ~MUST:
- [ 当の属性と同~名の,此れの`行列~成分$ ]の値 ~SET 所与の値
- ~IF[ 当の属性は[ `m11$xR, `m12$xR, `m21$xR, `m22$xR, `m41$xR, `m42$xR ]のいずれかである ] ⇒ ~RET
- ~IF[ 所与の値 ~EQ~SameValueZero [ 当の属性と同~名の, `DOMMatrixInit$I 上の~member ]の既定~値 ] ⇒ ~RET
- 此れの `~is-2D$ ~SET ~F
- `a@xR, `b@xR, `c@xR, `d@xR, `e@xR, `f@xR
- これらの取得子/設定子は、順に,此れの[ `m11$xR, `m12$xR, `m21$xR, `m22$xR, `m41$xR, `m42$xR ]属性と同じにふるまわ~MUST。 ◎ ↑
- これらの属性は、此れの行列の~2D成分に対応する。 ◎ The following attributes a to f correspond to the 2D components of the matrix interfaces. ◎ • The a attribute is an alias to the m11 attribute. • The b attribute is an alias to the m12 attribute. • The c attribute is an alias to the m21 attribute. • The d attribute is an alias to the m22 attribute. • The e attribute is an alias to the m41 attribute. • The f attribute is an alias to the m42 attribute.
- `is2D@xR
- この属性と次の `isIdentity$xR 属性は、 `DOMMatrixReadOnly$I の状態情報を供する。 ◎ The following attributes provide status information about DOMMatrixReadOnly.
- 取得子は、此れの`~is-2D$を返さ~MUST。 ◎ The is2D attribute must return the value of is 2D.
- `isIdentity@xR
-
取得子は、[ 此れの行列が次をいずれも満たすならば ~T / ~ELSE_ ~F ]を返さ~MUST:
- [ `m11$xE / `m22$xE / `m33$xE / `m44$xE ]成分の値 ~EQ `1^jV
- 他のすべての成分の値 ~EQ~SameValueZero `0^jV
各 `DOMMatrixReadOnly$I ~obj %M は、真偽値をとる `~is-2D@ ~flagを持ち、 ~T ならば次を指示する: ◎ Every DOMMatrixReadOnly object must be flagged with a boolean is 2D. This flag indicates that:
- %M の行列は、~2D行列として初期化された。 詳細は、個々の作成子を見よ。 ◎ The current matrix was initialized as a 2D matrix. See individual creators for more details.
- %M の行列には、~2D変形でない演算は適用されていない。 どの演算が`~is-2D$を ~F に設定することになるかは、各種[ 変異-可能 / 変異-不能 ]な変形~methodごとに定義される。 ◎ Only 2D transformation operations were applied. Each mutable or immutable transformation method defines if is 2D must be set to false.
注記: `DOMMatrix$I ~obj上の`~is-2D$が ~F に設定されて以降は、 `setMatrixValue()$xM ~methodを~callする以外に ~T に戻ることは,決してない。 【何らかの演算により,~2D行列になったとしても。】 ◎ Is 2D can never be set to true when it was set to false before on a DOMMatrix object with the exception of calling the setMatrixValue() method.
6.5. 変異-不能な変形~method
以下の各種~methodは、現在の行列を改変せずに,新たな `DOMMatrix$I ~objを返す。 ◎ The following methods do not modify the current matrix and return a new DOMMatrix object.
`DOMMatrixReadOnly$I ~obj %M の `変異-可能な複製@ とは、新たな `DOMMatrix$I ~objであって,その内部~変数すべて — `行列~成分$すべて, `~is-2D$ — が %M から複製されたものとする。
【 この用語は、以下を簡潔に記述するために,この訳に導入したものである。 】
- `translate(tx, ty, tz)@xR
- 被呼出時には、此れの`変異-可能な複製$上で `translateSelf(tx, ty, tz)$xM を遂行した結果を返さ~MUST。 ◎ Let result be the resulting matrix initialized to the values of the current matrix. ◎ Perform a translateSelf() transformation on result with the arguments tx, ty, tz. ◎ Return result. ◎ The current matrix is not modified.
- `scale(scaleX, scaleY, scaleZ, originX, originY, originZ)@xR
- 被呼出時には、此れの`変異-可能な複製$上で `scaleSelf( scaleX, scaleY, scaleZ, originX, originY, originZ )$xM を遂行した結果を返さ~MUST。 ◎ Let result be the resulting matrix initialized to the values of the current matrix. ◎ Perform a scaleSelf() transformation on result with the arguments scaleX, scaleY, scaleZ, originX, originY, originZ. ◎ Return result. ◎ The current matrix is not modified.
- `scale3d(scale, originX, originY, originZ)@xR
- 被呼出時には、此れの`変異-可能な複製$上で `scale3dSelf(scale, originX, originY, originZ)$xM を遂行した結果を返さ~MUST。 ◎ Let result be the resulting matrix initialized to the values of the current matrix. ◎ Perform a scale3dSelf() transformation on result with the arguments scale, originX, originY, originZ. ◎ Return result. ◎ The current matrix is not modified.
- `rotate(rotX, rotY, rotZ)@xR
- 被呼出時には、此れの`変異-可能な複製$上で `rotateSelf(rotX, rotY, rotZ)$xM を遂行した結果を返さ~MUST。 ◎ Let result be the resulting matrix initialized to the values of the current matrix. ◎ Perform a rotateSelf() transformation on result with the arguments rotX, rotY, rotZ. ◎ Return result. ◎ The current matrix is not modified.
- `rotateFromVector(x, y)@xR
- 被呼出時には、此れの`変異-可能な複製$上で `rotateFromVectorSelf(x, y)$xM を遂行した結果を返さ~MUST。 ◎ Let result be the resulting matrix initialized to the values of the current matrix. ◎ Perform a rotateFromVectorSelf() transformation on result with the arguments x, y. ◎ Return result. ◎ The current matrix is not modified.
- `rotateAxisAngle(x, y, z, angle)@xR
- 被呼出時には、此れの`変異-可能な複製$上で `rotateAxisAngleSelf(x, y, z, angle)$xM を遂行した結果を返さ~MUST。 ◎ Let result be the resulting matrix initialized to the values of the current matrix. ◎ Perform a rotateAxisAngleSelf() transformation on result with the arguments x, y, z, angle. ◎ Return result. ◎ The current matrix is not modified.
- `skewX(sx)@xR
- 被呼出時には、此れの`変異-可能な複製$上で `skewXSelf(sx)$xM を遂行した結果を返さ~MUST。 ◎ Let result be the resulting matrix initialized to the values of the current matrix. Perform a skewXSelf() transformation on result with the argument sx. ◎ Return result. ◎ The current matrix is not modified.
- `skewY(sy)@xR
- 被呼出時には、此れの`変異-可能な複製$上で `skewYSelf(sy)$xM を遂行した結果を返さ~MUST。 ◎ Let result be the resulting matrix initialized to the values of the current matrix. ◎ Perform a skewYSelf() transformation on result with the argument sy. ◎ Return result. ◎ The current matrix is not modified.
- `multiply(other)@xR
- 被呼出時には、此れの`変異-可能な複製$上で `multiplySelf(other)$xM を遂行した結果を返さ~MUST。 ◎ Let result be the resulting matrix initialized to the values of the current matrix. ◎ Perform a multiplySelf() transformation on result with the argument other. ◎ Return result. ◎ The current matrix is not modified.
- `flipX()@xR
- 被呼出時には、此れの`変異-可能な複製$上で `scaleSelf$xM( −1, 1, 1, 0, 0, 0 ) を遂行した結果を返さ~MUST。 ◎ Let result be the resulting matrix initialized to the values of the current matrix. ◎ Post-multiply result with new DOMMatrix([-1, 0, 0, 1, 0, 0]). ◎ Return result. ◎ The current matrix is not modified.
- `flipY()@xR
- 被呼出時には、此れの`変異-可能な複製$上で `scaleSelf$xM( 1, −1, 1, 0, 0, 0 ) を遂行した結果を返さ~MUST。 ◎ Let result be the resulting matrix initialized to the values of the current matrix. ◎ Post-multiply result with new DOMMatrix([1, 0, 0, -1, 0, 0]). ◎ Return result. ◎ The current matrix is not modified.
- `inverse()@xR
- 被呼出時には、此れの`変異-可能な複製$上で `invertSelf()$xM を遂行した結果を返さ~MUST。 ◎ Let result be the resulting matrix initialized to the values of the current matrix. ◎ Perform a invertSelf() transformation on result. ◎ Return result. ◎ The current matrix is not modified.
以下の~methodは、現在の行列を改変しない。 ◎ The following methods do not modify the current matrix.
- `transformPoint(point)@xR
- 被呼出時には、次の結果を返す(引数 %point は改変されない) ⇒ `点を行列で変形する$( %point, 此れ ) ◎ Let pointObject be the result of invoking create a DOMPoint from the dictionary point. Return the result of invoking transform a point with a matrix, given pointObject and the current matrix. The passed argument does not get modified.
- 注記: 此れの `is2D$xR が ~T を返す場合でも、[ %point の `z$pR 属性の値 ~NEQ~SameValueZero `0^jV ]~OR[ %point の `w$pR 属性の値 ~NEQ `1^jV ]の場合は,~4x4行列による乗算が遂行されることになる。 ◎ Even if is2D of the current matrix returns true, a 4x4 matrix multiplication will be performed if the z attribute of point is not 0 or -0 or the w attribute of point is not 1.
- `toFloat32Array()@xR
- 被呼出時には、此れの`行列~成分$すべてを`列主導順$で `Float32Array$I に直列化して返す。 ◎ Returns the serialized 16 elements m11 to m44 of the current matrix in column-major order as Float32Array.
- `toFloat64Array()@xR
- 被呼出時には、此れの`行列~成分$すべてを`列主導順$で `Float64Array$I に直列化して返す。 ◎ Returns the serialized 16 elements m11 to m44 of the current matrix in column-major order as Float64Array.
- `stringifier@xR
-
文字列~化の挙動は、次を走らせ~MUST: ◎ stringification behavior
-
~IF[ 此れの`行列~成分$に,値が有限でないものがある ] ⇒ ~THROW `InvalidStateError$E ◎ If one or more of m11 element through m44 element are a non-finite value, then throw an "InvalidStateError" DOMException.
~CSS構文は `NaN^jV / `Infinity^jV 値を表現し得ない。 ◎ The CSS syntax cannot represent NaN or Infinity values.
-
この手続きの目的においては、所与の~list %~list を `~comma区切りで文字列~化^i するときは,次を走らせた結果を返すとする:
- %結果 ~LET 空~文字列
-
%~list 内の~EACH( %~item ) に対し:
- %結果 に ! `ToString$jA( %~item ) を付加する
- ~IF[ この反復は最後でない ] ⇒ %結果 に 文字 U+002C COMMA, U+0020 SPACE を順に付加する
- ~RET %結果
-
此れの`~is-2D$ に応じて: ◎ If is 2D is true, then:
- ~T
-
~RET 次に挙げる文字列を順に連結した結果:
- `matrix(^l
- 此れの`行列~成分$[ `m11$xE, `m12$xE, `m21$xE, `m22$xE, `m41$xE, `m42$xE ]からなる同順の~listを, `~comma区切りで文字列~化^i した結果
- `)^l
- これは、 `matrix()$f 関数の形による文字列になる。 `CSS3-TRANSFORMS$r ◎ The string will be in the form of a a CSS Transforms <matrix()> function. [CSS3-TRANSFORMS]
- ~F
-
~RET 次に挙げる文字列を順に連結した結果:
- `matrix3d(^l
- 此れの`行列~成分$すべてからなる`列主導順$による~listを, `~comma区切りで文字列~化^i した結果
- `)^l
- これは、 `matrix3d()$f 関数の形による文字列になる。 `CSS3-TRANSFORMS$r ◎ The string will be in the form of a a CSS Transforms <matrix3d()> function. [CSS3-TRANSFORMS] ◎ Return string.
-
行列を作成して~2D変形~methodを~callする例: ◎ In this example, a matrix is created and several 2D transformation methods are called:
var %matrix = new DOMMatrix(); %matrix.scaleSelf(2); %matrix.translateSelf(20,20); console.assert(%matrix.toString() === `matrix(2, 0, 0, 2, 40, 40)^l);
行列を作成して~3D変形~methodを~callする例: ◎ In the following example, a matrix is created and several 3D transformation methods are called:
var %matrix = new DOMMatrix(); %matrix.scale3dSelf(2); console.assert(matrix.toString() === `matrix3d(2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1)^l);
~3D演算に対しては、 `stringifier$xR は,~3D行列を表現する文字列を返す。 ◎ For 3D operations, the stringifier returns a string representing a 3D matrix.
次の例は、行列に有限でない値があるので,例外を投出する: ◎ This example will throw an exception because there are non-finite values in the matrix.
var %matrix = new DOMMatrix([NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN]); var %string = matrix + " Batman!";
6.6. 変異-可能な変形~method
以下の各種~methodは、それが呼出された行列~objを改変した上で,~obj自身を返す。 これにより、~~作者は~method~callを連鎖できるようになる。 ◎ The following methods modify the current matrix, so that each method returns the matrix where it was invoked on. The primary benefit of this is allowing content creators to chain method calls.
次の~codeは: ◎ The following code example:
var %matrix = new DOMMatrix();matrix.translateSelf(20, 20); %matrix.scaleSelf(2); %matrix.translateSelf(-20, -20);
次に等価になる: ◎ is equivalent to:
var %matrix = new DOMMatrix(); %matrix.translateSelf(20, 20).scaleSelf(2).translateSelf(-20, -20);
注記: ~methodを連鎖して~callする作者には、変形~methodのうち変異-可能な方を利用することを勧める — そうすれば、~UA内の中間的な `DOMMatrix$I ~objの作成に因る不必要な~memory割当てを避けれるので。 ◎ Authors who use chained method calls are advised to use mutable transformation methods to avoid unnecessary memory allocations due to creation of intermediate DOMMatrix objects in user agents.
- `multiplySelf(other)@xM
-
被呼出時には、次を走らせ~MUST:
- %M ~LET `辞書から行列を作成する$( %other, `DOMMatrix$I ) ◎ Let otherObject be the result of invoking create a DOMMatrix from the dictionary other.
- 此れの行列に %M を`右から乗算-$する ◎ The otherObject matrix gets post-multiplied to the current matrix.
- ~IF[ %M の`~is-2D$ ~EQ ~F ] ⇒ 此れの`~is-2D$ ~SET ~F ◎ If is 2D of otherObject is false, set is 2D of the current matrix to false.
- ~RET 此れ ◎ Return the current matrix.
- `preMultiplySelf(other)@xM
-
被呼出時には、次を走らせ~MUST:
- %M ~LET `辞書から行列を作成する$( %other, `DOMMatrix$I ) ◎ Let otherObject be the result of invoking create a DOMMatrix from the dictionary other.
- 此れの行列に %M を`左から乗算-$する ◎ The otherObject matrix gets pre-multiplied to the current matrix.
- ~IF[ %M の`~is-2D$ ~EQ ~F ] ⇒ 此れの`~is-2D$ ~SET ~F ◎ If is 2D of otherObject is false, set is 2D of the current matrix to false.
- ~RET 此れ ◎ Return the current matrix.
- `translateSelf(tx, ty, tz)@xM
-
被呼出時には、次を走らせ~MUST:
- 此れの行列に次の行列を`右から乗算-$する ⇒ 移動量 ( %tx, %ty, %tz ) による`~3D並進$を表現する行列 `CSS3-TRANSFORMS$r ◎ Post-multiply a translation transformation on the current matrix. The 3D translation matrix is described in CSS Transforms. [CSS3-TRANSFORMS]
- ~IF[ %tz ~NEQ~SameValueZero `0^jV ] ⇒ 此れの`~is-2D$ ~SET ~F ◎ If tz is specified and not 0 or -0, set is 2D of the current matrix to false.
- ~RET 此れ ◎ Return the current matrix.
- `scaleSelf( scaleX, scaleY, scaleZ, originX, originY, originZ )@xM
-
被呼出時には、次を走らせ~MUST:
- ~IF[ %scaleY は与えられてない ] ⇒ %scaleY ~SET %scaleX ◎ ↓
-
此れの行列に[ 次に与える 3 個の行列 `CSS3-TRANSFORMS$r ]を,順に`右から乗算-$する: ◎ ↓
- 移動量 ( %originX, %originY, %originZ ) による`~3D並進$を表現する行列 ◎ Perform a translateSelf() transformation on the current matrix with the arguments originX, originY, originZ. ◎ If scaleY is missing, set scaleY to the value of scaleX.
- [ %scaleX, %scaleY, %scaleZ ] による`~3D拡縮$を表現する行列 ◎ Post-multiply a non-uniform scale transformation on the current matrix. The 3D scale matrix is described in CSS Transforms with sx = scaleX, sy = scaleY and sz = scaleZ. [CSS3-TRANSFORMS]
- 移動量 ( −%originX, −%originY, −%originZ ) による`~3D並進$を表現する行列 ◎ Negate originX, originY and originZ. ◎ Perform a translateSelf() transformation on the current matrix with the arguments originX, originY, originZ.
- ~IF[ %scaleZ ~NEQ `1^jV ]~OR[ %originZ ~NEQ~SameValueZero `0^jV ] ⇒ 此れの`~is-2D$ ~SET ~F ◎ If scaleZ is not 1 or originZ is not 0 or -0, set is 2D of the current matrix to false.
- ~RET 此れ ◎ Return the current matrix.
- `scale3dSelf(scale, originX, originY, originZ)@xM
-
被呼出時には、次を走らせ~MUST:
- 此れ上で `scaleSelf( scale, scale, scale, originX, originY, originZ )$xM を遂行する
- ~RET 此れ
- 【 原文の記述には、`~is-2D$の設定-法に誤りがある。 】
- `rotateSelf(rotX, rotY, rotZ)@xM
-
被呼出時には、次を走らせ~MUST:
- ~IF[ %rotZ は与えられてない ] ⇒ %rotZ ~SET `0^jV ◎ ↓
- ~IF[ %rotY は与えられてない ] ⇒ %rotY ~SET `0^jV ◎ If rotY and rotZ are both missing, set rotZ to the value of rotX and set rotX and rotY to 0. ◎ If rotY is still missing, set rotY to 0. ◎ If rotZ is still missing, set rotZ to 0.
- ~IF[ ( %rotX, %rotY ) ~NEQ~SameValueZero ( `0^jV, `0^jV ) ] ⇒ 此れの`~is-2D$ ~SET ~F ◎ If rotX or rotY are not 0 or -0, set is 2D of the current matrix to false.
-
此れの行列に[ 次に与える 3 個の行列 `CSS3-TRANSFORMS$r ]を,順に`右から乗算-$する: ◎ ↓
- 軸~vector [ 0, 0, 1 ] と回転角 %rotZ (単位度) による`~3D回転$を表現する行列 ◎ Post-multiply a rotation transformation on the current matrix around the vector 0, 0, 1 by the specified rotation rotZ in degrees. The 3D rotation matrix is described in CSS Transforms with alpha = rotZ in degrees. [CSS3-TRANSFORMS]
- 軸~vector [ 0, 1, 0 ] と回転角 %rotY (単位度) による`~3D回転$を表現する行列 ◎ Post-multiply a rotation transformation on the current matrix around the vector 0, 1, 0 by the specified rotation rotY in degrees. The 3D rotation matrix is described in CSS Transforms with alpha = rotY in degrees. [CSS3-TRANSFORMS]
- 軸~vector [ 1, 0, 0 ] と回転角 %rotX (単位度) による`~3D回転$を表現する行列 ◎ Post-multiply a rotation transformation on the current matrix around the vector 1, 0, 0 by the specified rotation rotX in degrees. The 3D rotation matrix is described in CSS Transforms with alpha = rotX in degrees. [CSS3-TRANSFORMS]
- ~RET 此れ ◎ Return the current matrix.
- `rotateFromVectorSelf(x, y)@xM
-
被呼出時には、次を走らせ~MUST:
- %回転角 ~LET 0
- ~IF[ ( %x, %y ) ~NEQ~SameValueZero ( `0^jV, `0^jV ) ] ⇒ %回転角 ~SET ~vector [ 1, 0 ] と [ %x, %y ] との間の時計回り方向の角度 【時計回り — X 軸, Y 軸の方向は?どっちの~vectorから?】 ◎ ↓
- 此れの行列に次の行列を`右から乗算-$する ⇒ 回転角 %回転角 による`~2D回転$を表現する行列 `CSS3-TRANSFORMS$r
- ~RET 此れ
- `rotateAxisAngleSelf(x, y, z, angle)@xM
-
被呼出時には、次を走らせ~MUST:
- 此れの行列に次の行列を`右から乗算-$する ⇒ 軸~vector [ %x, %y, %z ] と回転角 %angle (単位度)による`~3D回転$を表現する行列 `CSS3-TRANSFORMS$r ◎ Post-multiply a rotation transformation on the current matrix around the specified vector x, y, z by the specified rotation angle in degrees. The 3D rotation matrix is described in CSS Transforms with alpha = angle in degrees. [CSS3-TRANSFORMS]
- ~IF[ ( %x, %y ) ~NEQ~SameValueZero ( `0^jV, `0^jV ) ] ⇒ 此れの`~is-2D$ ~SET ~F ◎ If x or y are not 0 or -0, set is 2D of the current matrix to false.
- ~RET 此れ ◎ Return the current matrix.
- `skewXSelf(sx)@xM
-
被呼出時には、次を走らせ~MUST:
- 此れの行列に次の行列を`右から乗算-$する ⇒ 角度 %sx (単位度)による`~X軸~不変の~2D斜傾$を表現する行列 `CSS3-TRANSFORMS$r ◎ Post-multiply a skewX transformation on the current matrix by the specified angle sx in degrees. The 2D skewX matrix is described in CSS Transforms with alpha = sx in degrees. [CSS3-TRANSFORMS]
- ~RET 此れ ◎ Return the current matrix.
- `skewYSelf(sy)@xM
-
被呼出時には、次を走らせ~MUST:
- 此れの行列に次の行列を`右から乗算-$する ⇒ 角度 %sy (単位度)による`~Y軸~不変の~2D斜傾$を表現する行列 `CSS3-TRANSFORMS$r ◎ Post-multiply a skewX transformation on the current matrix by the specified angle sy in degrees. The 2D skewY matrix is described in CSS Transforms with beta = sy in degrees. [CSS3-TRANSFORMS]
- ~RET 此れ ◎ Return the current matrix.
- `invertSelf()@xM
-
被呼出時には、次を走らせ~MUST:
- ~IF[ 此れの行列は可逆である ] ⇒ 此れの行列 ~SET 此れの行列の逆~行列 ◎ Invert the current matrix.
- ~ELSE ⇒# 此れのすべての`行列~成分$ ~SET `NaN^jV; 此れの`~is-2D$ ~SET ~F ◎ If the current matrix is not invertible set all attributes to NaN and set is 2D to false.
- ~RET 此れ ◎ Return the current matrix.
- `setMatrixValue(transformList)@xM
-
被呼出時には、次を走らせ~MUST:
- ( %行列, %is2D ) ~LET `行列として構文解析する$( %transformList ) ◎ Parse transformList into an abstract matrix, and let matrix and 2dTransform be the result.\
- ~IF[ %行列 ~EQ ε ] ⇒ ~THROW `SyntaxError$E ◎ If the result is failure, then throw a "SyntaxError" DOMException.
- 此れの`~is-2D$ ~SET %is2D ◎ Set is 2D to the value of 2dTransform.
- 此れの各 `行列~成分$ ~SET %行列 の対応する成分の値 ◎ Set m11 element through m44 element to the element values of matrix in column-major order.
- ~RET 此れ ◎ Return the current matrix.
7. 有構造~直列化
[ `DOMPointReadOnly$I / `DOMPoint$I / `DOMRectReadOnly$I / `DOMRect$I / `DOMQuad$I / `DOMMatrixReadOnly$I / `DOMMatrix$I ]~objは、`直列化-可能$である。 `HTML$r ◎ DOMPointReadOnly, DOMPoint, DOMRectReadOnly, DOMRect, DOMQuad, DOMMatrixReadOnly, and DOMMatrix objects are serializable objects. [HTML]
[ `DOMPointReadOnly$I / `DOMPoint$I ]用の`直列化~手続き$は、所与の ( %値, %直列形 ) に対し,次を走らす: ◎ The serialization steps for DOMPointReadOnly and DOMPoint, given value and serialized, are:
- %直列形 . `X^sl ~SET %値 の`~x座標$ ◎ Set serialized.[[X]] to value’s x coordinate.
- %直列形 . `Y^sl ~SET %値 の`~y座標$ ◎ Set serialized.[[Y]] to value’s y coordinate.
- %直列形 . `Z^sl ~SET %値 の`~z座標$ ◎ Set serialized.[[Z]] to value’s z coordinate.
- %直列形 . `W^sl ~SET %値 の`~w視座$ ◎ Set serialized.[[W]] to value’s w perspective.
[ `DOMPointReadOnly$I / `DOMPoint$I ]用の`逆直列化~手続き$は、所与の ( %直列形, %値 ) に対し,次を走らす: ◎ Their deserialization steps, given serialized and value, are:
- %値 の`~x座標$ ~SET %直列形 . `X^sl ◎ Set value’s x coordinate to serialized.[[X]].
- %値 の`~y座標$ ~SET %直列形 . `Y^sl ◎ Set value’s y coordinate to serialized.[[Y]].
- %値 の`~z座標$ ~SET %直列形 . `Z^sl ◎ Set value’s z coordinate to serialized.[[Z]].
- %値 の`~w視座$ ~SET %直列形 . `W^sl ◎ Set value’s w perspective to serialized.[[W]].
[ `DOMRectReadOnly$I / `DOMRect$I ]用の`直列化~手続き$は、所与の ( %値, %直列形 ) に対し,次を走らす: ◎ The serialization steps for DOMRectReadOnly and DOMRect, given value and serialized, are:
- %直列形 . `X^sl ~SET %値 の`~x座標$rT ◎ Set serialized.[[X]] to value’s x coordinate.
- %直列形 . `Y^sl ~SET %値 の`~y座標$rT ◎ Set serialized.[[Y]] to value’s y coordinate.
- %直列形 . `Width^sl ~SET %値 の`横幅~寸法$ ◎ Set serialized.[[Width]] to value’s width dimension.
- %直列形 . `Height^sl ~SET %値 の`縦幅~寸法$ ◎ Set serialized.[[Height]] to value’s height dimension.
[ `DOMRectReadOnly$I / `DOMRect$I ]用の`逆直列化~手続き$は、所与の ( %直列形, %値 ) に対し,次を走らす: ◎ Their deserialization steps, given serialized and value, are:
- %値 の`~x座標$rT ~SET %直列形 . `X^sl ◎ Set value’s x coordinate to serialized.[[X]].
- %値 の`~y座標$rT ~SET %直列形 . `Y^sl ◎ Set value’s y coordinate to serialized.[[Y]].
- %値 の`横幅~寸法$ ~SET %直列形 . `Width^sl ◎ Set value’s width dimension to serialized.[[Width]].
- %値 の`縦幅~寸法$ ~SET %直列形 . `Height^sl ◎ Set value’s height dimension to serialized.[[Height]].
`DOMQuad$I 用の`直列化~手続き$は、所与の ( %値, %直列形 ) に対し,次を走らす: ◎ The serialization steps for DOMQuad, given value and serialized, are:
- %直列形 . `P1^sl ~SET %値 の`点1$の`下位直列化$ ◎ Set serialized.[[P1]] to the sub-serialization of value’s point 1.
- %直列形 . `P2^sl ~SET %値 の`点2$の`下位直列化$ ◎ Set serialized.[[P2]] to the sub-serialization of value’s point 2.
- %直列形 . `P3^sl ~SET %値 の`点3$の`下位直列化$ ◎ Set serialized.[[P3]] to the sub-serialization of value’s point 3.
- %直列形 . `P4^sl ~SET %値 の`点4$の`下位直列化$ ◎ Set serialized.[[P4]] to the sub-serialization of value’s point 4.
`DOMQuad$I 用の`逆直列化~手続き$は、所与の ( %直列形, %値 ) に対し,次を走らす: ◎ Their deserialization steps, given serialized and value, are:
- %値 の`点1$ ~SET %直列形 . `P1^sl の`下位逆直列化$ ◎ Set value’s point 1 to the sub-deserialization of serialized.[[P1]].
- %値 の`点2$ ~SET %直列形 . `P2^sl の`下位逆直列化$ ◎ Set value’s point 2 to the sub-deserialization of serialized.[[P2]].
- %値 の`点3$ ~SET %直列形 . `P3^sl の`下位逆直列化$ ◎ Set value’s point 3 to the sub-deserialization of serialized.[[P3]].
- %値 の`点4$ ~SET %直列形 . `P4^sl の`下位逆直列化$ ◎ Set value’s point 4 to the sub-deserialization of serialized.[[P4]].
[ `DOMMatrixReadOnly$I / `DOMMatrix$I ]用の`直列化~手続き$は、所与の ( %値, %直列形 ) に対し,次を走らす: ◎ The serialization steps for DOMMatrixReadOnly and DOMMatrix, given value and serialized, are:
-
~IF[ %値 の`~is-2D$ ~EQ ~T ]: ◎ If value’s is 2D is true:
- %直列形 . `M11^sl ~SET %値 の`m11$xE ◎ Set serialized.[[M11]] to value’s m11 element.
- %直列形 . `M12^sl ~SET %値 の`m12$xE ◎ Set serialized.[[M12]] to value’s m12 element.
- %直列形 . `M21^sl ~SET %値 の`m21$xE ◎ Set serialized.[[M21]] to value’s m21 element.
- %直列形 . `M22^sl ~SET %値 の`m22$xE ◎ Set serialized.[[M22]] to value’s m22 element.
- %直列形 . `M41^sl ~SET %値 の`m41$xE ◎ Set serialized.[[M41]] to value’s m41 element.
- %直列形 . `M42^sl ~SET %値 の`m42$xE ◎ Set serialized.[[M42]] to value’s m42 element.
- %直列形 . `Is2D^sl ~SET `true^jV ◎ Set serialized.[[Is2D]] to true.
注記: ~2D[ `DOMMatrix$I / `DOMMatrixReadOnly$I ]においては、一部の他の要素 — 例: `m13$xE — は `-0^jV をとり得る — それは、この~algoにより往来しないことになる。 ◎ It is possible for a 2D DOMMatrix or DOMMatrixReadOnly to have -0 for some of the other elements, e.g., the m13 element, which will not be roundtripped by this algorithm.
-
~ELSE: ◎ Otherwise:
- %直列形 . `M11^sl ~SET %値 の`m11$xE ◎ Set serialized.[[M11]] to value’s m11 element.
- %直列形 . `M12^sl ~SET %値 の`m12$xE ◎ Set serialized.[[M12]] to value’s m12 element.
- %直列形 . `M13^sl ~SET %値 の`m13$xE ◎ Set serialized.[[M13]] to value’s m13 element.
- %直列形 . `M14^sl ~SET %値 の`m14$xE ◎ Set serialized.[[M14]] to value’s m14 element.
- %直列形 . `M21^sl ~SET %値 の`m21$xE ◎ Set serialized.[[M21]] to value’s m21 element.
- %直列形 . `M22^sl ~SET %値 の`m22$xE ◎ Set serialized.[[M22]] to value’s m22 element.
- %直列形 . `M23^sl ~SET %値 の`m23$xE ◎ Set serialized.[[M23]] to value’s m23 element.
- %直列形 . `M24^sl ~SET %値 の`m24$xE ◎ Set serialized.[[M24]] to value’s m24 element.
- %直列形 . `M31^sl ~SET %値 の`m31$xE ◎ Set serialized.[[M31]] to value’s m31 element.
- %直列形 . `M32^sl ~SET %値 の`m32$xE ◎ Set serialized.[[M32]] to value’s m32 element.
- %直列形 . `M33^sl ~SET %値 の`m33$xE ◎ Set serialized.[[M33]] to value’s m33 element.
- %直列形 . `M34^sl ~SET %値 の`m34$xE ◎ Set serialized.[[M34]] to value’s m34 element.
- %直列形 . `M41^sl ~SET %値 の`m41$xE ◎ Set serialized.[[M41]] to value’s m41 element.
- %直列形 . `M42^sl ~SET %値 の`m42$xE ◎ Set serialized.[[M42]] to value’s m42 element.
- %直列形 . `M43^sl ~SET %値 の`m43$xE ◎ Set serialized.[[M43]] to value’s m43 element.
- %直列形 . `M44^sl ~SET %値 の`m44$xE ◎ Set serialized.[[M44]] to value’s m44 element.
- %直列形 . `Is2D^sl ~SET `false^jV ◎ Set serialized.[[Is2D]] to false.
[ `DOMMatrixReadOnly$I / `DOMMatrix$I ]用の`逆直列化~手続き$は、所与の ( %直列形, %値 ) に対し,次を走らす: ◎ Their deserialization steps, given serialized and value, are:
-
~IF[ %直列形 . `Is2D^sl ~EQ `true^jV ]: ◎ If serialized.[[Is2D]] is true:
- %値 の`m11$xE ~SET %直列形 . `M11^sl ◎ Set value’s m11 element to serialized.[[M11]].
- %値 の`m12$xE ~SET %直列形 . `M12^sl ◎ Set value’s m12 element to serialized.[[M12]].
- %値 の`m13$xE ~SET `0^jV ◎ Set value’s m13 element to 0.
- %値 の`m14$xE ~SET `0^jV ◎ Set value’s m14 element to 0.
- %値 の`m21$xE ~SET %直列形 . `M21^sl ◎ Set value’s m21 element to serialized.[[M21]].
- %値 の`m22$xE ~SET %直列形 . `M22^sl ◎ Set value’s m22 element to serialized.[[M22]].
- %値 の`m23$xE ~SET `0^jV ◎ Set value’s m23 element to 0.
- %値 の`m24$xE ~SET `0^jV ◎ Set value’s m24 element to 0.
- %値 の`m31$xE ~SET `0^jV ◎ Set value’s m31 element to 0.
- %値 の`m32$xE ~SET `0^jV ◎ Set value’s m32 element to 0.
- %値 の`m33$xE ~SET `1^jV ◎ Set value’s m33 element to 1.
- %値 の`m34$xE ~SET `0^jV ◎ Set value’s m34 element to 0.
- %値 の`m41$xE ~SET %直列形 . `M41^sl ◎ Set value’s m41 element to serialized.[[M41]].
- %値 の`m42$xE ~SET %直列形 . `M42^sl ◎ Set value’s m42 element to serialized.[[M42]].
- %値 の`m43$xE ~SET `0^jV ◎ Set value’s m43 element to 0.
- %値 の`m44$xE ~SET `1^jV ◎ Set value’s m44 element to 1.
- %値 の`~is-2D$ ~SET ~T ◎ Set value’s is 2D to true.
-
~ELSE: ◎ Otherwise:
- %値 の`m11$xE ~SET %直列形 . `M11^sl ◎ Set value’s m11 element to serialized.[[M11]].
- %値 の`m12$xE ~SET %直列形 . `M12^sl ◎ Set value’s m12 element to serialized.[[M12]].
- %値 の`m13$xE ~SET %直列形 . `M13^sl ◎ Set value’s m13 element to serialized.[[M13]].
- %値 の`m14$xE ~SET %直列形 . `M14^sl ◎ Set value’s m14 element to serialized.[[M14]].
- %値 の`m21$xE ~SET %直列形 . `M21^sl ◎ Set value’s m21 element to serialized.[[M21]].
- %値 の`m22$xE ~SET %直列形 . `M22^sl ◎ Set value’s m22 element to serialized.[[M22]].
- %値 の`m23$xE ~SET %直列形 . `M23^sl ◎ Set value’s m23 element to serialized.[[M23]].
- %値 の`m24$xE ~SET %直列形 . `M24^sl ◎ Set value’s m24 element to serialized.[[M24]].
- %値 の`m31$xE ~SET %直列形 . `M31^sl ◎ Set value’s m31 element to serialized.[[M31]].
- %値 の`m32$xE ~SET %直列形 . `M32^sl ◎ Set value’s m32 element to serialized.[[M32]].
- %値 の`m33$xE ~SET %直列形 . `M33^sl ◎ Set value’s m33 element to serialized.[[M33]].
- %値 の`m34$xE ~SET %直列形 . `M34^sl ◎ Set value’s m34 element to serialized.[[M34]].
- %値 の`m41$xE ~SET %直列形 . `M41^sl ◎ Set value’s m41 element to serialized.[[M41]].
- %値 の`m42$xE ~SET %直列形 . `M42^sl ◎ Set value’s m42 element to serialized.[[M42]].
- %値 の`m43$xE ~SET %直列形 . `M43^sl ◎ Set value’s m43 element to serialized.[[M43]].
- %値 の`m44$xE ~SET %直列形 . `M44^sl ◎ Set value’s m44 element to serialized.[[M44]].
- %値 の`~is-2D$ ~SET ~F ◎ Set value’s is 2D to false.
8. ~privacyと~security 上の考慮点
`DOMMatrix$I / `DOMMatrixReadOnly$I ~interfaceには、文字列を~CSS構文として構文解析する入口もある。 したがって、 `CSS3-SYNTAX$r 仕様の ~privacyと~security上の考慮点 が適用される。 ◎ The DOMMatrix and DOMMatrixReadOnly interfaces have entry-points to parsing a string with CSS syntax. Therefore the privacy and security considerations of the CSS Syntax specification applies. [CSS3-SYNTAX]
これは、~UAにおける~CSS構文解析器の~bugを悪用するために利用される可能性がある。 ◎ This could potentially be used to exploit bugs in the CSS parser in a user agent.
その他に既知の,~security/~privacy上の影響0は、この仕様に定義される~interfaceにはない。 しかしながら,この仕様に定義される~interfaceを利用する~APIを有する他の仕様は、 ~security/~privacy 上の課題を導入する可能性がある。 ◎ There are no other known security or privacy impacts of the interfaces defined in this specification. However, other specifications that have APIs that use the interfaces defined in this specification could potentially introduce security or privacy issues.
例えば、 `CSSOM-VIEW$r に定義される `getBoundingClientRect()$m ~APIは、 `DOMRect$I を返す。 それは、[ 特定0の~fontで描画される~textを包含している,~inline要素 ]の~sizeを計測するためにも利用でき、利用者が その~fontを~installしたかどうかについての情報を公開する。 多数の共通的な~fontに対し,その情報が集計された場合、個人識別可能にもなり得る。 ◎ For example, the getBoundingClientRect() API defined in CSSOM View returns a DOMRect that could be used to measure the size of an inline element containing some text of a particular font, which exposes information about whether the user has that font installed. That information, if used to test many common fonts, can then be personally-identifiable information. [CSSOM-VIEW]
9. 歴史的
~INFORMATIVEこの仕様における各種~interfaceは、様々な仕様に見出される,早期の類似する~interface, および一部の~UAに見出される~proprietaryな~interfaceを置換するものと意図されている。 この節は、それらの~interfaceを列挙することを試みる。 ◎ The interfaces in this specification are intended to replace earlier similar interfaces found in various specifications as well as proprietary interfaces found in some user agents. This section attempts to enumerate these interfaces.
9.1. CSSOM View
`CSSOM-VIEW$r の早期の改訂に定義されていた `ClientRect^I ~interfaceは、 `DOMRect$I に置換された。 この仕様に適合する実装は、 `ClientRect^I を~supportしないことになる。 ◎ Earlier revisions of CSSOM View defined a ClientRect interface, which is replaced by DOMRect. Implementations conforming to this specification will not support ClientRect. [CSSOM-VIEW]
9.2. ~SVG
~SVGの早期の改訂に定義されていた[ `SVGPoint$I / `SVGRect$I / `SVGMatrix$I ]は、この仕様にて[ `DOMPoint$I / `DOMRect$I / `DOMMatrix$I ]の別名として定義された。 `SVG11$r ◎ Earlier revisions of SVG defined SVGPoint, SVGRect, SVGMatrix, which are defined in this specifications as aliases to DOMPoint, DOMRect, DOMMatrix, respectively. [SVG11]
9.3. 非~標準の~interface
一部の~UAは、 `WebKitPoint^I ~interfaceを~supportしていた。 この仕様に適合する実装は、 `WebKitPoint^I を~supportしないことになる。 ◎ Some user agents supported a WebKitPoint interface. Implementations conforming to this specification will not support WebKitPoint.
いくつかの~UAは、 `WebKitCSSMatrix$I ~interfaceを~supportしていた — それは~Web上でも広く利用されている。 それは、この仕様にて `DOMMatrix$I の別名として定義された。 ◎ Several user agents supported a WebKitCSSMatrix interface, which is also widely used on the Web. It is defined in this specification as an alias to DOMMatrix.
一部の~UAは、 `MSCSSMatrix^I ~interfaceを~supportしていた。 この仕様に適合する実装は、 `MSCSSMatrix^I を~supportしないことになる。 ◎ Some user agents supported a MSCSSMatrix interface. Implementations conforming to this specification will not support MSCSSMatrix.
最後の発行版からの変更点
~INFORMATIVE2014 年 9 月 18 日付 草案 からの変更点は: ◎ The following changes were made since the 18 September 2014 Working Draft.
- 各種~interfaceは、一般に,多重定義された構築子に代えて,特定の静的~演算を構築に用いるよう変更して、それらの~interfaceがより一貫するようにした。 しかしながら, `DOMMatrix$I は、 `WebKitCSSMatrix$I との互換性のため,依然として多重定義された構築子を利用する。 ◎ Changed the interfaces to generally use specific static operations for construction instead of using overloaded constructors, and made the interfaces more consistent. However, DOMMatrix still uses an overloaded constructor for compatibility with WebKitCSSMatrix.
- `DOMMatrixInit$I 辞書を導入した。 ◎ Introduced the DOMMatrixInit dictionary.
- 各種~interfaceに~JSON直列化子を追加した。 ◎ Added JSON serializers for the interfaces.
-
`DOMMatrixReadOnly$I, `DOMMatrix$I を `WebKitCSSMatrix$I に互換になるよう変更した: ◎ Changed DOMMatrixReadOnly and DOMMatrix to be compatible with WebKitCSSMatrix:
- `rotate()$xR, `rotateSelf()$xM の引数~名を ( %angle, %originX, %originY ) から ( %rotX, %rotY, %rotZ ) に変更した。 ◎ Changed rotate() and rotateSelf() arguments from (angle, originX, originY) to (rotX, rotY, rotZ).
- `scale()$xR / `scaleSelf()$xM ~methodを,以前の `scaleNonUniform()^m / `scaleNonUniformSelf()^m ~methodにより近くなるよう変更した上で、各種 `scaleNonUniform*^m ~methodは落とした。 ◎ Changed the scale() and scaleSelf() methods to be more like the previous scaleNonUniform()/scaleNonUniformSelf() methods, and dropped the scaleNonUniform* methods.
- `DOMMatrix$I / `DOMMatrixReadOnly$I ~methodに対するすべての引数は、 `setMatrixValue()$xM を除き,~optionalにした。 ◎ Made all arguments optional for DOMMatrix/DOMMatrixReadOnly methods, except for setMatrixValue().
- 引数をとらない構築子を追加した。 ◎ Added no-argument constructor.
- `WebKitCSSMatrix$I は、 `DOMMatrix$I に対する`旧来の~window上の別名$であるものと定義した。 ◎ Defined WebKitCSSMatrix to be a legacy window alias for DOMMatrix.
- `DOMPointReadOnly$I, `DOMPoint$I, `DOMRectReadOnly$I, `DOMRect$I, `DOMQuad$I, `DOMMatrixReadOnly$I, `DOMMatrix$I を `Window$I, `Worker$I 上に公開した。 `Worker$I においては、 `DOMMatrix$I / `DOMMatrixReadOnly$I は,~CSS構文の構文解析と文字列~化を~supportしないとした。 ◎ Exposed DOMPointReadOnly, DOMPoint, DOMRectReadOnly, DOMRect, DOMQuad, DOMMatrixReadOnly and DOMMatrix to Window and Worker. In workers, DOMMatrix and DOMMatrixReadOnly do not support parsing or stringifying with CSS syntax.
- 各種~interfaceの有構造~直列化を定義した。 ◎ Defined structured serialization of the interfaces.
- `DOMQuad$I 上の~live `bounds^m 属性は,~liveでない `getBounds()$q ~methodに置換された。 “結付けられている限界~矩形” の概念も除去された。 ◎ The live bounds attribute on DOMQuad was replaced with a non-live getBounds() method. The "associated bounding rectangle" concept was also removed.
- `DOMMatrix$I / `DOMMatrixReadOnly$I 用の文字列~構文解析器は、~SVG規則に代えて~CSS規則を利用するよう変更した。 ◎ Changed the string parser for DOMMatrix and DOMMatrixReadOnly to use CSS rules instead of SVG rules.
- `DOMMatrix$I / `DOMMatrixReadOnly$I の文字列化子は、今や有限でない値があるときは例外を投出し,他の場合は `ToString$jA ~algoを利用する。 `ECMA-262$r ◎ The stringifier for DOMMatrix and DOMMatrixReadOnly now throws if there are non-finite values, and otherwise uses the ToString algorithm. [ECMA-262]
- `0^jV, `-0^jV の比較は、~~一貫して等しいものと扱われるようにした。 ◎ Made comparisons treat 0 and -0 as equal throughout.
- 次の節を追加した: ~privacyと~security上の考慮点, 歴史的 ◎ Added §8 Privacy and Security Considerations and §9 Historical sections.
2014 年 6 月 26 日付 Last Call Public 草案 からの変更点は: ◎ The following changes were made since the 26 June 2014 Last Call Public Working Draft.
- `DOMPointReadOnly$I の構築子は、 4 個の引数をとるようにした。 ◎ DOMPointReadOnly got a constructor taking 4 arguments.
- `DOMRectReadOnly$I の構築子は、 4 個の引数をとるようにした ◎ DOMRectReadOnly got a constructor taking 4 arguments.
- `DOMMatrixReadOnly$I の構築子は、 数の連列を引数にとるようにした。 ◎ DOMMatrixReadOnly got a constructor taking a sequence of numbers as argument.
- `DOMRectList^I は `ArrayClass^I に転換した。 この~interfaceを利用できるのは、旧来の~interface用に限られる。 ◎ DOMRectList turned to an ArrayClass. The interfaces can just be used for legacy interfaces.
- `DOMRectList^I は、~browserからの~feedbackが待たれる~risk下にあるものとした。 ◎ Put DOMRectList on at-Risk awaiting browser feedback.
- すべての~interfaceは、[ 読専かどうか/ 継承している挙動 ]を述べるため,内部~成分に基づいて述べるようにした。 ◎ All interfaces are described in the sense of internal elements to describe the read-only/writable and inheriting behavior.
- `IndexSizeError^E 例外を `TypeError^E に置換した。 ◎ Replace IndexSizeError exception with TypeError.
2014 年 5 月 22 日付 First Public 草案 からの変更点は: ◎ The following changes were made since the 22 May 2014 First Public Working Draft.
- 変異-可能な変形~methodを, "〜By" から "〜Self" に改称した(例: `translateBy()^m から `translateSelf()^m に)。 ◎ Renamed mutable transformation methods *By to *Self. (E.g. translateBy() got renamed to translateSelf().)
- `invert()^m を `invertSelf()$xM に改称した。 ◎ Renamed invert() to invertSelf().
- 文字列による変形~listを引数にとる `setMatrixValue()$xM を追加した。 ◎ Added setMatrixValue() which takes a transformation list as DOMString.
- `is2D$xR, `isIdentity$xR 属性は、今や読専になった。 ◎ is2D and isIdentity are read-only attributes now.
- ~3D変形や属性~設定-による `is2D$xR を追跡するため、対応する~flagを `DOMMatrixReadOnly$I に追加した。 ◎ DOMMatrixReadOnly gets flagged to track 3D transformation and attribute settings for is2D.
- `invertSelf()$xM, `inverse()$xR は、例外を投出しないようにした。 ◎ invertSelf() and inverse() do not throw exceptions anymore.
謝辞
注意深い考査, ~comment, 訂正を寄せられた、次の方々に感謝する: