[webkit-dev] Javascript and WebCore

Brent Fulgham bfulgham at gmail.com
Sun Oct 25 19:00:06 PDT 2009


On Oct 25, 2009, at 4:09 PM, Maciej Stachowiak wrote:

> If you really want to come up with something, then I think your best  
> bet would be to declare the scripting language for event listeners  
> using an explicit mechanism. One possible way is to define a meta  
> keyword so you could say <meta name="event-listener-language"  
> content="application/x-fooscript">. That has the downside of being  
> global for the whole document, so you would not be able to mix  
> inline event listeners in both languages. It has the benefit that  
> you won't misinterpret any existing Web content, but the downside  
> that Web pages using the new scripting language may fail in  
> mysterious ways (instead of just not running their scripts).

I think this is the approach taken by the Titanium project (http://www.appcelerator.com/appcelerator-platform/titanium-architecture/ 
), which allows development using Python, PHP, Ruby, etc.  See for  
example the snippets on their 'codestrong' development site (http://www.codestrong.com/titanium/tutorials/hello-world/?rev=21 
), with constructs like:

<script type="text/javascript"> ... javascript stuff ... </script>
<script type="text/python"> ... python stuff ... </script>

It looks like these can be used to define event listeners as well as  
preparing display content.

There are some core Titanium developers who hang out on IRC and the  
mailing lists who could probably provide better details.

They apparently have some patches to WebKit they will be submitting  
formally at some point (though they are all available in their git  
repository) that provide the language-agnostic support.

-Brent


More information about the webkit-dev mailing list