Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-geometry] DOMMatrixReadonly stringifier does not stringify all matrix elements. #574

Open
simonwuelker opened this issue Oct 8, 2024 · 1 comment

Comments

@simonwuelker
Copy link

The DOMMatrixReadonly stringifier in the case of a non-2d matrix does not stringify (in Step 4.) m31, m32, m33 and m34. The result is supposed to be a valid CSS matrix3d which requires a 4x4 matrix.

The examples also include all 16 values.

@trusktr
Copy link

trusktr commented Dec 30, 2024

Looks like that might just be an oversight in the spec. All browsers return a 16-number matrix3d, and my polyfill does too although I didn't notice that missing detail (I assumed to return the 16-number matrix).

This is what I see in browser consoles:

console.log( new DOMMatrix().rotateSelf(10, 20, 30).translateSelf(1, 2, 3).toString() )
// "matrix3d(0.8137976813493738, 0.46984631039295416, -0.3420201433256687, 0, -0.44096961052988237, 0.8825641192593856, 0.16317591116653482, 0, 0.37852230636979245, 0.01802831123629725, 0.9254165783983234, 0, 1.0674253793989865, 2.2890594826206168, 2.7605814142023712, 1)"

which has 16 numbers.

I'm guessing a pull request may be accepted to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants