[webkit-dev] Javascript and WebCore

Darin Adler darin at apple.com
Sun Oct 25 11:48:18 PDT 2009


On Oct 23, 2009, at 6:27 AM, Alexander Cohen wrote:

> I've been looking into having WebCore support another scripting  
> language other than Javascript. By going through the code, it seems  
> pretty doable. Then i got to  inline scripts on event handlers and  
> that's where it became a bit more complicated. It seems like  
> JSEventListeners are mixed into normal HTML parsing which makes it  
> really hard to actually add anything without either refactoring that  
> complete section or just hacking it right into it ( checking for the  
> type of script and dispatching to the right class ).

Because of the many hooks added by Google engineers to replace  
WebKit’s own JavaScript engine with their V8 project in Google builds,  
there are already hooks to substitute a different engine every single  
place WebKit interacts with the JavaScript engine, so that should not  
be a problem.

Your question seems to be less about implementation, and more about  
the design. You mention checking the type of script, but how would you  
do that? The syntax is onload="<script>" and the script language is  
JavaScript. In other places in the syntax, such as in script elements,  
the script language is explicit, but in these older legacy places it’s  
not.

Once you decide what you’re trying to do, perhaps I can help you with  
the “how” question. But generally this seems to be a challenging  
project, and I probably won’t be able to help much.

     -- Darin



More information about the webkit-dev mailing list