[css-houdini-drafts] [css-typed-om] What to do with a 2d CSSMatrixComponent set to a 3d DOMMatrix?

tabatkins has just created a new issue for https://github.com/w3c/css-houdini-drafts:

== [css-typed-om] What to do with a 2d CSSMatrixComponent set to a 3d DOMMatrix? ==
Our new direction for separating 2d vs 3d transform values (a flippable is2D switch, that ignores sets to the 3d-related attributes when it's true) works great for most of the transform subclasses.  But CSSMatrixComponent is a little trickier, because it's 3d-related attributes are in a sub-object (its `.matrix` attribute), which we don't have direct control of.

So, what to do here when `is2D` is true?

One possibility is to enforce 2d-ness: on set, set the internal slot's matrix to reflect *just* the 2d indexes of the supplied matrix; on get, return a DOMMatrix reflecting just the 2d indexes of the internal slot's matrix.

Or we can make this one special and implicit - on set, if the matrix is 3d, silently set the `is2D` flag to false as well; on get, if `is2D` is true, return a matrix with only the 2d indexes of the internal slots' matrix.

Or we can be closer to the other objects - on set, if `is2D` is true and the matrix is 3d, do nothing; on get, if `is2D` is true, return a matrix with only the 2d indexes of the internal slot's matrix.  This might be a little harsher, tho.

Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/366 using your GitHub account

Received on Wednesday, 8 March 2017 00:27:46 UTC