https://bugs.webkit.org/show_bug.cgi?id=130391
Patch by Andrzej Badowski <a.badowski@samsung.com> on 2014-04-03
Reviewed by Gyuyoung Kim.
Source/WebKit2:
Change the implementation of the zoom functionality from ewk_view_scale_set
to ewk_view_page_zoom_set. Adding to the API functions: ewk_view_page_zoom_set and
ewk_view_page_zoom_get to call appropriate WK functions.
* UIProcess/API/efl/ewk_view.cpp:
(ewk_view_page_zoom_set):
(ewk_view_page_zoom_get):
* UIProcess/API/efl/ewk_view.h:
* UIProcess/API/efl/tests/test_ewk2_view.cpp:
(TEST_F):
Tools:
Change the implementation of the zoom functionality from ewk_view_scale_set
to ewk_view_page_zoom_set.
* MiniBrowser/efl/main.c:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166718
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-04-03 Andrzej Badowski <a.badowski@samsung.com>
+
+ [EFL][WK2] Replacing zoom functionality of MiniBrowser from scale_set to page_zoom_set.
+ https://bugs.webkit.org/show_bug.cgi?id=130391
+
+ Reviewed by Gyuyoung Kim.
+
+ Change the implementation of the zoom functionality from ewk_view_scale_set
+ to ewk_view_page_zoom_set. Adding to the API functions: ewk_view_page_zoom_set and
+ ewk_view_page_zoom_get to call appropriate WK functions.
+
+ * UIProcess/API/efl/ewk_view.cpp:
+ (ewk_view_page_zoom_set):
+ (ewk_view_page_zoom_get):
+ * UIProcess/API/efl/ewk_view.h:
+ * UIProcess/API/efl/tests/test_ewk2_view.cpp:
+ (TEST_F):
+
2014-04-02 Alexey Proskuryakov <ap@apple.com>
Sandbox violation in NetworkProcess when uploading a bundle
return WKPageGetScaleFactor(impl->wkPage());
}
+Eina_Bool ewk_view_page_zoom_set(Evas_Object* ewkView, double zoomFactor)
+{
+ EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false);
+
+ WKPageSetPageZoomFactor(impl->wkPage(), zoomFactor);
+
+ return true;
+}
+
+double ewk_view_page_zoom_get(const Evas_Object* ewkView)
+{
+ EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, -1);
+
+ return WKPageGetPageZoomFactor(impl->wkPage());
+}
+
Eina_Bool ewk_view_device_pixel_ratio_set(Evas_Object* ewkView, float ratio)
{
EWK_VIEW_IMPL_GET_OR_RETURN(ewkView, impl, false);
EAPI double ewk_view_scale_get(const Evas_Object *o);
/**
+ * Sets zoom of the current page.
+ *
+ * @param o view object to set the zoom level
+ * @param zoom_factor a new level to set
+ *
+ * @return @c EINA_TRUE on success or @c EINA_FALSE otherwise
+ */
+EAPI Eina_Bool ewk_view_page_zoom_set(Evas_Object *o, double zoom_factor);
+
+/**
+ * Queries the current zoom factor of the page.
+ *
+ * It returns previous zoom factor after ewk_view_page_zoom_factor_set is called immediately
+ * until zoom factor of page is really changed.
+ *
+ * @param o view object to get the zoom factor
+ *
+ * @return current zoom factor in use on success or @c -1.0 on failure
+ */
+EAPI double ewk_view_page_zoom_get(const Evas_Object *o);
+
+/**
* Queries the ratio between the CSS units and device pixels when the content is unscaled.
*
* When designing touch-friendly contents, knowing the approximated target size on a device
ASSERT_EQ(0, blue);
ASSERT_EQ(255, red);
}
+
+TEST_F(EWK2ViewTest, ewk_view_page_zoom_set)
+{
+ ASSERT_TRUE(loadUrlSync(environment->defaultTestPageUrl()));
+
+ // Default zoom factor is 1.0
+ ASSERT_FLOAT_EQ(1, ewk_view_page_zoom_get(webView()));
+
+ ASSERT_TRUE(ewk_view_page_zoom_set(webView(), 0.67));
+ ASSERT_FLOAT_EQ(0.67, ewk_view_page_zoom_get(webView()));
+
+ ASSERT_TRUE(ewk_view_page_zoom_set(webView(), 1));
+ ASSERT_FLOAT_EQ(1, ewk_view_page_zoom_get(webView()));
+}
+2014-04-03 Andrzej Badowski <a.badowski@samsung.com>
+
+ [EFL][WK2] Replacing zoom functionality of MiniBrowser from scale_set to page_zoom_set.
+ https://bugs.webkit.org/show_bug.cgi?id=130391
+
+ Reviewed by Gyuyoung Kim.
+
+ Change the implementation of the zoom functionality from ewk_view_scale_set
+ to ewk_view_page_zoom_set.
+
+ * MiniBrowser/efl/main.c:
+
2014-04-03 Manuel Rego Casasnovas <rego@igalia.com>
[webkitpy] perf profiler does not understand --call-graph argument
if (level < 0 || level >= sizeof(zoomLevels) / sizeof(float))
return EINA_FALSE;
- Evas_Coord ox, oy, mx, my, cx, cy;
- evas_pointer_canvas_xy_get(evas_object_evas_get(webview), &mx, &my); // Get current mouse position on window.
- evas_object_geometry_get(webview, &ox, &oy, NULL, NULL); // Get webview's position on window.
- cx = mx - ox; // current x position = mouse x position - webview x position
- cy = my - oy; // current y position = mouse y position - webview y position
-
- Eina_Bool result = ewk_view_scale_set(webview, zoomLevels[level], cx, cy);
- return result;
+ return ewk_view_page_zoom_set(webview, zoomLevels[level]);
}
static Ewk_View_Smart_Class *miniBrowserViewSmartClass()