[css-houdini-drafts] [css-typed-om-1] Duplicating a CSSVariableReferenceValue is harder than it probably should be

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

== [css-typed-om-1] Duplicating a CSSVariableReferenceValue is harder than it probably should be ==
Say I have a https://drafts.css-houdini.org/css-typed-om-1/#cssvariablereferencevalue and I want to create a "copy" of it.  How do I do that?

    new CSSVariableReferenceValue(myValue)

throws.

    new CSSVariableReferenceValue(myValue.variable, myValue.fallback)

throws if I have no fallback.

    new CSSVariableReferenceValue(myValue.variable, myValue.fallback || undefined)

works, but who would think of doing that?  ;)

Ideally there would be a constructor taking CSSVariableReferenceValue.

In addition to that, the second (optional) ctor arg should perhaps be nullable and default to null....

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

Received on Thursday, 15 February 2018 19:50:48 UTC