[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 14:33:56 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 43fac69081f5fce9f1e34d382557de573ebf8328
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 13 12:14:58 2010 +0000

    2010-10-13  Gyuyoung Kim  <gyuyoung.kim at samsung.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [EFL] Support viewport configuration and add new arguments for WebKit EFL
            https://bugs.webkit.org/show_bug.cgi?id=47084
    
            Opera spec regarding to viewport meta tag was adjusted to WebCore. So, EFL port
            needs to be modified according to the changes.
    
            * WebCoreSupport/ChromeClientEfl.cpp:
            (WebCore::ChromeClientEfl::dispatchViewportDataDidChange):
            * WebCoreSupport/FrameLoaderClientEfl.cpp:
            (WebCore::FrameLoaderClientEfl::dispatchDidCommitLoad):
            * ewk/ewk_private.h:
            * ewk/ewk_view.cpp:
            (_ewk_view_priv_new):
            (_ewk_view_viewport_attributes_compute):
            (ewk_view_viewport_attributes_set):
            (ewk_view_viewport_attributes_get):
            (ewk_view_device_pixel_ratio_get):
            * ewk/ewk_view.h:
    2010-10-13  Gyuyoung Kim  <gyuyoung.kim at samsung.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [EFL] Support viewport configuration and add new arguments for WebKit EFL
            https://bugs.webkit.org/show_bug.cgi?id=47084
    
            Opera spec regarding to viewport meta tag was adjusted to WebCore. So, EFL port
            needs to be modified according to the changes.
    
            * EWebLauncher/main.c:
            (on_viewport_changed):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69650 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/efl/ChangeLog b/WebKit/efl/ChangeLog
index 0479955..a8dfcaf 100644
--- a/WebKit/efl/ChangeLog
+++ b/WebKit/efl/ChangeLog
@@ -1,3 +1,26 @@
+2010-10-13  Gyuyoung Kim  <gyuyoung.kim at samsung.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [EFL] Support viewport configuration and add new arguments for WebKit EFL
+        https://bugs.webkit.org/show_bug.cgi?id=47084
+
+        Opera spec regarding to viewport meta tag was adjusted to WebCore. So, EFL port 
+        needs to be modified according to the changes.
+
+        * WebCoreSupport/ChromeClientEfl.cpp:
+        (WebCore::ChromeClientEfl::dispatchViewportDataDidChange):
+        * WebCoreSupport/FrameLoaderClientEfl.cpp:
+        (WebCore::FrameLoaderClientEfl::dispatchDidCommitLoad):
+        * ewk/ewk_private.h:
+        * ewk/ewk_view.cpp:
+        (_ewk_view_priv_new):
+        (_ewk_view_viewport_attributes_compute):
+        (ewk_view_viewport_attributes_set):
+        (ewk_view_viewport_attributes_get):
+        (ewk_view_device_pixel_ratio_get):
+        * ewk/ewk_view.h:
+
 2010-10-12  Gyuyoung Kim  <gyuyoung.kim at samsung.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
index 01f2131..c06b30d 100644
--- a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
+++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
@@ -519,7 +519,7 @@ void ChromeClientEfl::chooseIconForFiles(const Vector<String>&, FileChooser*)
 
 void ChromeClientEfl::dispatchViewportDataDidChange(const ViewportArguments& arguments) const
 {
-    ewk_view_viewport_set(m_view, arguments.width, arguments.height, arguments.initialScale, arguments.minimumScale, arguments.maximumScale, arguments.userScalable);
+    ewk_view_viewport_attributes_set(m_view, arguments);
 }
 
 bool ChromeClientEfl::selectItemWritingDirectionIsNatural()
diff --git a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
index 61a7894..8d96179 100644
--- a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
+++ b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
@@ -621,7 +621,7 @@ void FrameLoaderClientEfl::dispatchDidCommitLoad()
     ewk_view_uri_changed(m_view);
 
     ViewportArguments arguments;
-    ewk_view_viewport_set(m_view, arguments.width, arguments.height, arguments.initialScale, arguments.minimumScale, arguments.maximumScale, arguments.userScalable);
+    ewk_view_viewport_attributes_set(m_view, arguments);
 }
 
 void FrameLoaderClientEfl::dispatchDidFinishDocumentLoad()
diff --git a/WebKit/efl/ewk/ewk_private.h b/WebKit/efl/ewk/ewk_private.h
index fc973f1..e2624a3 100644
--- a/WebKit/efl/ewk/ewk_private.h
+++ b/WebKit/efl/ewk/ewk_private.h
@@ -102,7 +102,7 @@ WTF::PassRefPtr<WebCore::Frame> ewk_view_frame_create(Evas_Object *o, Evas_Objec
 WTF::PassRefPtr<WebCore::Widget> ewk_view_plugin_create(Evas_Object* o, Evas_Object* frame, const WebCore::IntSize& pluginSize, WebCore::HTMLPlugInElement* element, const WebCore::KURL& url, const WTF::Vector<WTF::String>& paramNames, const WTF::Vector<WTF::String>& paramValues, const WTF::String& mimeType, bool loadManually);
 
 void ewk_view_popup_new(Evas_Object *o, WebCore::PopupMenuClient* client, int selected, const WebCore::IntRect& rect);
-void ewk_view_viewport_set(Evas_Object *o, float w, float h, float init_scale, float max_scale, float min_scale, float user_scalable);
+void ewk_view_viewport_attributes_set(Evas_Object *o, const WebCore::ViewportArguments& arguments);
 
 void ewk_view_download_request(Evas_Object *o, Ewk_Download *download);
 
diff --git a/WebKit/efl/ewk/ewk_view.cpp b/WebKit/efl/ewk/ewk_view.cpp
index 06e8a85..657a085 100644
--- a/WebKit/efl/ewk/ewk_view.cpp
+++ b/WebKit/efl/ewk/ewk_view.cpp
@@ -22,7 +22,7 @@
 #include "config.h"
 #include "ewk_view.h"
 
-#include "appcache/ApplicationCacheStorage.h"
+#include "Chrome.h"
 #include "ChromeClientEfl.h"
 #include "ContextMenuClientEfl.h"
 #include "ContextMenuController.h"
@@ -42,6 +42,7 @@
 #include "PlatformMouseEvent.h"
 #include "PopupMenuClient.h"
 #include "ProgressTracker.h"
+#include "appcache/ApplicationCacheStorage.h"
 #include "ewk_private.h"
 
 #include <Ecore.h>
@@ -58,6 +59,8 @@
 #define ZOOM_MIN (0.05)
 #define ZOOM_MAX (4.0)
 
+#define DEVICE_PIXEL_RATIO (1.0)
+
 static const char EWK_VIEW_TYPE_STR[] = "EWK_View";
 
 static const size_t EWK_VIEW_REPAINTS_SIZE_INITIAL = 32;
@@ -72,6 +75,7 @@ struct _Ewk_View_Private_Data {
     WebCore::Page* page;
     WebCore::Settings* page_settings;
     WebCore::Frame* main_frame;
+    WebCore::ViewportArguments viewport_arguments;
     Ewk_History* history;
     struct {
         Ewk_Menu menu;
@@ -120,18 +124,11 @@ struct _Ewk_View_Private_Data {
         Eina_Bool offline_app_cache: 1;
         Eina_Bool page_cache: 1;
         struct {
-            float w;
-            float h;
-            float init_scale;
-            float min_scale;
-            float max_scale;
-            float user_scalable;
-        } viewport;
-        struct {
             float min_scale;
             float max_scale;
             Eina_Bool user_scalable:1;
         } zoom_range;
+        float device_pixel_ratio;
     } settings;
     struct {
         struct {
@@ -624,6 +621,7 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* sd)
     priv->settings.zoom_range.min_scale = ZOOM_MIN;
     priv->settings.zoom_range.max_scale = ZOOM_MAX;
     priv->settings.zoom_range.user_scalable = EINA_TRUE;
+    priv->settings.device_pixel_ratio = DEVICE_PIXEL_RATIO;
 
     priv->main_frame = _ewk_view_core_frame_new(sd, priv, 0).get();
     if (!priv->main_frame) {
@@ -967,6 +965,26 @@ static void _ewk_view_zoom_animation_start(Ewk_View_Smart_Data* sd)
         (_ewk_view_zoom_animator_cb, sd);
 }
 
+static WebCore::ViewportAttributes _ewk_view_viewport_attributes_compute(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET(o, sd);
+    EWK_VIEW_PRIV_GET(sd, priv);
+
+    int desktop_width = 980;
+    int device_dpi = 160;
+
+    int available_width = (int) priv->page->chrome()->client()->pageRect().width();
+    int available_height = (int) priv->page->chrome()->client()->pageRect().height();
+
+    int device_width = (int) priv->page->chrome()->client()->windowRect().width();
+    int device_height = (int) priv->page->chrome()->client()->windowRect().height();
+
+    IntSize available_size = IntSize(available_width, available_height);
+    WebCore::ViewportAttributes attributes = WebCore::computeViewportAttributes(priv->viewport_arguments, desktop_width, device_width, device_height, device_dpi, available_size);
+
+    return attributes;
+}
+
 /**
  * Sets the smart class api without any backing store, enabling view
  * to be inherited.
@@ -4049,33 +4067,21 @@ void ewk_view_download_request(Evas_Object* o, Ewk_Download* download)
  * @internal
  * Reports the viewport has changed.
  *
- * @param o view.
- * @param w width.
- * @param h height.
- * @param init_scale initialScale value.
- * @param max_scale maximumScale value.
- * @param min_scale minimumScale value.
- * @param user_scalable userscalable flag.
+ * @param arguments viewport argument.
  *
  * Emits signal: "viewport,changed" with no parameters.
  */
-void ewk_view_viewport_set(Evas_Object *o, float w, float h, float init_scale, float max_scale, float min_scale, float user_scalable)
+void ewk_view_viewport_attributes_set(Evas_Object *o, const WebCore::ViewportArguments& arguments)
 {
     EWK_VIEW_SD_GET(o, sd);
     EWK_VIEW_PRIV_GET(sd, priv);
-
-    priv->settings.viewport.w = w;
-    priv->settings.viewport.h = h;
-    priv->settings.viewport.init_scale = init_scale;
-    priv->settings.viewport.min_scale = min_scale;
-    priv->settings.viewport.max_scale = max_scale;
-    priv->settings.viewport.user_scalable = user_scalable;
-
+    
+    priv->viewport_arguments = arguments;
     evas_object_smart_callback_call(o, "viewport,changed", 0);
 }
 
 /**
- * Gets data of viewport meta tag.
+ * Gets attributes of viewport meta tag.
  *
  * @param o view.
  * @param w width.
@@ -4083,25 +4089,27 @@ void ewk_view_viewport_set(Evas_Object *o, float w, float h, float init_scale, f
  * @param init_scale initial Scale value.
  * @param max_scale maximum Scale value.
  * @param min_scale minimum Scale value.
+ * @param device_pixel_ratio value.
  * @param user_scalable user Scalable value.
  */
-void ewk_view_viewport_get(Evas_Object *o, float* w, float* h, float* init_scale, float* max_scale, float* min_scale, float* user_scalable)
+void ewk_view_viewport_attributes_get(Evas_Object *o, float* w, float* h, float* init_scale, float* max_scale, float* min_scale, float* device_pixel_ratio, Eina_Bool* user_scalable)
 {
-    EWK_VIEW_SD_GET(o, sd);
-    EWK_VIEW_PRIV_GET(sd, priv);
+    WebCore::ViewportAttributes attributes = _ewk_view_viewport_attributes_compute(o);
 
     if (w)
-        *w = priv->settings.viewport.w;
+        *w = attributes.layoutSize.width();
     if (h)
-        *h = priv->settings.viewport.h;
+        *h = attributes.layoutSize.height();
     if (init_scale)
-        *init_scale = priv->settings.viewport.init_scale;
+        *init_scale = attributes.initialScale;
     if (max_scale)
-        *max_scale = priv->settings.viewport.max_scale;
+        *max_scale = attributes.maximumScale;
     if (min_scale)
-        *min_scale = priv->settings.viewport.min_scale;
+        *min_scale = attributes.minimumScale;
+    if (device_pixel_ratio)
+        *device_pixel_ratio = attributes.devicePixelRatio;
     if (user_scalable)
-        *user_scalable = priv->settings.viewport.user_scalable;
+        *user_scalable = attributes.userScalable;
 }
 
 /**
@@ -4191,6 +4199,22 @@ Eina_Bool ewk_view_user_scalable_get(Evas_Object* o)
 }
 
 /**
+ * Gets device pixel ratio value.
+ *
+ * @param o view.
+ * @param user_scalable where to return the current user scalable value.
+ *
+ * @return @c EINA_TRUE if zoom is enabled, @c EINA_FALSE if not.
+ */
+float ewk_view_device_pixel_ratio_get(Evas_Object* o)
+{
+    EWK_VIEW_SD_GET(o, sd);
+    EWK_VIEW_PRIV_GET(sd, priv);
+
+    return priv->settings.device_pixel_ratio;
+}
+
+/**
  * @internal
  * Reports a requeset will be loaded. It's client responsibility to decide if
  * request would be used. If @return is true, loader will try to load. Else,
diff --git a/WebKit/efl/ewk/ewk_view.h b/WebKit/efl/ewk/ewk_view.h
index 26bf97c..aea9aca 100644
--- a/WebKit/efl/ewk/ewk_view.h
+++ b/WebKit/efl/ewk/ewk_view.h
@@ -489,12 +489,13 @@ EAPI void ewk_view_paint_context_translate(Ewk_View_Paint_Context *ctxt, float x
 EAPI Eina_Bool ewk_view_paint(Ewk_View_Private_Data *priv, cairo_t *cr, const Eina_Rectangle *area);
 EAPI Eina_Bool ewk_view_paint_contents(Ewk_View_Private_Data *priv, cairo_t *cr, const Eina_Rectangle *area);
 
-EAPI void ewk_view_viewport_get(Evas_Object *o, float* w, float* h, float* init_scale, float* max_scale, float* min_scale, float* user_scalable);
+EAPI void ewk_view_viewport_attributes_get(Evas_Object *o, float* w, float* h, float* init_scale, float* max_scale, float* min_scale, float* device_pixel_ratio , Eina_Bool* user_scalable);
 EAPI Eina_Bool ewk_view_zoom_range_set(Evas_Object* o, float min_scale, float max_scale);
 EAPI float ewk_view_zoom_range_min_get(Evas_Object* o);
 EAPI float ewk_view_zoom_range_max_get(Evas_Object* o);
 EAPI void ewk_view_user_scalable_set(Evas_Object* o, Eina_Bool user_scalable);
 EAPI Eina_Bool ewk_view_user_scalable_get(Evas_Object* o);
+EAPI float ewk_view_device_pixel_ratio_get(Evas_Object* o);
 
 #ifdef __cplusplus
 }
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index e9bd310..d9bd82b 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,16 @@
+2010-10-13  Gyuyoung Kim  <gyuyoung.kim at samsung.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [EFL] Support viewport configuration and add new arguments for WebKit EFL
+        https://bugs.webkit.org/show_bug.cgi?id=47084
+
+        Opera spec regarding to viewport meta tag was adjusted to WebCore. So, EFL port
+        needs to be modified according to the changes.
+
+        * EWebLauncher/main.c:
+        (on_viewport_changed):
+
 2010-10-12  Dirk Pranke  <dpranke at chromium.org>
 
         Reviewed by Eric Seidel.
diff --git a/WebKitTools/EWebLauncher/main.c b/WebKitTools/EWebLauncher/main.c
index 8965c42..8ba58d8 100644
--- a/WebKitTools/EWebLauncher/main.c
+++ b/WebKitTools/EWebLauncher/main.c
@@ -132,6 +132,7 @@ typedef struct _Viewport {
     float initScale;
     float minScale;
     float maxScale;
+    float devicePixelRatio;
     Eina_Bool userScalable;
 } Viewport;
 
@@ -402,9 +403,10 @@ on_viewport_changed(void* user_data, Evas_Object* webview, void* event_info)
 {
     ELauncher *app = (ELauncher *)user_data;
 
-    float w, h, initScale, minScale, maxScale, userScalable;
+    float w, h, initScale, minScale, maxScale, devicePixelRatio;
+    Eina_Bool userScalable;
 
-    ewk_view_viewport_get(webview, &w, &h, &initScale, &maxScale, &minScale, &userScalable);
+    ewk_view_viewport_attributes_get(webview, &w, &h, &initScale, &maxScale, &minScale, &devicePixelRatio, &userScalable);
 
     /**
      * If there is no argument in viewport tag, argument's value is -1.
@@ -419,6 +421,8 @@ on_viewport_changed(void* user_data, Evas_Object* webview, void* event_info)
         minScale = ewk_view_zoom_range_min_get(webview);
     if ((int)maxScale == -1)
         maxScale = ewk_view_zoom_range_max_get(webview);
+    if ((int)devicePixelRatio == -1)
+        devicePixelRatio = ewk_view_device_pixel_ratio_get(webview);
     if ((int)userScalable == -1)
         userScalable = EINA_TRUE;
 
@@ -427,7 +431,8 @@ on_viewport_changed(void* user_data, Evas_Object* webview, void* event_info)
     app->viewport.initScale = initScale;
     app->viewport.minScale = minScale;
     app->viewport.maxScale = maxScale;
-    app->viewport.userScalable = (Eina_Bool)userScalable;
+    app->viewport.devicePixelRatio = devicePixelRatio;
+    app->viewport.userScalable = userScalable;
     viewport_set();
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list