Thanks for the reply.

To clarify, it¹s the external process generating an event representing the
process¹ completion status that I want to dispatch into a DOM target.  I
understand that I can simply add and event listener to a DOM element,
however if I want my custom event handler to be an attribute of a DOM
element, then I¹m assuming that I need to a) create a custom DOM attribute
that b) implements the EventTarget interface.  My external code then
dispatches it¹s custom event to my custom attribute/eventTarget.  This would
then allow my HTML markup to be of the form:

    <div onMyExternalProcessComplete=function()>

I¹m not saying that this is necessarily the best way to accomplish this, but
am just trying to understand how everything is connected within the webkit
framework. However, if my understanding is correct, then what is the best
way to add a custom attribute/eventTarget into the DOM?

thanks again for the insights,
Ross


On 4/8/09 4:10 AM, "ZHOU Xiao-bo" <[email protected]> wrote:

> " external code to be able to dispatch custom events "
> you mean that your c++ code can be triggered by a custom event or your code
> can
> generate a custom envent?
> 
> if former, I think you should implement your own onxxx attribute, and add some
> eventlisteners;
> if latter, maybe you can add your own eventlistener to some node and create an
> event and call 
> handlelocalevent 
> 
> 2009/4/8 Ross Lillie <[email protected]>
>> I have external C++ code that I'm exposing to the JavaScript runtime.  I'd
>> also like my external code to be able to dispatch custom events via the DOM
>> event mechanism.  For example
>> 
>>     <element onMyCustomEvent=function() {}>
>> 
>> Now, if I'm beginning to understand Webkit (which is doubtful) it seems that
>> I need to somehow create a new attribute node that's wired to my external
>> code and serves as the EventTarget for event dispatches.  I.e. somewhat
>> similar to how this is described for Mozilla/Gecko
>> 
>> The public interfaces in WebKit don't appear to provide the functionality I
>> need.  The private interfaces in WebCore appear that they might.  Am I on
>> the right track?
>> 
>> If so, how are new elements added to the DOM?  Is this the function of the
>> NamedNodeMap, or am I completely lost in my understanding?  Also, I'm
>> assuming any custom event must also be registered somewhere.
>> 
>> Thanks in advance for any insight or pointers to more information.
>> Ross
>> 
>> 
>> _______________________________________________
>> webkit-dev mailing list
>> [email protected]
>> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
> 
> 

------ End of Forwarded Message

_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to