Skip to content

Commit 188b6af

Browse files
zcorpansvgeesus
authored andcommitted
WebKitCSSMatrix compat: change scale()/scaleSelf()
Drop the scale() and scaleSelf() methods, and rename the scaleNonUniform()/scaleNonUniformSelf() methods to scale() and scaleSelf(), respectively. Make scaleX optional, with default value 1, and scaleY use the value of scaleX if omitted. Part of whatwg/compat#19
1 parent 1455e65 commit 188b6af

File tree

1 file changed

+41
-45
lines changed

1 file changed

+41
-45
lines changed

geometry/Overview.bs

Lines changed: 41 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Abstract: This specification provides basic geometric interfaces to represent po
2121
!Issues list: <a href="https://www.w3.org/Bugs/Public/buglist.cgi?product=FXTF&amp;component=Geometry&amp;resolution=---">Bugzilla</a> (<a href="https://www.w3.org/Bugs/Public/enter_bug.cgi?product=FXTF&amp;component=Geometry">file a bug</a>)
2222
Test Suite: http://test.csswg.org/suites/geometry-1_dev/nightly-unstable/
2323
Use <i> Autolinks: yes
24-
Ignored Vars: f, Point object, m44, e, m42, quad1, m41, stringifier, point object, m12, c, transformPoint, m21, d, m22, quad2
24+
Ignored Vars: f, Point object, m44, e, m42, quad1, m41, stringifier, point object, m12, c, transformPoint, m21, d, m22, quad2, sz
2525
</pre>
2626

2727
<pre class=anchors>
@@ -441,19 +441,16 @@ interface DOMMatrixReadOnly {
441441
DOMMatrix translate(unrestricted double tx,
442442
unrestricted double ty,
443443
optional unrestricted double tz = 0);
444-
DOMMatrix scale(unrestricted double scale,
444+
DOMMatrix scale(optional unrestricted double scaleX = 1,
445+
optional unrestricted double scaleY,
446+
optional unrestricted double scaleZ = 1,
445447
optional unrestricted double originX = 0,
446-
optional unrestricted double originY = 0);
448+
optional unrestricted double originY = 0,
449+
optional unrestricted double originZ = 0);
447450
DOMMatrix scale3d(unrestricted double scale,
448451
optional unrestricted double originX = 0,
449452
optional unrestricted double originY = 0,
450453
optional unrestricted double originZ = 0);
451-
DOMMatrix scaleNonUniform(unrestricted double scaleX,
452-
optional unrestricted double scaleY = 1,
453-
optional unrestricted double scaleZ = 1,
454-
optional unrestricted double originX = 0,
455-
optional unrestricted double originY = 0,
456-
optional unrestricted double originZ = 0);
457454
DOMMatrix rotate(optional unrestricted double rotX = 0,
458455
optional unrestricted double rotY,
459456
optional unrestricted double rotZ);
@@ -516,19 +513,16 @@ interface DOMMatrix : DOMMatrixReadOnly {
516513
DOMMatrix translateSelf(unrestricted double tx,
517514
unrestricted double ty,
518515
optional unrestricted double tz = 0);
519-
DOMMatrix scaleSelf(unrestricted double scale,
520-
optional unrestricted double originX = 0,
521-
optional unrestricted double originY = 0);
516+
DOMMatrix scaleSelf(optional unrestricted double scaleX = 1,
517+
optional unrestricted double scaleY,
518+
optional unrestricted double scaleZ = 1,
519+
optional unrestricted double originX = 0,
520+
optional unrestricted double originY = 0,
521+
optional unrestricted double originZ = 0);
522522
DOMMatrix scale3dSelf(unrestricted double scale,
523523
optional unrestricted double originX = 0,
524524
optional unrestricted double originY = 0,
525525
optional unrestricted double originZ = 0);
526-
DOMMatrix scaleNonUniformSelf(unrestricted double scaleX,
527-
optional unrestricted double scaleY = 1,
528-
optional unrestricted double scaleZ = 1,
529-
optional unrestricted double originX = 0,
530-
optional unrestricted double originY = 0,
531-
optional unrestricted double originZ = 0);
532526
DOMMatrix rotateSelf(optional unrestricted double rotX = 0,
533527
optional unrestricted double rotY,
534528
optional unrestricted double rotZ);
@@ -819,12 +813,17 @@ The following methods do not modify the current matrix and return a new <a inter
819813
</ol>
820814
<p>The current matrix is not modified.</p>
821815
</dd>
822-
<dt><dfn>scale(<var>scale</var>, <var>originX</var>, <var>originY</var>)</dfn></dt>
816+
<dt><dfn>scale(<var>scaleX</var>, <var>scaleY</var>, <var>scaleZ</var>, <var>originX</var>, <var>originY</var>, <var>originZ</var>)</dfn></dt>
823817
<dd>
824818
<ol>
825-
<li>Let <em>other</em> be the resulting matrix initialized to the values of the current matrix.</li>
826-
<li>Perform a <a method>scaleSelf()</a> transformation on <em>result</em> with the arguments <var>scale</var>, <var>originX</var>, <var>originY</var>.</li>
827-
<li>Return <em>result</em>.</li>
819+
<li>Let <var>result</var> be the resulting matrix initialized to the values of the current
820+
matrix.</li>
821+
822+
<li>Perform a <a method>scaleSelf()</a> transformation on <var>result</var> with the arguments
823+
<var>scaleX</var>, <var>scaleY</var>, <var>scaleZ</var>, <var>originX</var>,
824+
<var>originY</var>, <var>originZ</var>.</li>
825+
826+
<li>Return <var>result</var>.</li>
828827
</ol>
829828
<p>The current matrix is not modified.</p>
830829
</dd>
@@ -837,15 +836,6 @@ The following methods do not modify the current matrix and return a new <a inter
837836
</ol>
838837
<p>The current matrix is not modified.</p>
839838
</dd>
840-
<dt><dfn>scaleNonUniform(<var>scaleX</var>, <var>scaleY</var>, <var>scaleZ</var>, <var>originX</var>, <var>originY</var>, <var>originZ</var>)</dfn></dt>
841-
<dd>
842-
<ol>
843-
<li>Let <em>result</em> be the resulting matrix initialized to the values of the current matrix.</li>
844-
<li>Perform a <a method>scaleNonUniformSelf()</a> transformation on <em>result</em> with the arguments <var>scaleX</var>, <var>scaleY</var>, <var>scaleZ</var>, <var>originX</var>, <var>originY</var>, <var>originZ</var>.</li>
845-
<li>Return <em>result</em>.</li>
846-
</ol>
847-
<p>The current matrix is not modified.</p>
848-
</dd>
849839
<dt><dfn>rotate(<var>rotX</var>, <var>rotY</var>, <var>rotZ</var>)</dfn></dt>
850840
<dd>
851841
<ol>
@@ -1024,12 +1014,28 @@ Note: Authors who use chained method calls are recommended to use mutable transf
10241014
<li>Return the current matrix.</li>
10251015
</ol>
10261016
</dd>
1027-
<dt><dfn>scaleSelf(<var>scale</var>, <var>originX</var>, <var>originY</var>)</dfn></dt>
1017+
<dt><dfn>scaleSelf(<var>scaleX</var>, <var>scaleY</var>, <var>scaleZ</var>, <var>originX</var>, <var>originY</var>, <var>originZ</var>)</dfn></dt>
10281018
<dd>
10291019
<ol>
1030-
<li>Apply a <a method>translateSelf(<var>originX</var>, <var>originY</var>)</a> transformation to the current matrix.</li>
1031-
<li>Post-multiply a uniform 2D scale transformation (<a attribute>m11</a> = <a attribute>m22</a> = <em>scale</em>) on the current matrix. The 2D scale matrix is <a href="http://www.w3.org/TR/2012/WD-css3-transforms-20120911/#ScaleDefined">described</a> in CSS Transforms with <em>sx</em> = <em>sy</em> = <em>scale</em>. [[!CSS3-TRANSFORMS]].</li>
1032-
<li>Apply a <a method>translateSelf(-<var>originX</var>, -<var>originY</var>)</a> transformation to the current matrix.</li>
1020+
<li>Perform a <a method>translateSelf()</a> transformation on the current matrix with the arguments <var>originX</var>, <var>originY</var>, <var>originZ</var>.</li>
1021+
1022+
<li>If <var>scaleY</var> is missing, set <var>scaleY</var> to the value of
1023+
<var>scaleX</var>.</li>
1024+
1025+
<li>Post-multiply a non-uniform scale transformation on the current matrix. The 3D scale
1026+
matrix is <a
1027+
href="http://www.w3.org/TR/2012/WD-css3-transforms-20120911/#Scale3dDefined">described</a> in
1028+
CSS Transforms with <var>sx</var> = <var>scaleX</var>, <var>sy</var> = <var>scaleY</var> and
1029+
<var>sz</var> = <var>scaleZ</var>. [[!CSS3-TRANSFORMS]].</li>
1030+
1031+
<li>Negate <var>originX</var>, <var>originY</var> and <var>originZ</var>.</li>
1032+
1033+
<li>Perform a <a method>translateSelf()</a> transformation on the current matrix with the
1034+
arguments <var>originX</var>, <var>originY</var>, <var>originZ</var>.</li>
1035+
1036+
<li>If <var>scaleZ</var> is not ''1'' or <var>originZ</var> is not ''0'', set <a>is2D</a> of
1037+
the current matrix to <code>false</code>.</li>
1038+
10331039
<li>Return the current matrix.</li>
10341040
</ol>
10351041
</dd>
@@ -1043,16 +1049,6 @@ Note: Authors who use chained method calls are recommended to use mutable transf
10431049
<li>Return the current matrix.</li>
10441050
</ol>
10451051
</dd>
1046-
<dt><dfn>scaleNonUniformSelf(<var>scaleX</var>, <var>scaleY</var>, <var>scaleZ</var>, <var>originX</var>, <var>originY</var>, <var>originZ</var>)</dfn></dt>
1047-
<dd>
1048-
<ol>
1049-
<li>Apply a <a method>translateSelf(<var>originX</var>, <var>originY</var>, <var>originZ</var>)</a> transformation to the current matrix.</li>
1050-
<li>Post-multiply a non-uniform scale transformation on the current matrix. The 3D scale matrix is <a href="http://www.w3.org/TR/2012/WD-css3-transforms-20120911/#Scale3dDefined">described</a> in CSS Transforms with <em>sx</em> = <em>scaleX</em>, <em>sy</em> = <em>scaleY</em> and <em>sz</em> = <em>scaleZ</em>. [[!CSS3-TRANSFORMS]].</li>
1051-
<li>Apply a <a method>translateSelf(-<var>originX</var>, -<var>originY</var>, -<var>originZ</var>)</a> transformation to the current matrix.</li>
1052-
<li>If <em>scaleZ</em> is specified and not ''1'' or <em>originZ</em> is specified and not ''0'', set <a>is2D</a> of the current matrix to <code>false</code>.</li>
1053-
<li>Return the current matrix.</li>
1054-
</ol>
1055-
</dd>
10561052
<dt><dfn>rotateSelf(<var>rotX</var>, <var>rotY</var>, <var>rotZ</var>)</dfn></dt>
10571053
<dd>
10581054
<ol>

0 commit comments

Comments
 (0)