You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change fromString() static method into overloaded constructor,
since Web content depends on it for WebKitCSSMatrix constructor.
However, I could not find (github search) content that depends on
WebKitCSSMatrix(other), so leave as fromMatrix() static method.
Also add a no-argument constructor. I think this was accidentally
left out when switching to static methods.
Part of whatwg/compat#19
@@ -645,8 +647,43 @@ with a sequence <var>numberSequence</var> of 16 elements, follow these steps:
645
647
1. Set <a>is2D</a> to <code>false</code>.
646
648
1. Return <var>matrix</var>
647
649
650
+
The <dfn dfn-type=constructor dfn-for=DOMMatrixReadOnly><code>DOMMatrixReadOnly()</code></dfn> and
651
+
the <dfn dfn-type=constructor dfn-for=DOMMatrix><code>DOMMatrix()</code></dfn> constructors, when
652
+
invoked with no argument, must run the following steps:
653
+
654
+
<ol>
655
+
<li>Return the result of invoking <a>create a 2d matrix</a> of type {{DOMMatrixReadOnly}} or
656
+
{{DOMMatrix}} as appropriate, with the sequence [''1'', ''0'', ''0'', ''1'', ''0'', ''0''].</li>
657
+
</ol>
658
+
659
+
The <dfn dfn-type=constructor dfn-for=DOMMatrixReadOnly><code>DOMMatrixReadOnly(<var>transformList</var>)</code></dfn> and
660
+
the <dfn dfn-type=constructor dfn-for=DOMMatrix><code>DOMMatrix(<var>transformList</var>)</code></dfn> constructors, when invoked with a {{DOMString}} argument, must follow these steps:
661
+
662
+
<ol>
663
+
<li>Parse <var>transformList</var> by following the syntax description in “<a href=http://www.w3.org/TR/css-transforms-1/#svg-syntax>Syntax of the SVG ‘transform’ attribute</a>” [[!CSS3-TRANSFORMS]] to a <<transform-list>>. If parsing is not successful or any <<transform-function>> has <<length>> values without <a spec='css-values'>absolute length</a> units<!--For WD: <a spec='css-values-3'>absolute length units</a>-->, throw a {{SyntaxError}} exception.</li>
664
+
<li>Let <var>2dTransform</var> track the 2D/3D dimension status of the <<transform-list>>.
665
+
<dl class=switch>
666
+
<dt>If the <<transform-list>> consists of any <a href='http://www.w3.org/TR/css-transforms-1/#three-d-transform-functions'>3D Transform functions</a></dt>
667
+
<dd>Set <var>2dTransform</var> to <code>false</code>.</dd>
668
+
<dt>Otherwise</dt>
669
+
<dd>Set <var>2dTransform</var> to <code>true</code>.</dd>
670
+
</dl>
671
+
</li>
672
+
<li>Transform all <<transform-function>>s to 4x4 matrices by following the “<a href=http://www.w3.org/TR/css-transforms-1/#mathematical-description>Mathematical Description of Transform Functions</a>” [[!CSS3-TRANSFORMS]].</li>
673
+
<li>Let <var>matrix</var> be a 4x4 matrix as shown in the initial figure of this section. Post-multiply all matrices from left to right and set <var>matrix</var> to this product.</li>
674
+
<li>
675
+
<dl class=switch>
676
+
<dt>If <var>2dTransform</var> is set to <code>true</code></dt>
677
+
<dd>Return the result of invoking <a>create a 2d matrix</a> of type {{DOMMatrixReadOnly}} or {{DOMMatrix}} as appropriate, with a sequence of numbers, the values being the elements <var>m11</var>, <var>m12</var>, <var>m21</var>, <var>m22</var>, <var>m41</var> and <var>m42</var> of <var>matrix</var>.</dd>
678
+
<dt>If <var>2dTransform</var> is set to <code>false</code></dt>
679
+
<dd>Return the result of invoking <a>create a 3d matrix</a> of type {{DOMMatrixReadOnly}} or {{DOMMatrix}} as appropriate, with a sequence of numbers, the values being the 16 elements of <var>matrix</var>.</dd>
680
+
</dl>
681
+
</li>
682
+
</ol>
683
+
648
684
The <dfn dfn-type=constructor dfn-for=DOMMatrixReadOnly><code>DOMMatrixReadOnly(<var>numberSequence</var>)</code></dfn> and
649
-
the <dfn dfn-type=constructor dfn-for=DOMMatrix><code>DOMMatrix(<var>numberSequence</var>)</code></dfn> constructors, when invoked, must run the following steps:
685
+
the <dfn dfn-type=constructor dfn-for=DOMMatrix><code>DOMMatrix(<var>numberSequence</var>)</code></dfn> constructors,
686
+
when invoked with a sequence argument, must run the following steps:
650
687
651
688
<dl class=switch>
652
689
<dt>If <var>numberSequence</var> has 6 elements</dt>
@@ -673,31 +710,6 @@ the <dfn method lt=fromMatrix() dfn-for=DOMMatrix id=dom-dommatrix-frommatrix><c
673
710
</li>
674
711
</ol>
675
712
676
-
The <dfn method dfn-for=DOMMatrixReadOnly id=dom-dommatrixreadonly-fromstring><code>fromString(<var>transformList</var>)</code></dfn> static method on {{DOMMatrixReadOnly}} and
677
-
the <dfn method dfn-for=DOMMatrix id=dom-dommatrix-fromstring><code>fromString(<var>transformList</var>)</code></dfn> static method on {{DOMMatrix}} must follow these steps:
678
-
679
-
<ol>
680
-
<li>Parse <var>transformList</var> by following the syntax description in “<a href=http://www.w3.org/TR/css-transforms-1/#svg-syntax>Syntax of the SVG ‘transform’ attribute</a>” [[!CSS3-TRANSFORMS]] to a <<transform-list>>. If parsing is not successful or any <<transform-function>> has <<length>> values without <a spec='css-values'>absolute length</a> units<!--For WD: <a spec='css-values-3'>absolute length units</a>-->, throw a {{SyntaxError}} exception.</li>
681
-
<li>Let <var>2dTransform</var> track the 2D/3D dimension status of the <<transform-list>>.
682
-
<dl class=switch>
683
-
<dt>If the <<transform-list>> consists of any <a href='http://www.w3.org/TR/css-transforms-1/#three-d-transform-functions'>3D Transform functions</a></dt>
684
-
<dd>Set <var>2dTransform</var> to <code>false</code>.</dd>
685
-
<dt>Otherwise</dt>
686
-
<dd>Set <var>2dTransform</var> to <code>true</code>.</dd>
687
-
</dl>
688
-
</li>
689
-
<li>Transform all <<transform-function>>s to 4x4 matrices by following the “<a href=http://www.w3.org/TR/css-transforms-1/#mathematical-description>Mathematical Description of Transform Functions</a>” [[!CSS3-TRANSFORMS]].</li>
690
-
<li>Let <var>matrix</var> be a 4x4 matrix as shown in the initial figure of this section. Post-multiply all matrices from left to right and set <var>matrix</var> to this product.</li>
691
-
<li>
692
-
<dl class=switch>
693
-
<dt>If <var>2dTransform</var> is set to <code>true</code></dt>
694
-
<dd>Return the result of invoking <a>create a 2d matrix</a> of type {{DOMMatrixReadOnly}} or {{DOMMatrix}} as appropriate, with a sequence of numbers, the values being the elements <var>m11</var>, <var>m12</var>, <var>m21</var>, <var>m22</var>, <var>m41</var> and <var>m42</var> of <var>matrix</var> of <var>matrix</var>.</dd>
695
-
<dt>If <var>2dTransform</var> is set to <code>false</code></dt>
696
-
<dd>Return the result of invoking <a>create a 3d matrix</a> of type {{DOMMatrixReadOnly}} or {{DOMMatrix}} as appropriate, with a sequence of numbers, the values being the 16 elements of <var>matrix</var>.</dd>
697
-
</dl>
698
-
</li>
699
-
</ol>
700
-
701
713
The <dfn method dfn-for=DOMMatrixReadOnly id=dom-dommatrixreadonly-fromfloat32array><code>fromFloat32Array(<var>array32</var>)</code></dfn> static method on {{DOMMatrixReadOnly}} and
702
714
the <dfn method dfn-for=DOMMatrix id=dom-dommatrix-fromfloat32array><code>fromFloat32Array(<var>array32</var>)</code></dfn> static method on {{DOMMatrix}} must follow these steps:
0 commit comments