Re: WebIDL Dictionaries

Hi Robin,

On 7.9.2011, at 22.21, ext Robin Berjon wrote:

> If you feel like hacking this in, here's what I'd do:
> 
>    0) Don't try to support this in the WebIDL code. Instead, make it as a step that runs *after* WebIDL and moves the right parts of the DOM around.
>    1) Figure out a way to specify that a given IDL construct will merge one or more others into itself, e.g. data-merge="BatteryStatusEventInit OtherDictionary YetAnother" on the <dl> defining the interface.
>    2) Grab the generated IDL for each dictionary to be merged, append it to the interface IDL.
>    3) Grab the "Members" section for the dictionary, and append it after the Attributes, Methods, etc. sections (maybe rename it to "Dictionary Foo Members" for clarity).
>    4) Kill the original dictionary section (this may lose some content, you could add what's left to the Member section.
>    5) You should be good, everything else (e.g. definitions linking, section numbering) should just work. Don't blame me if you spend the night on it ;)


I ended up hacking on this after all :)

I tried to implement it as you describe above. The patch works for me with all the relevant browsers, so I committed it. Feel free to review and refactor where necessary. Here's an example of a spec using it:

  http://dev.w3.org/2009/dap/system-info/battery-status.html

-Anssi

Btw. Should I update the ReSpec documentation as well?

Received on Tuesday, 13 September 2011 10:42:11 UTC