[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 11:14:26 PDT 2010


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


Lucas De Marchi <lucas.demarchi at profusion.mobi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1




--- Comment #36 from Lucas De Marchi <lucas.demarchi at profusion.mobi>  2010-06-24 11:14:25 PST ---
>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 ZOOM_INIT          1.0
>+#define ZOOM_MIN           1.0
>+#define ZOOM_MAX           1.0

You should not define those here. Instead, they have to come from WebKit.

>+    if (!ewk_view_zoom_range_set(app->browser, app->viewport.minScale, app->viewport.maxScale))
>+       info(" Fail to set zoom range. minScale = %f, maxScale = %f\n", app->viewport.minScale, app->viewport.maxScale);

Problem with style. Use 4 spaces.

>@@ -345,6 +375,48 @@ on_tooltip_text_set(void* user_data, Eva
>         info("%s\n", text);
> }
> 
>+/**
>+ * "viewport,changed" signal will be always emitted regardless of the viewport existence. 
>+ *
>+ * If you don't want to process the viewport tag, you can either do nothing in this callback
>+ * or simply ignore the signal in your application.
>+ * 
>+ * More information about this can be found at http://developer.apple.com/safari/library/docum
>+ * entation/appleapplications/reference/safariwebcontent/usingtheviewport/usingtheviewport.html
>+ */
>+static void
>+on_viewport_changed(void* user_data, Evas_Object* webview, void* event_info)
>+{
>+    ELauncher *app = (ELauncher *)user_data;
>+   

There are several trailing white spaces. Although WebKit does not prohibit
them, we try to avoid them. Please, remove.

>+    float w, h, initScale, minScale, maxScale, userScalable;
>+
>+    ewk_view_viewport_get(webview, &w, &h, &initScale, &maxScale, &minScale, &userScalable);
>+
>+    /**
>+     * If there is no argument in viewport tag, argument's value is -1.
>+     */
>+    if ((int)w == -1)
>+        w = DEFAULT_WIDTH;
>+    if ((int)h == -1)
>+        h = DEFAULT_HEIGHT;
>+    if ((int)initScale == -1)
>+        initScale = ZOOM_INIT;
>+    if ((int)minScale == -1)
>+        minScale = ZOOM_MIN;
>+    if ((int)maxScale == -1)
>+        maxScale = ZOOM_MAX;
>+    if ((int)userScalable == -1)
>+         userScalable = EINA_TRUE;

Here you have 5 spaces. Use 4, instead. This should be caught by
check-webkit-style. Don't know why it didn't get.

Worse than style issues, as Kenneth noticed, this would not allow to set zoom
if there isn't any meta tag. Either define the constants the same of webkit or,
better, add the proper API to get/set max and min zoom. Although the second is
the desired approach, I understand it would overly complicate this patch you
are submitting. Therefore, it would suffice if you submit the first one.



Please, consider also the other comments from Kenneth.

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