W3C home > Mailing lists > Public > www-style@w3.org > November 2011

[css-variables] Extending the CSSStyleDeclaration interface in IDL

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 10 Nov 2011 14:48:44 -0800
Message-ID: <CAAWBYDCqeC-ziRRdZwOignmJXz__U8kH50SHbZ8ZPg6BhZjHLA@mail.gmail.com>
To: www-style list <www-style@w3.org>, Cameron McCormack <cam@mcc.id.au>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:46 GMT