[Webkit-unassigned] [Bug 77337] [EFL] Refactor ewk_js files.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Feb 1 07:54:30 PST 2012


--- Comment #3 from Raphael Kubo da Costa <kubo at profusion.mobi>  2012-02-01 07:54:29 PST ---
(In reply to comment #1)
> I have put cq- due to that this patch was not tested due to there is not clear information how to use ewk_js API.

Unfortunately, the whole ewk_js API is... not very well-thought, to put it in mild terms. The fact that it has no clear documentation makes it even worse.

> I will be very grateful for information about how to use js API.

Here's a very short explanation: I don't know how familiar you are with it, so let's start from the very beginning. The code is used to inject custom JavaScript objects in web pages. You use an Ewk_JS_Class_Meta to define what the object looks like (what methods it has, what attributes can be accessed etc). You then use ewk_js_object_new with the metaclass definition to create an Ewk_JS_Object that can later be injected into a view with ewk_view_js_object_add with a given name. This makes the object available inside the page like any other JS object; if you call a method or try to access a property you have defined, the respective callbacks are called etc. Note it currently makes sense to call ewk_view_js_object_add() only after "js,windowobject,clear" has been emitted, otherwise your object will be wiped from the page when the signal is emitted.

Anyway, this is patch is a nice step towards at least making the code more readable. In the future, it will need a complete rewrite, though.

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