[webkit-efl] ewk_view settings implementation

Raphael Kubo da Costa rakuco at webkit.org
Mon Apr 9 22:20:17 PDT 2012


"Pozdnyakov, Mikhail" <mikhail.pozdnyakov at intel.com> writes:

> Hello,
>
>  I am implementing now LayoutTestController::overridePreference method for EFL
> https://bugs.webkit.org/show_bug.cgi?id=83007.
>
> I've noticed that each ewk_view related setting (web preference) is currently present in ewk_view as a separate function (see functions starting with ewk_view_setting_... )
>
> In order to implement LayoutTestController::overridePreference I will need to add more ewk_view_setting_ functions to the ewk_view (as not all the settings are present there). That will affect the existing API and
> will look quite ugly.
>
>  Don't you think it would be better to have two common methods (getter and setter) for all the web preferences like :
>
> Eina_Bool  ewk_view_setting_set(Evas_Object *o,  const char* property,  const Eina_Value* value );
> and
> Eina_Bool ewk_view_setting_get(const Evas_Object *o,  const char* property,  Eina_Value* value );
>
> I could do such refactoring  within the  bug83007.
>
> Could  you  please tell  your opinion about my proposal?

API breakages aside, the idea sounds appealing, but the proposed
function signatures could be improved: the biggest risk I see with
switching from separate function calls to passing the property name as a
string is that you also switch from compile-time checks (for property
name typos, for example) to run-time checks. Have you thought of using
an enum instead for properties?

Bear in mind that you'll probably need to bump the Eina revision in
jhbuild.modules if you do plan on using Eina_Value (and there's been no
stable revision with it yet).



More information about the webkit-efl mailing list