[webkit-dev] Accessing WebKit JS binding classes from non-WebKit JavaScript Core applications?

Josh Shagam Joshua.Shagam at am.sony.com
Tue Apr 27 15:44:34 PDT 2010


Hi, I'm working on a project which makes use of JavaScriptCore as a 
scripting engine outside of WebKit.  It would be very helpful to us if 
we could get access to the DOMParser and XMLSerializer classes which are 
in WebKit's DerivedSources area.  However, it seems that those libraries 
are using JavaScript Core's internal/private API (JSC::ExecState, 
JSC::Value, etc.) rather than the public interface expected by external 
users of JavaScript Core.

We'd also like to avoid pulling in the internal WebKit headers anyway, 
as this would complicate our build system (for example, we'd like to be 
able to do this just using the header files provided by Ubuntu's 
libwebkit-dev package).  I'm fine with writing forward-declaration 
classes and stub methods for the purpose of letting the C++ linker 
figure it all out, but JSC::JSValue seems to get in the way of this 
idea, since the getConstructor() methods on the libraries we want return 
it by value rather than by reference (and it doesn't appear to be a 
simple reinterpret_cast like it is for the other public-API classes).

Is there some official way that we can get at WebKit's DerivedSources 
library functionality in a non-WebKit JavaScript Core application, or 
can anyone think of some tricky-but-relatively-clean way to do it that 
doesn't involve our app having to see JSC's internal API?

Thanks in advance.




More information about the webkit-dev mailing list