Re: [web-animations] Readonly interfaces and inheritance: seeking advice

On Mon, Jul 14, 2014 at 5:25 PM, Cameron McCormack <cam@mcc.id.au> wrote:
> On 15/07/14 10:12, Tab Atkins Jr. wrote:
>> I'm currently using a dictionary for an attribute in the CSS Color
>> spec, too: <http://dev.w3.org/csswg/css-color/#api-RGBColor>
>>
>> We should figure out what to do about this.
>
>
> The current leading plan is to enable dictionary-typed attributes using
> something like Gecko's [Cached] extended attribute, which indicates that the
> same value keeps getting returned until something explicitly invalidates it,
> after which getting the attributes will return a newly constructed
> dictionary value.  Not sure about the IDL syntax yet (or really whether it
> should be a separate concept from "dictionaries", since dictionaries are
> currently (abstractly) pass-by-value structures but what we want here is a
> reference to an object with a particular structure).

If it helps, all I want here is a way to easily cluster attributes
together.  My case would work just as well if all the stringifiers
were just attributes on the interface, but for convenience and
idiom-matching, they're in a sub-object.  I could also just give it a
type of "object" and describe its value in prose, but I like using a
dictionary because expressing it in IDL is easier and clearer than in
prose, and it gives me type-checking for free.

Other people probably have more complicated needs.

~TJ

Received on Tuesday, 15 July 2014 01:43:38 UTC