[Webkit-unassigned] [Bug 40278] [EFL] EFLWebKit doesn't support viewport meta tag

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 24 21:14:45 PDT 2010


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





--- Comment #40 from Gyuyoung Kim <gyuyoung.kim at samsung.com>  2010-06-24 21:14:44 PST ---
(In reply to comment #39)
> (From update of attachment 59719 [details])
> >Index: WebKit/efl/EWebLauncher/main.c
> >===================================================================
> >--- WebKit/efl/EWebLauncher/main.c	(revision 61229)
> >+++ WebKit/efl/EWebLauncher/main.c	(working copy)
> >@@ -47,6 +47,9 @@
> > 
> > #define DEFAULT_WIDTH      800
> > #define DEFAULT_HEIGHT     600
> >+#define DEFAULT_ZOOM_INIT  1.0
> >+#define DEFAULT_ZOOM_MIN   1.0
> >+#define DEFAULT_ZOOM_MAX   1.0
> 
> Suppose the following scenario:
> 1. The function on_viewport_changed() is implemented by browser to cover the case in which there's a viewport meta tag. 
> 2. You go to a website that doesn't use the tag;
> 3. As WebKit always sends the notification about viewport (even if the meta tag doesn't exist), a notification will arrive with all fields == -1.0.
> 4. At that time the browser will call on_viewport_changed() and you will set 
> +    if ((int)initScale == -1)
> +        initScale = DEFAULT_ZOOM_INIT;
> +    if ((int)minScale == -1)
> +        minScale = DEFAULT_ZOOM_MIN;
> +    if ((int)maxScale == -1)
> +        maxScale = DEFAULT_ZOOM_MAX
> 
> 5. What happens now if browser tries to zoom in and call ewk_view_zoom_set()?
> 
> +    if (zoom > priv->settings.zoom_range.max_scale) {
> +        WRN("zoom level is > %f : %f", (double)priv->settings.zoom_range.max_scale, (double)zoom);
>          return EINA_FALSE;
>      }
> 
> But:
> maxScale == DEFAULT_ZOOM_MAX == 1.0
> 
> Bang! Browser can't zoom in anymore. With the same reasoning, it can't zoom out neither. This is why you have to set ZOOM_MIN and ZOOM_MAX to the same values of webkit or add the proper APIs as I've suggested.

Browser can zoom in / out in that case. the on_viewport_changed() just receives arguments of viewport. Browser should call the functions below in order to adjust viewport tag.

 87 +/**
 88 + * This is en example function to adjust viewport via viewport tag's arguments.
 89 + * Application can invoke this function in order to adjust viewport tag when it is required.
 90 + */
 1 +static void
 92 +viewport_set()
 93 +{
 94 +    ELauncher *app;
 95 +    app = (ELauncher*) eina_list_data_get(windows);
 96 +
 97 +    ewk_view_fixed_layout_size_set(app->browser, app->viewport.w, app->viewport.h);
 98 +    ewk_view_zoom_set(app->browser, app->viewport.initScale, 0, 0);
 99 +    if (!ewk_view_zoom_range_set(app->browser, app->viewport.minScale, app->viewport.maxScale))
100 +        info(" Fail to set zoom range. minScale = %f, maxScale = %f\n", app->viewport.minScale, app->viewport.maxScale);
101 +    ewk_view_user_scalable_set(app->browser, app->viewport.userScalable);
102 +}

If browser doesn't invoke ewk_view_zoom_range_set(), ewk_view_user_scalable_set(), viewport is not adjusted. So, browser can zoom in / out. I made an example function (viewport_set()) to show how to adjust viewport meta tag. If browser doesn't want to adjust viewport, it doesn't invoke ewk_view_zoom_range_set(), ewk_view_user_scalable_set().


> +    if (zoom > priv->settings.zoom_range.max_scale) {
> +        WRN("zoom level is > %f : %f", 

By default, the zoom_range.max_scale / min_scale is set as ZOOM_MIN(0.5) / ZOOM_MAX(4.0) defined in ewk_view.cpp

313 +    priv->settings.zoom_range.min_scale = ZOOM_MIN;
314 +    priv->settings.zoom_range.max_scale = ZOOM_MAX;

Do you mean we should set the DEFAULT_ZOOM_MAX as 4.0 in EWebLauncher/main.c ?

-- 
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