WebKit's code generator doesn't support automatically converting a dictionary-like JS object to a struct. You have to use Dictionary as the argument type and manually access each property in the object. See Source/WebCore/MutationObserver.idl/cpp for an example.
- R. Niwa On Tue, Oct 8, 2013 at 4:57 AM, 上田耕一 <uedak...@fsi.co.jp> wrote: > Hello everyone. > > In its own browser that works on Windows, I have customized Webkit. > I am trying to add an EventListener own. > It is a "Struct" is one of the input parameters. > not receive correctly the "Struct" addXXXEventListener is a sample file > below. I believe that IDL wrong is written is either not the cause. > Because I do not understand how to write WebkitIDL, I do not know how to > make EventListener with a "Struct" in the input. > I do not know the method to be added to the EventListener. > Someone, please help. > > ----------------- > HTML > > var param = { > yyy : { > aa : 0, > bb : 1, > cc : 2, > dd : 3, > ee : 4, > ff : 0x50, > gg : "hoge", > hh : "hoge2" > }, > aaa : 0x006, > bbb : 7, > ccc : 255 > }; > xxxEvent.boolean addXXXEventListener( param, firedeve); > > ----------------- > IDL > > interface [ > OmitConstructor > ] xxxEvent { > > [Custom] boolean addXXXEventListener( > in XXXParam param, > in EventListener listener); > [Custom] boolean removeXXXEventListener( > in XXXParam param, > in EventListener listener); > }; > > interface [ > InterfaceName=XXXParam > ] XXXParam { > readonly attribute YYYparam yyy; > > attribute unsigned short aaa; > attribute unsigned short bbb; > attribute unsigned short ccc; > }; > > interface [ > InterfaceName=YYYparam > ] YYYparam { > attribute unsigned short aa; > attribute unsigned short bb; > attribute unsigned short cc; > attribute unsigned short dd; > attribute unsigned short ee; > attribute unsigned short ff; > attribute DOMString gg; > attribute DOMString hh; > }; > ------------------ > > > Thanks, > kichi > > _______________________________________________ > webkit-help mailing list > webkit-help@lists.webkit.org > https://lists.webkit.org/mailman/listinfo/webkit-help > >
_______________________________________________ webkit-help mailing list webkit-help@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-help