Re: [css-houdini-drafts] [css-typed-om] Setting list-valued properties to var() refs.

I can go either way on this. If we do reify it only as a single CSSUnparsedValue, then we need to reject at set-time if you try and set the property to contain a CSSUnparsedValue along with anything else.

But if we do stick with what I said before...

> In CSSOM, I think you can set something to var(--A), bleh. If you reify that, you probably get a CSSUnparsedValue(CSSVariableReference('--A')) and a CSSKeywordValue('bleh'). The latter is invalid for that property. I think this breaks roundtripping, but not sure if that's bad tho.

Yes, you can set a property to that in CSSOM.  I see your argument about it breaking round-tripping, as we'll throw an error when you try to set the CSSKeywordValue.

> If you do styleMap.set(.., CSSUnparsedValue([--A, ',', --B])), does that CSSUnparsedValue get "parsed" and split into two smaller ones? And how do we make this consistent (if we want to) with styleMap.set(..., "var(--A), var(--B)")?

I'd assume no. In your latter point, your call would be invalid; you can't just set a string directly, you need to parse it.

> CSSOM seems to accept stuff like var(--A),,,,what, but does that make sense to reify as separate items?

Yes, it's correct for CSSOM to accept that. And yeah, it's troubling to think about what we would reify it as.

---------

Okay, you've convinced me. Any var() makes the whole thing a CSSUnparsedValue, and I'll add some checks to set/append to make sure we don't violate that.

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

Received on Thursday, 1 March 2018 22:38:39 UTC