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
Add section describing the interpolation between transform lists with different lengths where the shorter list has functions that match the prefix of the longer list.
Copy file name to clipboardExpand all lines: css-transforms-1/Overview.bs
+14-6
Original file line number
Diff line number
Diff line change
@@ -143,7 +143,7 @@ When used in this specification, terms have the meanings assigned in this sectio
143
143
:: A matrix that defines the mapping from the [=local coordinate system=] into the [=viewport coordinate system=].
144
144
145
145
: <dfn>2D matrix</dfn>
146
-
:: A 3x2 transformation matrix with 6 items or a 4x4 matrix with 16 items, where the items m<sub>31</sub>, m<sub>32</sub>, m<sub>13</sub>, m<sub>23</sub>, m<sub>43</sub>, m<sub>14</sub>, m<sub>24</sub>, m<sub>34</sub> are equal to ''0'' and m<sub>33</sub>, m<sub>44</sub> are equal to ''1''.
146
+
:: A 3x2 transformation matrix, or a 4x4 matrix where the items m<sub>31</sub>, m<sub>32</sub>, m<sub>13</sub>, m<sub>23</sub>, m<sub>43</sub>, m<sub>14</sub>, m<sub>24</sub>, m<sub>34</sub> are equal to ''0'' and m<sub>33</sub>, m<sub>44</sub> are equal to ''1''.
147
147
148
148
: <dfn>identity transform function</dfn>
149
149
:: A <a href="#transform-functions">transform function</a> that is equivalent to a identity 4x4 matrix (see <a href="#mathematical-description">Mathematical Description of Transform Functions</a>). Examples for identity transform functions are ''translate(0)'', ''translateX(0)'', ''translateY(0)'', ''scale(1)'', ''scaleX(1)'', ''scaleY(1)'', ''rotate(0)'', ''skew(0, 0)'', ''skewX(0)'', ''skewY(0)'' and ''matrix(1, 0, 0, 1, 0, 0)''.
@@ -733,7 +733,7 @@ When animating or transitioning transforms, the transform function lists must be
733
733
* There is no interpolation necessary. The computed value stays ''transform/none''.
734
734
735
735
<li id="none-transform-animation">
736
-
If one of the <em>from-</em> or <em>to-transforms</em> is ''transform/none''.
736
+
If one of the <em>from-</em> or <em>to-transforms</em> is ''transform/none'':
737
737
* The value ''transform/none'' is replaced by an equivalent [=identity transform function=] list for the corresponding transform function list. Both transform function lists get interpolated following the next rule.
738
738
739
739
<div class="example">
@@ -742,24 +742,32 @@ When animating or transitioning transforms, the transform function lists must be
742
742
</div>
743
743
744
744
<li id="transform-transform-animation">
745
-
If <em>from-</em> and <em>to-transform</em> have the same number of transform functions, each transform function pair has either the same name, or is a derivative of the same <a href="#transform-primitives">primitive</a>.
745
+
If <em>from-</em> and <em>to-transform</em> have the same number of transform functions, each transform function pair has either the same name, or is a derivative of the same <a href="#transform-primitives">primitive</a>:
746
746
* Interpolate each transform function pair as described in <a href="#interpolation-of-transform-functions">Interpolation of transform functions</a>. The computed value is the resulting transform function list.
747
747
748
748
<div class="example">
749
749
For example, if <em>from-transform</em> is ''scale(1) translate(0)'' and <em>to-transform</em> is ''translate(100px) scale(2)'' then ''scale(1)'' and ''translate(100px)'' as well as ''translate(0)'' and ''scale(2)'' don't share a common primitive and therefore can not get interpolated following this rule.
If <em>from-</em> and <em>to-transform</em> have a different number of transform functions, and the functions of the shorter transform list have either the same name, or are derivatives of the same <a href="#transform-primitives">primitive</a> of the function at the equivalent position in the longer list:
755
+
* Extend the shorter list to the length of the longer list, setting the function at each additional position to the [=identity transform function=] matching the function at the equivalent position in the longer list.
756
+
757
+
* Interpolate each transform function pair as described in <a href="#interpolation-of-transform-functions">Interpolation of transform functions</a>. The computed value is the resulting transform function list.
758
+
759
+
<div class="example">
760
+
For example, if <em>from-transform</em> is ''scale(1.5)'' and <em>to-transform</em> is ''scale(1.5) rotate(720deg)'', it interpolates as if the <em>from-transform</em> were specified as ''scale(1.5) rotate(0deg)''.
761
+
</div>
762
+
753
763
<li id="other-animation">
754
764
In all other cases:
755
-
* The transform functions of each transform function list on the <em>from-</em> and <em>to-transform</em> get post multiplied and converted into 4x4 matrices. Each of the matrices gets interpolated following the instructions in <a href="#matrix-interpolation">Interpolation of matrices</a>. The computed value is the transform function ''matrix'' if both initial matrices can be represented by a correlating 3x2 matrix and ''matrix3d'' otherwise.
765
+
* The transform functions of each transform function list on the <em>from-</em> and <em>to-transform</em> get post multiplied and converted into 4x4 matrices. Each of the matrices gets interpolated following the instructions in <a href="#matrix-interpolation">Interpolation of matrices</a>. The computed value is the transform function ''matrix''.
756
766
757
767
</ul>
758
768
759
769
In some cases, an animation might cause a transformation matrix to be singular or non-invertible. For example, an animation in which scale moves from 1 to -1. At the time when the matrix is in such a state, the transformed element is not rendered.
760
770
761
-
Issue(w3c/csswg-drafts#927): Use proposed tranform interpolation from GitHub issue.
762
-
763
771
764
772
Interpolation of primitives and derived transform functions {#interpolation-of-transform-functions}
0 commit comments