<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[169688] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/169688">169688</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-06-09 03:29:46 -0700 (Mon, 09 Jun 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[EFL] Add parameter to MiniBrowser to disable web security
https://bugs.webkit.org/show_bug.cgi?id=121095

Patch by Andrzej Badowski &lt;a.badowski@samsung.com&gt; on 2014-06-09
Reviewed by Gyuyoung Kim.

-w (--web-security) commandline allows to disable/enable web security (enabled by default).
The reason for this is to test and debug (using, for example, MiniBrowser) scripts accessing
resources from other domains (cross-domain requests) such as access map location on another server.
Another possibility is to launch in a webkit browser local file tests that will refer to the links
in the http website loaded in an iframe. It will not be possible without deactivation of web security.

Source/WebKit2:
* UIProcess/API/efl/ewk_settings.cpp:
(ewk_settings_web_security_enabled_set):
(ewk_settings_web_security_enabled_get):
* UIProcess/API/efl/ewk_settings.h:
* UIProcess/API/efl/tests/test_ewk2_settings.cpp:
(TEST_F):

Tools:
* MiniBrowser/efl/main.c:
(window_create):
(elm_main):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIeflewk_settingscpp">trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIeflewk_settingsh">trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIeflteststest_ewk2_settingscpp">trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_settings.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsMiniBrowsereflmainc">trunk/Tools/MiniBrowser/efl/main.c</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (169687 => 169688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-06-09 06:58:00 UTC (rev 169687)
+++ trunk/Source/WebKit2/ChangeLog        2014-06-09 10:29:46 UTC (rev 169688)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2014-06-09  Andrzej Badowski  &lt;a.badowski@samsung.com&gt;
+
+        [EFL] Add parameter to MiniBrowser to disable web security
+        https://bugs.webkit.org/show_bug.cgi?id=121095
+
+        Reviewed by Gyuyoung Kim.
+
+        -w (--web-security) commandline allows to disable/enable web security (enabled by default).
+        The reason for this is to test and debug (using, for example, MiniBrowser) scripts accessing
+        resources from other domains (cross-domain requests) such as access map location on another server.
+        Another possibility is to launch in a webkit browser local file tests that will refer to the links
+        in the http website loaded in an iframe. It will not be possible without deactivation of web security.
+
+        * UIProcess/API/efl/ewk_settings.cpp:
+        (ewk_settings_web_security_enabled_set):
+        (ewk_settings_web_security_enabled_get):
+        * UIProcess/API/efl/ewk_settings.h:
+        * UIProcess/API/efl/tests/test_ewk2_settings.cpp:
+        (TEST_F):
+
</ins><span class="cx"> 2014-06-08  Sam Weinig  &lt;sam@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [Cocoa] WKScriptMessage should include the frame the message is from
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIeflewk_settingscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp (169687 => 169688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp        2014-06-09 06:58:00 UTC (rev 169687)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.cpp        2014-06-09 10:29:46 UTC (rev 169688)
</span><span class="lines">@@ -327,6 +327,22 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Eina_Bool ewk_settings_web_security_enabled_set(Ewk_Settings* settings, Eina_Bool enable)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
+
+    WKPreferencesSetWebSecurityEnabled(settings-&gt;preferences(), enable);
+
+    return true;
+}
+
+Eina_Bool ewk_settings_web_security_enabled_get(const Ewk_Settings* settings)
+{
+    EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
+
+    return WKPreferencesGetWebSecurityEnabled(settings-&gt;preferences());
+}
+
</ins><span class="cx"> Eina_Bool ewk_settings_spatial_navigation_enabled_set(Ewk_Settings* settings, Eina_Bool enable)
</span><span class="cx"> {
</span><span class="cx">     EINA_SAFETY_ON_NULL_RETURN_VAL(settings, false);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIeflewk_settingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.h (169687 => 169688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.h        2014-06-09 06:58:00 UTC (rev 169687)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_settings.h        2014-06-09 10:29:46 UTC (rev 169688)
</span><span class="lines">@@ -466,6 +466,31 @@
</span><span class="cx"> EAPI Eina_Bool ewk_settings_text_autosizing_enabled_get(const Ewk_Settings *settings);
</span><span class="cx"> 
</span><span class="cx"> /**
</span><ins>+ * Enables/disables web security.
+ *
+ * By default, the web security is enabled.
+ *
+ * @param settings settings object to set the web security
+ * @param enable @c EINA_TRUE to enable the web security
+ *               @c EINA_FALSE to disable
+ *
+ * @return @c EINA_TRUE on success or @c EINA_FALSE on failure
+ *
+ * @see ewk_settings_web_security_enabled_get()
+ */
+EAPI Eina_Bool ewk_settings_web_security_enabled_set(Ewk_Settings *settings, Eina_Bool enable);
+
+/**
+ * Returns whether the web security is enabled.
+ *
+ * @param settings settings object to query whether web security is enabled
+ *
+ * @return @c EINA_TRUE if the web security is enabled
+ *         @c EINA_FALSE if not or on failure
+ */
+EAPI Eina_Bool ewk_settings_web_security_enabled_get(const Ewk_Settings *settings);
+
+/**
</ins><span class="cx">  * Changes spatial navigation state.
</span><span class="cx">  *
</span><span class="cx">  * @param settings settings object to enable/disable spatial navigation
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIeflteststest_ewk2_settingscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_settings.cpp (169687 => 169688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_settings.cpp        2014-06-09 06:58:00 UTC (rev 169687)
+++ trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_settings.cpp        2014-06-09 10:29:46 UTC (rev 169688)
</span><span class="lines">@@ -302,6 +302,20 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+TEST_F(EWK2UnitTestBase, ewk_settings_web_security_enabled)
+{
+    Ewk_Settings* settings = ewk_view_settings_get(webView());
+
+    // Web security should be enabled by default.
+    ASSERT_TRUE(ewk_settings_web_security_enabled_get(settings));
+
+    ASSERT_TRUE(ewk_settings_web_security_enabled_set(settings, false));
+    ASSERT_FALSE(ewk_settings_web_security_enabled_get(settings));
+
+    ASSERT_TRUE(ewk_settings_web_security_enabled_set(settings, true));
+    ASSERT_TRUE(ewk_settings_web_security_enabled_get(settings));
+}
+
</ins><span class="cx"> TEST_F(EWK2UnitTestBase, ewk_settings_spatial_navigation_enabled)
</span><span class="cx"> {
</span><span class="cx">     Ewk_Settings* settings = ewk_view_settings_get(webView());
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (169687 => 169688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2014-06-09 06:58:00 UTC (rev 169687)
+++ trunk/Tools/ChangeLog        2014-06-09 10:29:46 UTC (rev 169688)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2014-06-09  Andrzej Badowski  &lt;a.badowski@samsung.com&gt;
+
+        [EFL] Add parameter to MiniBrowser to disable web security
+        https://bugs.webkit.org/show_bug.cgi?id=121095
+
+        Reviewed by Gyuyoung Kim.
+
+        -w (--web-security) commandline allows to disable/enable web security (enabled by default).
+        The reason for this is to test and debug (using, for example, MiniBrowser) scripts accessing
+        resources from other domains (cross-domain requests) such as access map location on another server.
+        Another possibility is to launch in a webkit browser local file tests that will refer to the links
+        in the http website loaded in an iframe. It will not be possible without deactivation of web security.
+
+        * MiniBrowser/efl/main.c:
+        (window_create):
+        (elm_main):
+
</ins><span class="cx"> 2014-06-06  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         32-bit build fix.
</span></span></pre></div>
<a id="trunkToolsMiniBrowsereflmainc"></a>
<div class="modfile"><h4>Modified: trunk/Tools/MiniBrowser/efl/main.c (169687 => 169688)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/MiniBrowser/efl/main.c        2014-06-09 06:58:00 UTC (rev 169687)
+++ trunk/Tools/MiniBrowser/efl/main.c        2014-06-09 10:29:46 UTC (rev 169688)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx"> static Eina_Bool local_storage_enabled = EINA_TRUE;
</span><span class="cx"> static Eina_Bool fullscreen_enabled = EINA_FALSE;
</span><span class="cx"> static Eina_Bool spell_checking_enabled = EINA_FALSE;
</span><ins>+static Eina_Bool web_security_enabled = EINA_TRUE;
</ins><span class="cx"> static Eina_Bool touch_events_enabled = EINA_FALSE;
</span><span class="cx"> static Eina_Bool fixed_layout_enabled = EINA_FALSE;
</span><span class="cx"> static Eina_Bool separated_process_enabled = EINA_FALSE;
</span><span class="lines">@@ -171,6 +172,8 @@
</span><span class="cx">         ECORE_GETOPT_STORE_DEF_STR
</span><span class="cx">             ('p', &quot;policy-cookies&quot;, &quot;Cookies policy:\n  always - always accept,\n  never - never accept,\n  no-third-party - don't accept third-party cookies.&quot;, &quot;no-third-party&quot;),
</span><span class="cx">         ECORE_GETOPT_STORE_DEF_BOOL
</span><ins>+            ('w', &quot;web-security&quot;, &quot;enable/disable web security.&quot;, EINA_TRUE),
+        ECORE_GETOPT_STORE_DEF_BOOL
</ins><span class="cx">             ('S', &quot;separate-process&quot;, &quot;Create new window in separated web process.&quot;, EINA_TRUE),
</span><span class="cx">         ECORE_GETOPT_VERSION
</span><span class="cx">             ('V', &quot;version&quot;),
</span><span class="lines">@@ -1864,6 +1867,7 @@
</span><span class="cx">     ewk_settings_developer_extras_enabled_set(settings, EINA_TRUE);
</span><span class="cx">     ewk_settings_preferred_minimum_contents_width_set(settings, 0);
</span><span class="cx">     ewk_text_checker_continuous_spell_checking_enabled_set(spell_checking_enabled);
</span><ins>+    ewk_settings_web_security_enabled_set(settings, web_security_enabled);
</ins><span class="cx"> 
</span><span class="cx">     evas_object_smart_callback_add(window-&gt;ewk_view, &quot;authentication,request&quot;, on_authentication_request, window);
</span><span class="cx">     evas_object_smart_callback_add(window-&gt;ewk_view, &quot;download,failed&quot;, on_download_failed, window);
</span><span class="lines">@@ -1962,6 +1966,7 @@
</span><span class="cx">         ECORE_GETOPT_VALUE_BOOL(touch_events_enabled),
</span><span class="cx">         ECORE_GETOPT_VALUE_BOOL(fixed_layout_enabled),
</span><span class="cx">         ECORE_GETOPT_VALUE_STR(cookies_policy_string),
</span><ins>+        ECORE_GETOPT_VALUE_BOOL(web_security_enabled),
</ins><span class="cx">         ECORE_GETOPT_VALUE_BOOL(separated_process_enabled),
</span><span class="cx">         ECORE_GETOPT_VALUE_BOOL(quitOption),
</span><span class="cx">         ECORE_GETOPT_VALUE_BOOL(quitOption),
</span></span></pre>
</div>
</div>

</body>
</html>