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
[css-transforms-2] Per WG resolution, clarify that perspective()/'perspective' takes values down to zero, and clamps to 1px to avoid infinity and problems near infinity. Fixesw3c#413, closesw3c#4279.
Copy file name to clipboardExpand all lines: css-transforms-2/Overview.bs
+15-6Lines changed: 15 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -82,7 +82,7 @@ Terminology {#terminology}
82
82
:: A 4x4 matrix which does not fulfill the requirements of an [=2D matrix=].
83
83
84
84
: <dfn>identity transform function</dfn>
85
-
:: In addition to the identity transform function in CSS Transforms, examples for identity transform functions include ''translate3d(0, 0, 0)'', ''translateZ(0)'', ''scaleZ(1)'', ''rotate3d(1, 1, 1, 0)'', ''rotateX(0)'', ''rotateY(0)'', ''rotateZ(0)'' and ''matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)''. A special case is perspective: ''perspective(infinity)''. The value of m<sub>34</sub> becomes infinitesimal small and the transform function is therefore assumed to be equal to the identity matrix.
85
+
:: In addition to the identity transform function in CSS Transforms, examples for identity transform functions include ''translate3d(0, 0, 0)'', ''translateZ(0)'', ''scaleZ(1)'', ''rotate3d(1, 1, 1, 0)'', ''rotateX(0)'', ''rotateY(0)'', ''rotateZ(0)'' and ''matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)''. A special case is perspective: ''perspective(infinity)''. The value of m<sub>34</sub> becomes infinitesimal small and the transform function is therefore assumed to be equal to the identity matrix. 1111lllll
86
86
87
87
: <dfn>perspective matrix</dfn>
88
88
:: A matrix computed from the values of the 'perspective' and 'perspective-origin' properties as described <a href="#perspective-matrix-computation">below</a>.
@@ -760,7 +760,7 @@ The 'perspective' Property {#perspective-property}
760
760
761
761
<pre class='propdef'>
762
762
Name: perspective
763
-
Value: none | <<length>>
763
+
Value: none | <<length [0, ∞]>>
764
764
Initial: none
765
765
Applies to: <a>transformable elements</a>
766
766
Inherited: no
@@ -769,14 +769,20 @@ Computed value: the keyword ''perspective/none'' or an absolute length
769
769
Animation type: by computed value
770
770
</pre>
771
771
772
-
Where <<length>> values must be positive.
773
-
774
772
<dl dfn-type=value dfn-for="perspective">
775
773
: <dfn><<length>></dfn>
776
774
:: Distance to the center of projection.
777
775
778
776
Issue: Verify that projection is the distance to the center of projection.
779
777
778
+
As very small <<length>> values can produce bizarre rendering results
779
+
and stress the numerical accuracy of transform calculations,
780
+
values less than ''1px'' must be treated as ''1px''
781
+
for rendering purposes.
782
+
(This clamping does not affect the underlying value,
783
+
so ''perspective: 0;'' in a stylesheet
784
+
will still serialize back as ''0''.)
785
+
780
786
: <dfn>none</dfn>
781
787
:: No perspective transform is applied. The effect is mathematically similar to an infinite <<length>> value. All objects appear to be flat on the canvas.
782
788
@@ -901,8 +907,11 @@ In the following <dfn export>3d transform functions</dfn>, a <<zero>> behaves th
:: specifies a <a href="#PerspectiveDefined">perspective projection matrix</a>. This matrix scales points in X and Y based on their Z value, scaling points with positive Z values away from the origin, and those with negative Z values towards the origin. Points on the z=0 plane are unchanged. The parameter represents the distance of the z=0 plane from the viewer. Lower values give a more flattened pyramid and therefore a more pronounced perspective effect. For example, a value of 1000px gives a moderate amount of foreshortening and a value of 200px gives an extreme amount. The value for depth must be greater than zero, otherwise the function is invalid.
:: specifies a <a href="#PerspectiveDefined">perspective projection matrix</a>. This matrix scales points in X and Y based on their Z value, scaling points with positive Z values away from the origin, and those with negative Z values towards the origin. Points on the z=0 plane are unchanged. The parameter represents the distance of the z=0 plane from the viewer. Lower values give a more flattened pyramid and therefore a more pronounced perspective effect. For example, a value of 1000px gives a moderate amount of foreshortening and a value of 200px gives an extreme amount.
912
+
913
+
If the depth value is less than ''1px'',
914
+
it must be treated as ''1px'' for the purpose of rendering.
906
915
907
916
908
917
Transform function primitives and derivatives {#transform-primitives}
0 commit comments