Re: [css-houdini-drafts] [css-typed-om] Does the is2D design allow for inconsistent interpretation of CSSTransformComponents?

Sigh, while writing up the context for <https://github.com/w3c/fxtf-drafts/issues/255>, I remembered the other reason I rejected this approach originally.  The problem of "sub-objects are mutable" applies to more than just DOMMatrix, it affects *all* of the 3d-relevant attributes.  It's all well and good if I automatically replace the contents of `CSSTranslate.z` with a fresh `CSS.px(0)` object when you set `is2D` to `true`, but right now nothing stops you from just saying `trans.z.value = 5` and making it look 3d again.

To fix this, I need to either create a parallel `CSSUnitValueReadOnly` class (and, I guess, automatically replace it with a standard `CSSUnitValue` when `is2D` is set back to `false`), or give `CSSUnitValue` an internal readonly flag that causes the object to ignore any attempt to set its value, and toggle that on/off when you switch `is2D`.

Neither approach seems particularly fun to me, and we're still stuck with the fact that to apply the WG's intention, `DOMMatrix` *also* needs to do something like this (but with more complexity).  I'd still like to push back on this and just resolve to go with the original "who cares what's in the 3d-relevant attributes" approach. I settled on it for a reason (which I wish I'd remembered in more detail at the start of this issue). :/

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

Received on Friday, 16 February 2018 20:40:09 UTC