[Webkit-unassigned] [Bug 116408] [Qt] Support Object construction for window properties added using QtWebKitBridge

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 29 03:13:06 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=116408





--- Comment #6 from Simon Hausmann <hausmann at webkit.org>  2013-05-29 03:11:36 PST ---
We just had a discussion about this.

You could support constructor syntax in your application on the JavaScript side if you wrap the factories in JavaScript itself. We assume that this is something you would like to clean up or simplify by moving everything to the C++ side and eliminating any JavaScript side API wrappers.

More generally speaking the question arises: How do you implement complete JavaScript APIs (that allow for the use of new expressions, function calls where you can access the this object properly, modify/setup the prototype chain, etc.) entirely in C++ without JavaScript wrappers?

I think the _clean_ solution to that requires a full C/C++ API that is powerful enough to allow for all these things. We could advocate the development of a Qt and C++ based API for that (similar to Qt's QtScript API), but I think a simpler solution that requires less effort and is faster (performance wise) would be to give access to the JavaScriptCore C API.

If you have the time and motivation to do the work, I would propose the following approach:

(1) Add API to QWebFrame that returns a JSContextRef for the frame's window object. (this may require forward-declaring JSContextRef)

(2) Modify the build system to give access to the JavaScriptCore C API when using QT += webkit-private in .pro files.


The former should be a relatively simple patch and the latter (which can be a separate patch for sure) may require a little bit more effort, but would complete the solution.

What do you think about that?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list