[webkit-help] how to implement event listener

上田耕一 uedakoui at fsi.co.jp
Wed Oct 9 11:03:57 PDT 2013


Dear Ryosuke Niwa

Thank you for precise advice.
I succeeded in reading "Struct" by using "Dictionary".
However, I do not succeed in reading "Struct" in "Struct".
"aaa" of the following sample is readable, but does not understand a method
to read "bbb".
Please tell me if I know a method to read "Struct" in "Struct".

-----------------
HTML

var param = {
yyy : {
bbb : 1,
},
aaa : 0x006,
};
xxxEvent.boolean addXXXEventListener( param, firedeve);

-----------------

thasks
koichi



2013/10/9 Ryosuke Niwa <rniwa at webkit.org>

> 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, 上田耕一 <uedakoui at 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 at lists.webkit.org
>> https://lists.webkit.org/mailman/listinfo/webkit-help
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20131010/e044490c/attachment.html>


More information about the webkit-help mailing list