[webkit-dev] XML Events in WebKit

Maciej Stachowiak mjs at apple.com
Fri Dec 7 15:06:48 PST 2007


On Dec 7, 2007, at 8:53 AM, Antoine Quint wrote:

> Hi,
>
> On 7 déc. 07, at 17:38, David Hyatt wrote:
>
>> Yeah, they don't seem particularly compelling to me either.
>>
>> If someone does implement these, they should put the implementation  
>> behind an #ifdef so that those projects that aren't interested in  
>> them can turn them off.
>
> XML Events basically come in handy when you want a generic markup- 
> based way to add event listeners for custom events. For instance, if  
> XBL was implemented in WebKit, and I had my own custom magic UI  
> control implemented with some custom XML element, I'll likely want  
> to fire custom DOM Events, and XML Events would be a neat way for  
> users of my widget to listen to some of these custom events without  
> resorting to a purely script-based approach using addEventListener().

XML Events doesn't seem terribly compelling to me, because event  
handling about running script, so avoiding use of script to define  
event handlers isn't hugely compelling. And on the other hand, it's  
much more verbose for very simple cases than "onkeypress"/"onclick"/ 
etc style event listener attributes.

Furthermore, the current trend among web developers is to attach all  
event handlers separately in script ("unobstrusive JavaScript"), so  
XML Events seems to be going in the wrong direction by putting more  
event listeners back in the markup.

> It's a lot of ifs, but if WebKit ever supports XBL and custom DOM  
> Events, then it'd be worth re-thinking the usefulness of XML Events  
> in WebKit.


I think XBL bindings could support onwhatever style attributes if they  
want to make simple cases easy for their custom events.

Regards,
Maciej




More information about the webkit-dev mailing list