Re: [css-houdini-drafts] [css-typed-om] Describe what setting is2D on CSSTransformComponent should do

> Oh, so the getters should still return "3d" values for the transform, even when the component is set to being 2D? So you can set things, and see that they've been set, but they don't get applied. Isn't that potentially confusing for authors?

Yes, yes, and potentially yes, but the alternatives were more confusing and/or had very bad ergonomics.  For example, say that when is2D is set, we replace the 3d components with appropriately "null" objects, and ignore any writes to those values. But the values are objects themselves in some cases, like `CSSTranslation.z`, where it's a CSSUnitValue - we'd have to somehow communicate to *that* object that it should ignore writes as well.  That requires either a hidden flag that I check in all the algorithms, or a parallel object hierarchy of silently-readonly objects.

> Oh, and for CSSTransformValue, if all the contained components have is2D set to true, should toMatrix still return the 3D matrix?

The spec says that it multiplies their "equivalent 4x4 transform matrix"es.  This should change based on whether it's 2d or not, just like the serialization does; I should put in a note making that clearer.  Then I need to see if DOMMatrix automatically gets is2D set correctly for this case; if not, I'll need an explicit check for it.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/414#issuecomment-310466765 using your GitHub account

Received on Thursday, 22 June 2017 18:40:04 UTC