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

What do we all think of DOMMatrix? #134

Closed
toji opened this issue Oct 23, 2016 · 3 comments
Closed

What do we all think of DOMMatrix? #134

toji opened this issue Oct 23, 2016 · 3 comments

Comments

@toji
Copy link
Member

toji commented Oct 23, 2016

This has been brought up in the past, but I've recently received new feedback within the Chrome org that we should be using DOMMatrix instead of flat Float32Arrays for anywhere in the spec that needs a matrix. We've had this conversation before, but one of the arguments is usually that it doesn't seem close to shipping and I've heard that the Chrome implementation is at least close, so it's worth going over one more time if we're looking at making some breaking changes anyway in 1.2. Also, the last go around we didn't have Microsoft's input and I don't know where they stand on the DOMMatrix spec.

Some concerns off the top of my head:

  • First and foremost, I don't know where browser support is at. Firefox advertises support in v33 here but I think the spec has changed since? Can't find anything about it on the Edge platform status page which is probably a bad sign. Chrome's platform status is a bit ambiguous but the launch bug has activity within the last few days.
  • To pass into WebGL it'll require getting a Float32Array out anyway. DOMMatrix has a function to do that, but it's a copy, and that's on top of the assumed data copy to get into the interface in the first place.
  • Don't think it works in workers yet, and out latest proposed round of breaking changes is entirely about worker support.

On the positive side:

  • If they do end up implemented everywhere it will look a bit odd for us to not use them 2+ years down the line.
  • They provide a lot of commonly needed functions that dev would otherwise rely on a library for. (Though certainly not a comprehensive set.)

So... thoughts? From my perspective it's totally fine to say "We'd rather not because XYZ", I just want to make sure we're not passing up on something for historical reasons that everyone thinks is a good idea.

@RafaelCintron
Copy link

In talking with our standards folks, there is a desire amongst the working groups to replace SVGMatrix and CSSMatrix with DOMMatrix. Edge does not have immediate plans to implement DOMMatrix.

I agree with @toji concerns about data copying of the Float32Array out of DOMMatrix so that it can be passed to WebGL. The same thing would happen for matrix libraries web developers use. Unless WebGL and the matrix libraries support DOMMatrix natively, using it for WebVR seems like it would create more problems than it solves.

@mkeblx
Copy link
Contributor

mkeblx commented Nov 2, 2016

Would the eventual addition of CSS VR have any strong bearing on this?

@toji
Copy link
Member Author

toji commented Jan 11, 2017

Brought this up at the WebVR F2F in Kirkland. There's not a strong desire to make DOMMatrix part of the spec today, but we may evaluate changes separately that make the VRFrameData more easily extended to account for this in the future.

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

3 participants