[css-variables] Extending the CSSStyleDeclaration interface in IDL

I just logged an issue on the Variables spec about the necessary
extensions to the CSSStyleDeclaration interface (the object that's
returned from el.style and getComputedStyle(el) ).  I'd appreciate
some help in figuring out how to express what I want in WebIDL.

The set of data properties is unbounded, so it's impossible to naively
just add all of them to the interface like we've done so far.  I
suspect that what we'll have to do is define a named property
getter/setter/creator/deleter that handles all the existing properties
and then additionally handles data properties.  Is this right?  The
algorithm would be easy, since all we'd do is define the "camelCase to
dash-separated" algorithm (already defined in HTML for dataset) and
then rely on whether the UA recognizes the property or not.

Additionally, I'd like to expose the set of valid data properties
currently defined on the element.  I'm thinking something like a
'data' member on the interface which is nearly identical to what I
described in the previous paragraph, but the getter only recognizes
valid data properties on the element rather than all properties.

I'm a WebIDL noob.  Help?

~TJ

Received on Thursday, 10 November 2011 22:49:33 UTC