This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
From the F2F, dbaron mentioned that we should clarify that the units the entries in matrices are CSS pixels.
Created attachment 1086 [details] Intended rendering (with opacity: 0.5)
Comment on attachment 1086 [details] Intended rendering (with opacity: 0.5) (attached to wrong bug thanks to confusing bugzilla behavior)
I'm not sure how to word this. Should the wording be in the section that describes the matrix() function? Should it say that the last two parameters are in CSS pixel units? What do we write for matrix3d()?
What about: "Length units in matrices are in CSS pixels." on the general description in the "mathematical description"? Do we have to clarify which units are used for rotations/skews on matrices as well?
The units for matrix() and matrix3d() aren't all pixels. For matrix(), the first four entries are unitless and the last two are in pixels. For matrix3d(), entries 0-2, 4-6, 8-10, and 15 (0-indexed) are unitless; entries 12-14 have units of pixels; and entries 3, 7, and 11 have units of 1/pixels. I.e., [ # # # px] [ # # # px] [ # # # px] [1/px 1/px 1/px # ] where # is a unitless number. I don't think we need to say this explicitly. Instead, we should say how the matrices are used to transform coordinates, and make it clear that the input and output coordinates are in pixels. The units of the matrix entries will follow from that without having to introduce confusing and unhelpful stuff like 1/px explicitly.
(In reply to comment #5) > I don't think we need to say this explicitly. Instead, we should say how the > matrices are used to transform coordinates, and make it clear that the input > and output coordinates are in pixels. The units of the matrix entries will > follow from that without having to introduce confusing and unhelpful stuff like > 1/px explicitly. I fully agree. Introducing units for matrices, just to clarify how they are supposed to work is more confusing. But it is more than pixels. How does a matrix reflect a rotation or skewing that use <angle>?
The definition of the matrices for the rotate and skew functions use sin(), cos(), and tan(), which convert angles into pure numbers for use in the pure-number entries of the matrix (the upper left 2x2 or 3x3 block).
(In reply to comment #7) > The definition of the matrices for the rotate and skew functions use sin(), > cos(), and tan(), which convert angles into pure numbers for use in the > pure-number entries of the matrix (the upper left 2x2 or 3x3 block). That means that the matrix operates on degrees, no? Can you phrase a proposal?
No, it means some functions take angles as arguments, and those functions are equivalent to matrices. Not sure what you mean. I think this is best fixed after bug 15605. Once we fix that, we just need to tweak the wording to make it clear that the units of the two-dimensional input and output vectors are in CSS pixels, and then everything is unambiguous.
After reading the discussion on this bug, I still think a normative phrase is simpler and still more exact then adding a matrix with px and 1/px. "" One translation unit on ''matrix()'' and ''matrix3d()'' is equivalent to 1 pixel in the local coordinate system of the ancestor element. "" I don't think that we need too mention 1/pixel, since it falls out of the calculation. The text to perspective already describes the relation to translation values. See "3D rendering context"[1]. Any concerns? Otherwise I add it to matrix on the mathematical description section. [1] http://dev.w3.org/csswg/css3-transforms/#transform-3d-rendering
Added the sentence in the mathematical section but used the coordinate system of the element, not the parent. Was wrong from me.