[webkit-dev] Add custom event into Webkit

LOUAZE Tony Ext VIACCESS-DOS T.LOUAZE.ext at viaccess.com
Fri Apr 10 01:26:11 PDT 2009


Hi,

It seems Ross and I have the same problem.

Of course, we can call a JS function from external code by using Webkit API.
But it's not the proper way to implement events in JS.

I'd like to use the AddEventListener("on_special_event", on_event) method to add my custom event "on_special_event".
And I need to attach special data to the event :

function on_event( event) {
	var v = event.mydata...
}

But Darin told us about "incomplete DOM bindings for windows"...
Furthermore it seems difficult to recompile Webkit on windows, even with cygwin.

Tony LOUAZE
Software Engineer Viaccess
T +33 1 44 45 64 91

-----Message d'origine-----
De : Darin Adler [mailto:darin at apple.com] 
Envoyé : jeudi 9 avril 2009 18:16
À : Ross Lillie
Cc : LOUAZE Tony Ext VIACCESS-DOS; webkit-dev at lists.webkit.org
Objet : Re: [webkit-dev] Add custom event into Webkit

On Apr 9, 2009, at 9:11 AM, Ross Lillie wrote:

> The next piece of the puzzle, however, is dispatching events  
> generated by my
> external code into the Javascript/DOM environment.  These events  
> ideally
> require special data to be attached.  From my admittedly limited
> understanding of WebKit internals, it would appear that I can't do  
> this
> without bypassing the public interfaces.

If the special data only needs to be seen by JavaScript code, you can  
just add JavaScript properties to the event object. With the Mac OS X  
DOM bindings a clean way to do this is by taking the Objective-C DOM  
object and calling the JSObject method, giving you a JSObjectRef that  
you can then use to add additional properties to.

     -- Darin



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

"Privileged/Confidential information may be contained in this e-mail 
and attachments. This e-mail, including attachments, constitutes non-public information intended to be conveyed only to the designated recipient(s). If you are not an intended recipient, please delete this e-mail, including attachments, and notify us immediately. The unauthorized use, dissemination, distribution or reproduction of this e-mail, including attachments, is prohibited and may be unlawful. In general, the content of this e-mail and attachments does not constitute any form of commitment by VIACCESS SA."

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




More information about the webkit-dev mailing list