[webkit-dev] Calling JavaScript function from within DumpRenderTree

Maciej Stachowiak mjs at apple.com
Sat Jan 2 01:34:00 PST 2010

On Jan 1, 2010, at 9:25 PM, Sam Weinig wrote:

> That said, a more javascripty way to do this would be to pass the  
> function object to liveRegion.addNotificationListener itself.  That  
> way, in the test file, you would have,
> liveRegion.addNotificationListener(function(notification) {
>    // do stuff with notification
> });
> In the implementation of addNotificationListener, you would save the  
> function object off instead of saving off the string, and then call  
> it in _accessibilityNotificationCallback.

I would recommend doing it this second way. Note that with this  
approach you can still declare the function up front, and just pass  
the name, but you wouldn't pass it with a string.

  - Maciej

More information about the webkit-dev mailing list