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
Copy file name to clipboardExpand all lines: css-transforms-1/Overview.bs
+66-12Lines changed: 66 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -180,9 +180,7 @@ The Transform Rendering Model {#transform-rendering}
180
180
181
181
<em>This section is normative.</em>
182
182
183
-
Specifying a value other than ''transform/none'' for the 'transform' property establishes a new [=local coordinate system=] at the element that it is applied to. The mapping from where the element would have rendered into that local coordinate system is given by the element's [=transformation matrix=]. Transformations are cumulative. That is, elements establish their local coordinate system within the coordinate system of their parent. From the perspective of the user, an element effectively accumulates all the 'transform' properties of its ancestors as well as any local transform applied to it. The accumulation of these transforms defines a [=current transformation matrix=] for the element.
184
-
185
-
The coordinate space is a coordinate system with two axes: the X axis increases horizontally to the right; the Y axis increases vertically downwards.
183
+
Specifying a value other than ''transform/none'' for the 'transform' property establishes a new [=local coordinate system=] at the element that it is applied to. The mapping from where the element would have rendered into that local coordinate system is given by the element's [=transformation matrix=].
186
184
187
185
<p id="transformation-matrix-computation">
188
186
The [=transformation matrix=] is computed from the 'transform' and 'transform-origin' properties as follows:
@@ -192,8 +190,63 @@ The [=transformation matrix=] is computed from the 'transform' and 'transform-or
192
190
3. Multiply by each of the transform functions in 'transform' property from left to right
193
191
4. Translate by the negated computed X and Y values of 'transform-origin'
194
192
193
+
<div class=example>
194
+
195
+
An element has a 'transform' property that is not ''transform/none''.
The 'transform-origin' property is set to ''0 0'' and can be omitted. The [=transformation matrix=]<i>TM</i> gets computed by post-multying the <<translate()>>, <<scale()>> and <<rotate()>><<transform-function>>s.
The coordinate space is a coordinate system with two axes: the X axis increases horizontally to the right; the Y axis increases vertically downwards.
212
+
213
+
Transformations are cumulative. That is, elements establish their local coordinate system within the coordinate system of their parent.
214
+
215
+
To map a point <i>p<sub>local</sub></i> with the coordinate pair <i>x<sub>local</sub></i> and <i>y<sub>local</sub></i> from the [=local coordinate system=] of an element into the parent's coordinate system, post-multiply the [=transformation matrix=]<i>TM</i> of the element by <i>p<sub>local</sub></i>. The result is the mapped point <i>p<sub>parent</sub></i> with the coordinate pair <i>x<sub>parent</sub></i> and <i>y<sub>parent</sub></i> in the parent's [=local coordinate system=].
From the perspective of the user, an element effectively accumulates all the 'transform' properties of its ancestors as well as any local transform applied to it. The accumulation of these transforms defines a [=current transformation matrix=] (CTM) for the element.
The [=current transformation matrix=] is computed by post-multiplying all transformation matrices starting from the [=viewport coordinate system=] and ending with the [=transformation matrix=] of an element.
223
+
224
+
<div class=example>
225
+
This example has multiple, nested elements in an SVG document. Some elements get transformed by a [=transformation matrix=].
To map a point <i>p<sub>local</sub></i> with the coordinate pair <i>x<sub>local</sub></i> and <i>y<sub>local</sub></i> from the [=local coordinate system=] of the SVG <a element>rect</a> element into the [=viewport coordinate system=], post-multiply the [=current transformation matrix=]<i>CTM</i> of the element by <i>p<sub>local</sub></i>. The result is the mapped point <i>p<sub>viewport</sub></i> with the coordinate pair <i>x<sub>viewport</sub></i> and <i>y<sub>viewport</sub></i> in the [=viewport coordinate system=].
Note: Transformations do affect the visual rendering, but have no affect on the CSS layout other than affecting overflow. Transforms are also taken into account when computing client rectangles exposed via the Element Interface Extensions, namely <a href="https://www.w3.org/TR/cssom-view/#dom-element-getclientrects">getClientRects()</a> and <a href="https://www.w3.org/TR/cssom-view/#dom-element-getboundingclientrect">getBoundingClientRect()</a>, which are specified in [[CSSOM-VIEW]].
198
251
199
252
<div class="example">
@@ -952,28 +1005,28 @@ Some transform functions can be represented by more generic transform functions.
952
1005
The Transform Function Lists {#transform-function-lists}
If a list of <<transform-function>> is provided, then the net effect is as if each transform function had been specified separately in the order provided. For example,
1008
+
If a list of <<transform-function>>s is provided, then the net effect is as if each transform function had been specified separately in the order provided.
1009
+
1010
+
That is, in the absence of other styling that affects position and dimensions, a nested set of transforms is equivalent to a single list of transform functions, applied from the coordinate system of the ancestor to the [=local coordinate system=] of a given element. The resulting transform is the matrix multiplication of the list of transforms.
That is, in the absence of other styling that affects position and dimensions, a nested set of transforms is equivalent to a single list of transform functions, applied from the top ancestor (with the id <code>root</code>) to the deepest descendant (with the id <code>child</code>). The resulting transform is the matrix multiplication of the list of transforms.
975
-
976
-
Issue(w3c/csswg-drafts#909): Backport point mapping from one coordinate space to another from SVG.
1029
+
</div>
977
1030
978
1031
If a transform function causes the [=current transformation matrix=] of an object to be non-invertible, the object and its content do not get displayed.
979
1032
@@ -1414,6 +1467,7 @@ The following changes were made since the <a href="https://www.w3.org/TR/2017/WD
1414
1467
* No 'transform' on non-replaced inline boxes, table-column boxes, and table-column-group boxes.
1415
1468
* Define target coordinate space for transformations on <{pattern}>, <{linearGradient}>, <{radialGradient}> and <{clipPath}> elements.
1416
1469
* Remove 3-value <<rotate()>> from transform function primitives.
1470
+
* Be more specific about computation of [=transformation matrix=] and [=current transformation matrix=].
0 commit comments