diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index 8327bdf1fd0f5..465e07b072db8 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,14 @@ +2012-08-29 Kamil Blank + + [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 [chromium] Link highlight should clear on page navigation. diff --git a/LayoutTests/platform/efl/Skipped b/LayoutTests/platform/efl/Skipped index 57978244bf30f..8432a725fc3f6 100644 --- a/LayoutTests/platform/efl/Skipped +++ b/LayoutTests/platform/efl/Skipped @@ -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 diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog index 1d77fa4ea226a..16a891ea0c0df 100644 --- a/Source/WebKit/efl/ChangeLog +++ b/Source/WebKit/efl/ChangeLog @@ -1,3 +1,24 @@ +2012-08-29 Kamil Blank + + [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 [EFL] Add *explicit* keyword to constructors in WebCoreSupport diff --git a/Source/WebKit/efl/ewk/ewk_view.cpp b/Source/WebKit/efl/ewk/ewk_view.cpp index fffea1ef7cdf6..ef609cc52d367 100644 --- a/Source/WebKit/efl/ewk/ewk_view.cpp +++ b/Source/WebKit/efl/ewk/ewk_view.cpp @@ -332,6 +332,8 @@ struct _Ewk_View_Private_Data { } zoomRange; float devicePixelRatio; double domTimerInterval; + bool allowUniversalAccessFromFileURLs : 1; + bool allowFileAccessFromFileURLs : 1; } settings; struct { struct { @@ -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(priv->page->backForwardList())); @@ -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); diff --git a/Source/WebKit/efl/ewk/ewk_view.h b/Source/WebKit/efl/ewk/ewk_view.h index a570d655e9b52..cc1167efb9f96 100644 --- a/Source/WebKit/efl/ewk/ewk_view.h +++ b/Source/WebKit/efl/ewk/ewk_view.h @@ -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. * diff --git a/Tools/ChangeLog b/Tools/ChangeLog index 24dae009d4b0b..d7863e2068b13 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,3 +1,18 @@ +2012-08-29 Kamil Blank + + [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 Update TestRunner API for web notifications diff --git a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp index c167aca51a94e..f05ab458c330c 100644 --- a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp +++ b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp @@ -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); diff --git a/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp b/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp index 8b91080cd466e..b2f332ece48e8 100644 --- a/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp +++ b/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp @@ -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);