On Apr 9, 2009, at 2:40 AM, Tony Louaze wrote:

I want to add a custom event into Webkit without modify and compile Webkit.

It all depends what you mean by a custom event. If you want to send an event with a special name but no special data attached, you can do this easily with standard DOM API.

In JavaScript it would be something like this:

    var event = document.createEvent("Events");
    event.initEvent("specialName", false, false);
    target.dispatchEvent(event);

On which object should I make the "addEventListener" : a custom JS object or an existing DOM object (which one ?) ?

You can send an event to any event target object, which can be any DOM node or other type of object, and the listener would need to be attached to that object, the one you send the event to. Your question isn’t specific enough.

For now, I'm just interracting with JS context by using the Webkit.dll API.

WebKit DOM bindings for JavaScript and for Objective-C on Mac OS X are mostly complete; the ones done with COM on Windows are enough for Safari but are incomplete, and are likely missing some things you’d need to deal with custom events.

    -- Darin

_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to