Title: [159996] trunk/Source/WebKit2
Revision
159996
Author
[email protected]
Date
2013-12-03 02:29:47 -0800 (Tue, 03 Dec 2013)

Log Message

Add spatial navigation API in EFL port
https://bugs.webkit.org/show_bug.cgi?id=125002

Patch by Dariusz Frankiewicz <[email protected]> on 2013-12-03
Reviewed by Gyuyoung Kim.

API enables capability of turning on and off spatial navigation
and check is state.
Spatial navigation is the ability to navigate between focusable
elements by keyboard.

* UIProcess/API/efl/ewk_settings.cpp:
(ewk_settings_spatial_navigation_enabled_set):
(ewk_settings_spatial_navigation_enabled_get):
* UIProcess/API/efl/ewk_settings.h:
* UIProcess/API/efl/tests/test_ewk2_settings.cpp:
(TEST_F):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (159995 => 159996)


--- trunk/Source/WebKit2/ChangeLog	2013-12-03 10:28:21 UTC (rev 159995)
+++ trunk/Source/WebKit2/ChangeLog	2013-12-03 10:29:47 UTC (rev 159996)
@@ -1,3 +1,22 @@
+2013-12-03  Dariusz Frankiewicz  <[email protected]>
+
+        Add spatial navigation API in EFL port
+        https://bugs.webkit.org/show_bug.cgi?id=125002
+
+        Reviewed by Gyuyoung Kim.
+
+        API enables capability of turning on and off spatial navigation
+        and check is state.
+        Spatial navigation is the ability to navigate between focusable
+        elements by keyboard.
+
+        * UIProcess/API/efl/ewk_settings.cpp:
+        (ewk_settings_spatial_navigation_enabled_set):
+        (ewk_settings_spatial_navigation_enabled_get):
+        * UIProcess/API/efl/ewk_settings.h:
+        * UIProcess/API/efl/tests/test_ewk2_settings.cpp:
+        (TEST_F):
+
 2013-12-02  Zan Dobersek  <[email protected]>
 
         Build fixes for GCC-using ports after r159965 and later

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp (159995 => 159996)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp	2013-12-03 10:28:21 UTC (rev 159995)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp	2013-12-03 10:29:47 UTC (rev 159996)
@@ -318,3 +318,18 @@
 #endif
 }
 
+Eina_Bool ewk_settings_spatial_navigation_enabled_set(Ewk_Settings* settings, Eina_Bool enable)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
+
+    settings->preferences()->setSpatialNavigationEnabled(enable);
+
+    return true;
+}
+
+Eina_Bool ewk_settings_spatial_navigation_enabled_get(const Ewk_Settings* settings)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
+
+    return settings->preferences()->spatialNavigationEnabled();
+}

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.h (159995 => 159996)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.h	2013-12-03 10:28:21 UTC (rev 159995)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.h	2013-12-03 10:29:47 UTC (rev 159996)
@@ -444,6 +444,27 @@
  */
 EAPI Eina_Bool ewk_settings_text_autosizing_enabled_get(const Ewk_Settings *settings);
 
+/**
+ * Changes spatial navigation state.
+ *
+ * @param settings settings object to enable/disable spatial navigation
+ * @param enabled @c EINA_TRUE to enable spatial navigation
+ *                @c EINA_FALSE to disable spatial navigation
+ *
+ * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
+ */
+EAPI Eina_Bool ewk_settings_spatial_navigation_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
+
+/**
+ * Returns current state of spatial navigation.
+ *
+ * @param settings settings object to get whether spatial navigation is enabled
+ *
+ * @return @c EINA_TRUE if spatial navigation is enabled
+ *         @c EINA_FALSE if spatial navigation is disabled
+ */
+EAPI Eina_Bool ewk_settings_spatial_navigation_enabled_get(const Ewk_Settings *settings);
+
 #ifdef __cplusplus
 }
 #endif

Modified: trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_settings.cpp (159995 => 159996)


--- trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_settings.cpp	2013-12-03 10:28:21 UTC (rev 159995)
+++ trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_settings.cpp	2013-12-03 10:29:47 UTC (rev 159996)
@@ -287,3 +287,17 @@
     ASSERT_FALSE(ewk_settings_text_autosizing_enabled_get(settings));
 #endif
 }
+
+TEST_F(EWK2UnitTestBase, ewk_settings_spatial_navigation_enabled)
+{
+    Ewk_Settings* settings = ewk_view_settings_get(webView());
+
+    // Spatial navigation is disabled by default.
+    ASSERT_FALSE(ewk_settings_spatial_navigation_enabled_get(settings));
+
+    ASSERT_TRUE(ewk_settings_spatial_navigation_enabled_set(settings, true));
+    ASSERT_TRUE(ewk_settings_spatial_navigation_enabled_get(settings));
+
+    ASSERT_TRUE(ewk_settings_spatial_navigation_enabled_set(settings, false));
+    ASSERT_FALSE(ewk_settings_spatial_navigation_enabled_get(settings));
+}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to