Changeset 69650 in webkit
- Timestamp:
- Oct 13, 2010 5:14:58 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/efl/ChangeLog
r69613 r69650 1 2010-10-13 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [EFL] Support viewport configuration and add new arguments for WebKit EFL 6 https://bugs.webkit.org/show_bug.cgi?id=47084 7 8 Opera spec regarding to viewport meta tag was adjusted to WebCore. So, EFL port 9 needs to be modified according to the changes. 10 11 * WebCoreSupport/ChromeClientEfl.cpp: 12 (WebCore::ChromeClientEfl::dispatchViewportDataDidChange): 13 * WebCoreSupport/FrameLoaderClientEfl.cpp: 14 (WebCore::FrameLoaderClientEfl::dispatchDidCommitLoad): 15 * ewk/ewk_private.h: 16 * ewk/ewk_view.cpp: 17 (_ewk_view_priv_new): 18 (_ewk_view_viewport_attributes_compute): 19 (ewk_view_viewport_attributes_set): 20 (ewk_view_viewport_attributes_get): 21 (ewk_view_device_pixel_ratio_get): 22 * ewk/ewk_view.h: 23 1 24 2010-10-12 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 25 -
trunk/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
r69376 r69650 520 520 void ChromeClientEfl::dispatchViewportDataDidChange(const ViewportArguments& arguments) const 521 521 { 522 ewk_view_viewport_ set(m_view, arguments.width, arguments.height, arguments.initialScale, arguments.minimumScale, arguments.maximumScale, arguments.userScalable);522 ewk_view_viewport_attributes_set(m_view, arguments); 523 523 } 524 524 -
trunk/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
r69061 r69650 622 622 623 623 ViewportArguments arguments; 624 ewk_view_viewport_ set(m_view, arguments.width, arguments.height, arguments.initialScale, arguments.minimumScale, arguments.maximumScale, arguments.userScalable);624 ewk_view_viewport_attributes_set(m_view, arguments); 625 625 } 626 626 -
trunk/WebKit/efl/ewk/ewk_private.h
r69613 r69650 103 103 104 104 void ewk_view_popup_new(Evas_Object *o, WebCore::PopupMenuClient* client, int selected, const WebCore::IntRect& rect); 105 void ewk_view_viewport_ set(Evas_Object *o, float w, float h, float init_scale, float max_scale, float min_scale, float user_scalable);105 void ewk_view_viewport_attributes_set(Evas_Object *o, const WebCore::ViewportArguments& arguments); 106 106 107 107 void ewk_view_download_request(Evas_Object *o, Ewk_Download *download); -
trunk/WebKit/efl/ewk/ewk_view.cpp
r69613 r69650 23 23 #include "ewk_view.h" 24 24 25 #include " appcache/ApplicationCacheStorage.h"25 #include "Chrome.h" 26 26 #include "ChromeClientEfl.h" 27 27 #include "ContextMenuClientEfl.h" … … 43 43 #include "PopupMenuClient.h" 44 44 #include "ProgressTracker.h" 45 #include "appcache/ApplicationCacheStorage.h" 45 46 #include "ewk_private.h" 46 47 … … 59 60 #define ZOOM_MAX (4.0) 60 61 62 #define DEVICE_PIXEL_RATIO (1.0) 63 61 64 static const char EWK_VIEW_TYPE_STR[] = "EWK_View"; 62 65 … … 73 76 WebCore::Settings* page_settings; 74 77 WebCore::Frame* main_frame; 78 WebCore::ViewportArguments viewport_arguments; 75 79 Ewk_History* history; 76 80 struct { … … 121 125 Eina_Bool page_cache: 1; 122 126 struct { 123 float w;124 float h;125 float init_scale;126 float min_scale;127 float max_scale;128 float user_scalable;129 } viewport;130 struct {131 127 float min_scale; 132 128 float max_scale; 133 129 Eina_Bool user_scalable:1; 134 130 } zoom_range; 131 float device_pixel_ratio; 135 132 } settings; 136 133 struct { … … 625 622 priv->settings.zoom_range.max_scale = ZOOM_MAX; 626 623 priv->settings.zoom_range.user_scalable = EINA_TRUE; 624 priv->settings.device_pixel_ratio = DEVICE_PIXEL_RATIO; 627 625 628 626 priv->main_frame = _ewk_view_core_frame_new(sd, priv, 0).get(); … … 966 964 priv->animated_zoom.animator = ecore_animator_add 967 965 (_ewk_view_zoom_animator_cb, sd); 966 } 967 968 static WebCore::ViewportAttributes _ewk_view_viewport_attributes_compute(Evas_Object* o) 969 { 970 EWK_VIEW_SD_GET(o, sd); 971 EWK_VIEW_PRIV_GET(sd, priv); 972 973 int desktop_width = 980; 974 int device_dpi = 160; 975 976 int available_width = (int) priv->page->chrome()->client()->pageRect().width(); 977 int available_height = (int) priv->page->chrome()->client()->pageRect().height(); 978 979 int device_width = (int) priv->page->chrome()->client()->windowRect().width(); 980 int device_height = (int) priv->page->chrome()->client()->windowRect().height(); 981 982 IntSize available_size = IntSize(available_width, available_height); 983 WebCore::ViewportAttributes attributes = WebCore::computeViewportAttributes(priv->viewport_arguments, desktop_width, device_width, device_height, device_dpi, available_size); 984 985 return attributes; 968 986 } 969 987 … … 4050 4068 * Reports the viewport has changed. 4051 4069 * 4052 * @param o view. 4053 * @param w width. 4054 * @param h height. 4055 * @param init_scale initialScale value. 4056 * @param max_scale maximumScale value. 4057 * @param min_scale minimumScale value. 4058 * @param user_scalable userscalable flag. 4070 * @param arguments viewport argument. 4059 4071 * 4060 4072 * Emits signal: "viewport,changed" with no parameters. 4061 4073 */ 4062 void ewk_view_viewport_ set(Evas_Object *o, float w, float h, float init_scale, float max_scale, float min_scale, float user_scalable)4074 void ewk_view_viewport_attributes_set(Evas_Object *o, const WebCore::ViewportArguments& arguments) 4063 4075 { 4064 4076 EWK_VIEW_SD_GET(o, sd); 4065 4077 EWK_VIEW_PRIV_GET(sd, priv); 4066 4067 priv->settings.viewport.w = w; 4068 priv->settings.viewport.h = h; 4069 priv->settings.viewport.init_scale = init_scale; 4070 priv->settings.viewport.min_scale = min_scale; 4071 priv->settings.viewport.max_scale = max_scale; 4072 priv->settings.viewport.user_scalable = user_scalable; 4073 4078 4079 priv->viewport_arguments = arguments; 4074 4080 evas_object_smart_callback_call(o, "viewport,changed", 0); 4075 4081 } 4076 4082 4077 4083 /** 4078 * Gets dataof viewport meta tag.4084 * Gets attributes of viewport meta tag. 4079 4085 * 4080 4086 * @param o view. … … 4084 4090 * @param max_scale maximum Scale value. 4085 4091 * @param min_scale minimum Scale value. 4092 * @param device_pixel_ratio value. 4086 4093 * @param user_scalable user Scalable value. 4087 4094 */ 4088 void ewk_view_viewport_get(Evas_Object *o, float* w, float* h, float* init_scale, float* max_scale, float* min_scale, float* user_scalable) 4089 { 4090 EWK_VIEW_SD_GET(o, sd); 4091 EWK_VIEW_PRIV_GET(sd, priv); 4095 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) 4096 { 4097 WebCore::ViewportAttributes attributes = _ewk_view_viewport_attributes_compute(o); 4092 4098 4093 4099 if (w) 4094 *w = priv->settings.viewport.w;4100 *w = attributes.layoutSize.width(); 4095 4101 if (h) 4096 *h = priv->settings.viewport.h;4102 *h = attributes.layoutSize.height(); 4097 4103 if (init_scale) 4098 *init_scale = priv->settings.viewport.init_scale;4104 *init_scale = attributes.initialScale; 4099 4105 if (max_scale) 4100 *max_scale = priv->settings.viewport.max_scale;4106 *max_scale = attributes.maximumScale; 4101 4107 if (min_scale) 4102 *min_scale = priv->settings.viewport.min_scale; 4108 *min_scale = attributes.minimumScale; 4109 if (device_pixel_ratio) 4110 *device_pixel_ratio = attributes.devicePixelRatio; 4103 4111 if (user_scalable) 4104 *user_scalable = priv->settings.viewport.user_scalable;4112 *user_scalable = attributes.userScalable; 4105 4113 } 4106 4114 … … 4192 4200 4193 4201 /** 4202 * Gets device pixel ratio value. 4203 * 4204 * @param o view. 4205 * @param user_scalable where to return the current user scalable value. 4206 * 4207 * @return @c EINA_TRUE if zoom is enabled, @c EINA_FALSE if not. 4208 */ 4209 float ewk_view_device_pixel_ratio_get(Evas_Object* o) 4210 { 4211 EWK_VIEW_SD_GET(o, sd); 4212 EWK_VIEW_PRIV_GET(sd, priv); 4213 4214 return priv->settings.device_pixel_ratio; 4215 } 4216 4217 /** 4194 4218 * @internal 4195 4219 * Reports a requeset will be loaded. It's client responsibility to decide if -
trunk/WebKit/efl/ewk/ewk_view.h
r68363 r69650 490 490 EAPI Eina_Bool ewk_view_paint_contents(Ewk_View_Private_Data *priv, cairo_t *cr, const Eina_Rectangle *area); 491 491 492 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);492 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); 493 493 EAPI Eina_Bool ewk_view_zoom_range_set(Evas_Object* o, float min_scale, float max_scale); 494 494 EAPI float ewk_view_zoom_range_min_get(Evas_Object* o); … … 496 496 EAPI void ewk_view_user_scalable_set(Evas_Object* o, Eina_Bool user_scalable); 497 497 EAPI Eina_Bool ewk_view_user_scalable_get(Evas_Object* o); 498 EAPI float ewk_view_device_pixel_ratio_get(Evas_Object* o); 498 499 499 500 #ifdef __cplusplus -
trunk/WebKitTools/ChangeLog
r69638 r69650 1 2010-10-13 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [EFL] Support viewport configuration and add new arguments for WebKit EFL 6 https://bugs.webkit.org/show_bug.cgi?id=47084 7 8 Opera spec regarding to viewport meta tag was adjusted to WebCore. So, EFL port 9 needs to be modified according to the changes. 10 11 * EWebLauncher/main.c: 12 (on_viewport_changed): 13 1 14 2010-10-12 Dirk Pranke <dpranke@chromium.org> 2 15 -
trunk/WebKitTools/EWebLauncher/main.c
r68363 r69650 133 133 float minScale; 134 134 float maxScale; 135 float devicePixelRatio; 135 136 Eina_Bool userScalable; 136 137 } Viewport; … … 403 404 ELauncher *app = (ELauncher *)user_data; 404 405 405 float w, h, initScale, minScale, maxScale, userScalable; 406 407 ewk_view_viewport_get(webview, &w, &h, &initScale, &maxScale, &minScale, &userScalable); 406 float w, h, initScale, minScale, maxScale, devicePixelRatio; 407 Eina_Bool userScalable; 408 409 ewk_view_viewport_attributes_get(webview, &w, &h, &initScale, &maxScale, &minScale, &devicePixelRatio, &userScalable); 408 410 409 411 /** … … 420 422 if ((int)maxScale == -1) 421 423 maxScale = ewk_view_zoom_range_max_get(webview); 424 if ((int)devicePixelRatio == -1) 425 devicePixelRatio = ewk_view_device_pixel_ratio_get(webview); 422 426 if ((int)userScalable == -1) 423 427 userScalable = EINA_TRUE; … … 428 432 app->viewport.minScale = minScale; 429 433 app->viewport.maxScale = maxScale; 430 app->viewport.userScalable = (Eina_Bool)userScalable; 434 app->viewport.devicePixelRatio = devicePixelRatio; 435 app->viewport.userScalable = userScalable; 431 436 viewport_set(); 432 437 }
Note: See TracChangeset
for help on using the changeset viewer.