Skip to content

Commit

Permalink
[EFL] Add setting API for allow universal/file access from file URLs.
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=83121

Patch by Kamil Blank <k.blank@samsung.com> on 2012-08-29
Reviewed by Eric Seidel.

Source/WebKit/efl:

Make it possible to enable allow universal/file access from file URLs.
Default value for both settings is true.

* ewk/ewk_view.cpp:
(_Ewk_View_Private_Data):
(_ewk_view_priv_new):
(ewk_view_setting_allow_universal_access_from_file_urls_set): Function sets if locally loaded documents
are allowed to access remote urls.
(ewk_view_setting_allow_universal_access_from_file_urls_get):
(ewk_view_setting_allow_file_access_from_file_urls_set): Function sets if locally loaded documents
are allowed to access other local urls.
(ewk_view_setting_allow_file_access_from_file_urls_get):
* ewk/ewk_view.h:

Tools:

Implementation of setAllowUniversalAccessFromFileURLs and setAllowFileAccessFromFileURLs.

* DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
(DumpRenderTreeChrome::resetDefaultsToConsistentValues):
* DumpRenderTree/efl/TestRunnerEfl.cpp:
(TestRunner::setAllowUniversalAccessFromFileURLs):
(TestRunner::setAllowFileAccessFromFileURLs):

LayoutTests:

Enable test connected with setAllowUniversalAccessFromFileURLs and setAllowFileAccessFromFileURLs.

* platform/efl/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127024 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
webkit-commit-queue committed Aug 29, 2012
1 parent 5888d4d commit 5f3f1aa
Show file tree
Hide file tree
Showing 8 changed files with 150 additions and 15 deletions.
11 changes: 11 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
2012-08-29 Kamil Blank <k.blank@samsung.com>

[EFL] Add setting API for allow universal/file access from file URLs.
https://bugs.webkit.org/show_bug.cgi?id=83121

Reviewed by Eric Seidel.

Enable test connected with setAllowUniversalAccessFromFileURLs and setAllowFileAccessFromFileURLs.

* platform/efl/Skipped:

2012-08-29 W. James MacLean <wjmaclean@chromium.org>

[chromium] Link highlight should clear on page navigation.
Expand Down
9 changes: 0 additions & 9 deletions LayoutTests/platform/efl/Skipped
Expand Up @@ -127,15 +127,6 @@ fast/dom/Window/window-onFocus.html
fast/events/blur-focus-window-should-blur-focus-element.html
plugins/netscape-plugin-setwindow-size-2.html

# EFL's LayoutTestController does not implement setAllowUniversalAccessFromFileURLs
# EFL's LayoutTestController does not implement setAllowAccessFromFileURLs
fast/files/workers/inline-worker-via-blob-url.html
fast/forms/formtarget-attribute-button-html.html
fast/forms/formtarget-attribute-input-html.html
fast/frames/location-change-no-file-access.html
fast/xmlhttprequest/xmlhttprequest-no-file-access.html
fast/xmlhttprequest/xmlhttprequest-nonexistent-file.html

# BUG84835: Tests failing because of missing editing delegate callbacks.
editing/deleting
editing/inserting
Expand Down
21 changes: 21 additions & 0 deletions Source/WebKit/efl/ChangeLog
@@ -1,3 +1,24 @@
2012-08-29 Kamil Blank <k.blank@samsung.com>

[EFL] Add setting API for allow universal/file access from file URLs.
https://bugs.webkit.org/show_bug.cgi?id=83121

Reviewed by Eric Seidel.

Make it possible to enable allow universal/file access from file URLs.
Default value for both settings is true.

* ewk/ewk_view.cpp:
(_Ewk_View_Private_Data):
(_ewk_view_priv_new):
(ewk_view_setting_allow_universal_access_from_file_urls_set): Function sets if locally loaded documents
are allowed to access remote urls.
(ewk_view_setting_allow_universal_access_from_file_urls_get):
(ewk_view_setting_allow_file_access_from_file_urls_set): Function sets if locally loaded documents
are allowed to access other local urls.
(ewk_view_setting_allow_file_access_from_file_urls_get):
* ewk/ewk_view.h:

2012-08-29 Ryuan Choi <ryuan.choi@samsung.com>

[EFL] Add *explicit* keyword to constructors in WebCoreSupport
Expand Down
43 changes: 43 additions & 0 deletions Source/WebKit/efl/ewk/ewk_view.cpp
Expand Up @@ -332,6 +332,8 @@ struct _Ewk_View_Private_Data {
} zoomRange;
float devicePixelRatio;
double domTimerInterval;
bool allowUniversalAccessFromFileURLs : 1;
bool allowFileAccessFromFileURLs : 1;
} settings;
struct {
struct {
Expand Down Expand Up @@ -874,6 +876,9 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData)

priv->settings.domTimerInterval = priv->pageSettings->defaultMinDOMTimerInterval();

priv->settings.allowUniversalAccessFromFileURLs = priv->pageSettings->allowUniversalAccessFromFileURLs();
priv->settings.allowFileAccessFromFileURLs = priv->pageSettings->allowFileAccessFromFileURLs();

priv->mainFrame = _ewk_view_core_frame_new(smartData, priv, 0).get();

priv->history = ewk_history_new(static_cast<WebCore::BackForwardListImpl*>(priv->page->backForwardList()));
Expand Down Expand Up @@ -2677,6 +2682,44 @@ Eina_Bool ewk_view_setting_enable_hyperlink_auditing_set(Evas_Object* ewkView, E
return true;
}

Eina_Bool ewk_view_setting_allow_universal_access_from_file_urls_set(Evas_Object* ewkView, Eina_Bool enable)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
enable = !!enable;
if (priv->settings.allowUniversalAccessFromFileURLs != enable) {
priv->pageSettings->setAllowUniversalAccessFromFileURLs(enable);
priv->settings.allowUniversalAccessFromFileURLs = enable;
}
return true;
}

Eina_Bool ewk_view_setting_allow_universal_access_from_file_urls_get(const Evas_Object* ewkView)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
return priv->settings.allowUniversalAccessFromFileURLs;
}

Eina_Bool ewk_view_setting_allow_file_access_from_file_urls_set(Evas_Object* ewkView, Eina_Bool enable)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
enable = !!enable;
if (priv->settings.allowFileAccessFromFileURLs != enable) {
priv->pageSettings->setAllowFileAccessFromFileURLs(enable);
priv->settings.allowFileAccessFromFileURLs = enable;
}
return true;
}

Eina_Bool ewk_view_setting_allow_file_access_from_file_urls_get(const Evas_Object* ewkView)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, false);
return priv->settings.allowFileAccessFromFileURLs;
}

Ewk_View_Smart_Data* ewk_view_smart_data_get(const Evas_Object* ewkView)
{
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
Expand Down
52 changes: 52 additions & 0 deletions Source/WebKit/efl/ewk/ewk_view.h
Expand Up @@ -2226,6 +2226,58 @@ EAPI Eina_Bool ewk_view_setting_enable_hyperlink_auditing_get(const Evas_Object
*/
EAPI Eina_Bool ewk_view_setting_enable_hyperlink_auditing_set(Evas_Object *o, Eina_Bool enable);

/**
* Enables/disables allowing universal access from file URLs.
*
* This setting specifies whether locally loaded documents are allowed to access remote urls.
* By default this setting is enabled.
*
* @param o view object to set allowing universal access from file URLs
* @param enable @c EINA_TRUE to enable universal access from file URLs,
* @c EINA_FALSE to disable
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_allow_universal_access_from_file_urls_set(Evas_Object *o, Eina_Bool flag);

/**
* Gets if allowing universal access from file URLs is enabled.
*
* @param o view object to query if allowing universal access from file URLs is enabled.
*
* @return @c EINA_TRUE if allowing universal access from file URLs is enabled, @c EINA_FALSE
* otherwise
*
* @see ewk_view_setting_allow_universal_access_from_file_urls_set()
*/
EAPI Eina_Bool ewk_view_setting_allow_universal_access_from_file_urls_get(const Evas_Object *o);

/**
* Enables/disables allowing file access from file URLs.
*
* This setting specifies whether locally loaded documents are allowed to access other local urls.
* By default this setting is enabled.
*
* @param o view object to set allowing file access from file URLs
* @param enable @c EINA_TRUE to enable file access from file URLs,
* @c EINA_FALSE to disable
*
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure
*/
EAPI Eina_Bool ewk_view_setting_allow_file_access_from_file_urls_set(Evas_Object *o, Eina_Bool flag);

/**
* Gets if allowing file access from file URLs is enabled.
*
* @param o view object to query if allowing file access from file URLs is enabled.
*
* @return @c EINA_TRUE if allowing file access from file URLs is enabled, @c EINA_FALSE
* otherwise
*
* @see ewk_view_setting_allow_file_access_from_file_urls_set()
*/
EAPI Eina_Bool ewk_view_setting_allow_file_access_from_file_urls_get(const Evas_Object *o);

/**
* Gets the internal data of @a o.
*
Expand Down
15 changes: 15 additions & 0 deletions Tools/ChangeLog
@@ -1,3 +1,18 @@
2012-08-29 Kamil Blank <k.blank@samsung.com>

[EFL] Add setting API for allow universal/file access from file URLs.
https://bugs.webkit.org/show_bug.cgi?id=83121

Reviewed by Eric Seidel.

Implementation of setAllowUniversalAccessFromFileURLs and setAllowFileAccessFromFileURLs.

* DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
(DumpRenderTreeChrome::resetDefaultsToConsistentValues):
* DumpRenderTree/efl/TestRunnerEfl.cpp:
(TestRunner::setAllowUniversalAccessFromFileURLs):
(TestRunner::setAllowFileAccessFromFileURLs):

2012-08-29 Jon Lee <jonlee@apple.com>

Update TestRunner API for web notifications
Expand Down
2 changes: 2 additions & 0 deletions Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp
Expand Up @@ -279,6 +279,8 @@ void DumpRenderTreeChrome::resetDefaultsToConsistentValues()
ewk_view_setting_include_links_in_focus_chain_set(mainView(), EINA_FALSE);
ewk_view_setting_scripts_can_access_clipboard_set(mainView(), EINA_TRUE);
ewk_view_setting_web_audio_set(mainView(), EINA_FALSE);
ewk_view_setting_allow_universal_access_from_file_urls_set(mainView(), EINA_TRUE);
ewk_view_setting_allow_file_access_from_file_urls_set(mainView(), EINA_TRUE);

ewk_view_zoom_set(mainView(), 1.0, 0, 0);
ewk_view_scale_set(mainView(), 1.0, 0, 0);
Expand Down
12 changes: 6 additions & 6 deletions Tools/DumpRenderTree/efl/TestRunnerEfl.cpp
Expand Up @@ -365,16 +365,16 @@ void TestRunner::setSpatialNavigationEnabled(bool flag)
ewk_view_setting_spatial_navigation_set(browser->mainView(), flag);
}

void TestRunner::setAllowUniversalAccessFromFileURLs(bool)
void TestRunner::setAllowUniversalAccessFromFileURLs(bool flag)
{
notImplemented();
ewk_view_setting_allow_universal_access_from_file_urls_set(browser->mainView(), flag);
}

void TestRunner::setAllowFileAccessFromFileURLs(bool)
void TestRunner::setAllowFileAccessFromFileURLs(bool flag)
{
notImplemented();
ewk_view_setting_allow_file_access_from_file_urls_set(browser->mainView(), flag);
}

void TestRunner::setAuthorAndUserStylesEnabled(bool flag)
{
DumpRenderTreeSupportEfl::setAuthorAndUserStylesEnabled(browser->mainView(), flag);
Expand Down

0 comments on commit 5f3f1aa

Please sign in to comment.