Skip to content

Commit 1455e65

Browse files
zcorpansvgeesus
authored andcommitted
WebKitCSSMatrix compat: change rotate()/rotateSelf()
Change the arguments from (angle, originX, originY) to (rotX, rotY, rotZ), all optional. Part of whatwg/compat#19
1 parent a8f8ad2 commit 1455e65

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

geometry/Overview.bs

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -454,9 +454,9 @@ interface DOMMatrixReadOnly {
454454
optional unrestricted double originX = 0,
455455
optional unrestricted double originY = 0,
456456
optional unrestricted double originZ = 0);
457-
DOMMatrix rotate(unrestricted double angle,
458-
optional unrestricted double originX = 0,
459-
optional unrestricted double originY = 0);
457+
DOMMatrix rotate(optional unrestricted double rotX = 0,
458+
optional unrestricted double rotY,
459+
optional unrestricted double rotZ);
460460
DOMMatrix rotateFromVector(unrestricted double x,
461461
unrestricted double y);
462462
DOMMatrix rotateAxisAngle(unrestricted double x,
@@ -529,9 +529,9 @@ interface DOMMatrix : DOMMatrixReadOnly {
529529
optional unrestricted double originX = 0,
530530
optional unrestricted double originY = 0,
531531
optional unrestricted double originZ = 0);
532-
DOMMatrix rotateSelf(unrestricted double angle,
533-
optional unrestricted double originX = 0,
534-
optional unrestricted double originY = 0);
532+
DOMMatrix rotateSelf(optional unrestricted double rotX = 0,
533+
optional unrestricted double rotY,
534+
optional unrestricted double rotZ);
535535
DOMMatrix rotateFromVectorSelf(unrestricted double x,
536536
unrestricted double y);
537537
DOMMatrix rotateAxisAngleSelf(unrestricted double x,
@@ -846,11 +846,11 @@ The following methods do not modify the current matrix and return a new <a inter
846846
</ol>
847847
<p>The current matrix is not modified.</p>
848848
</dd>
849-
<dt><dfn>rotate(<var>angle</var>, <var>originX</var>, <var>originY</var>)</dfn></dt>
849+
<dt><dfn>rotate(<var>rotX</var>, <var>rotY</var>, <var>rotZ</var>)</dfn></dt>
850850
<dd>
851851
<ol>
852852
<li>Let <em>result</em> be the resulting matrix initialized to the values of the current matrix.</li>
853-
<li>Perform a <a method>rotateSelf()</a> transformation on <em>result</em> with the arguments <var>angle</var>, <var>originX</var>, <var>originY</var>.</li>
853+
<li>Perform a <a method>rotateSelf()</a> transformation on <em>result</em> with the arguments <var>rotX</var>, <var>rotY</var>, <var>rotZ</var>.</li>
854854
<li>Return <em>result</em>.</li>
855855
</ol>
856856
<p>The current matrix is not modified.</p>
@@ -1053,12 +1053,23 @@ Note: Authors who use chained method calls are recommended to use mutable transf
10531053
<li>Return the current matrix.</li>
10541054
</ol>
10551055
</dd>
1056-
<dt><dfn>rotateSelf(<var>angle</var>, <var>originX</var>, <var>originY</var>)</dfn></dt>
1056+
<dt><dfn>rotateSelf(<var>rotX</var>, <var>rotY</var>, <var>rotZ</var>)</dfn></dt>
10571057
<dd>
10581058
<ol>
1059-
<li>Apply a <a method>translateSelf(<var>originX</var>, <var>originY</var>)</a> transformation to the current matrix.</li>
1060-
<li>Post-multiply a rotation transformation on the current matrix with the specified rotation <em>angle</em> in degrees. The 2D rotation matrix is <a href="http://www.w3.org/TR/2012/WD-css3-transforms-20120911/#RotateDefined">described</a> in CSS Transforms with <em>alpha</em> = <em>angle</em> in degrees. [[!CSS3-TRANSFORMS]].</li>
1061-
<li>Apply a <a method>translateSelf(-<var>originX</var>, -<var>originY</var>)</a> transformation to the current matrix.</li>
1059+
<li>If <var>rotY</var> and <var>rotZ</var> are both missing, set <var>rotZ</var> to the value
1060+
of <var>rotX</var> and set <var>rotX</var> and <var>rotY</var> to zero.</li>
1061+
1062+
<li>If <var>rotY</var> is still missing, set <var>rotY</var> to zero.</li>
1063+
1064+
<li>If <var>rotZ</var> is still missing, set <var>rotZ</var> to zero.</li>
1065+
1066+
<li>If <var>rotX</var> or <var>rotY</var> are non-zero, set <a>is2D</a> of the current matrix
1067+
to <code>false</code>.</li>
1068+
1069+
<li>Post-multiply the current matrix by each of its 3 rotation matrices about the major axes,
1070+
first Z using <var>rotZ</var>, then Y using <var>rotY</var>, then X using
1071+
<var>rotX</var>.</li>
1072+
10621073
<li>Return the current matrix.</li>
10631074
</ol>
10641075
</dd>

0 commit comments

Comments
 (0)