LayoutTests/ChangeLog

 12012-04-11 Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com>
 2
 3 [EFL] Add setting API to enable/disable XSSAuditor
 4 https://bugs.webkit.org/show_bug.cgi?id=83281
 5
 6 Unskip tests in http/tests/security/xssAuditor
 7
 8 Reviewed by NOBODY (OOPS!).
 9
 10 * platform/efl/Skipped:
 11
1122012-04-10 Christophe Dumez <christophe.dumez@intel.com>
213
314 [EFL] DRT should support LayoutTestController's dumpFrameLoadCallbacks()

LayoutTests/platform/efl/Skipped

@@plugins/netscape-plugin-setwindow-size-2.html
408408# EFL's LayoutTestController does not implement setJavaScriptCanAccessClipboard
409409editing/execCommand/clipboard-access.html
410410
411 # EFL's LayoutTestController does not implement setXSSAuditorEnabled
412 http/tests/security/xssAuditor
413 
414411# EFL's LayoutTestController does not implement setAllowUniversalAccessFromFileURLs
415412# EFL's LayoutTestController does not implement setAllowAccessFromFileURLs
416413fast/files/workers/inline-worker-via-blob-url.html

Source/WebKit/efl/ChangeLog

 12012-04-11 Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com>
 2
 3 [EFL] Add setting API to enable/disable XSSAuditor
 4 https://bugs.webkit.org/show_bug.cgi?id=83281
 5
 6 Add setting API to enable or disable WebKit's XSSAuditor to protect
 7 from reflective cross-site scripting attacks. Also, emit the signal
 8 'xss,detected' and provide addition information received from
 9 XSSAuditor when reflected XSS is encountered in the page.
 10
 11 Reviewed by NOBODY (OOPS!).
 12
 13 * WebCoreSupport/FrameLoaderClientEfl.cpp:
 14 (WebCore::FrameLoaderClientEfl::didDetectXSS):
 15 * ewk/ewk_frame.cpp:
 16 (ewk_frame_xss_detected):
 17 * ewk/ewk_frame.h:
 18 * ewk/ewk_private.h:
 19 * ewk/ewk_view.cpp:
 20 (_Ewk_View_Private_Data):
 21 (_ewk_view_priv_new):
 22 (ewk_view_setting_enable_xss_auditor_get):
 23 (ewk_view_setting_enable_xss_auditor_set):
 24 * ewk/ewk_view.h:
 25
1262012-04-10 Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com>
227
328 [EFL] LayoutTestController needs implementation of addUserStyleSheet

Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp

@@void FrameLoaderClientEfl::didRunInsecureContent(SecurityOrigin*, const KURL&)
496496 ewk_frame_mixed_content_run_set(m_frame, true);
497497}
498498
499 void FrameLoaderClientEfl::didDetectXSS(const KURL&, bool)
 499void FrameLoaderClientEfl::didDetectXSS(const KURL& insecureURL, bool didBlockEntirePage)
500500{
501  notImplemented();
 501 CString cs = insecureURL.string().utf8();
 502 Ewk_Frame_Xss_Notification xssInfo = { cs.data(), didBlockEntirePage };
 503
 504 ewk_frame_xss_detected(m_frame, &xssInfo);
502505}
503506
504507void FrameLoaderClientEfl::makeRepresentation(DocumentLoader*)

Source/WebKit/efl/ewk/ewk_frame.cpp

@@void ewk_frame_mixed_content_run_set(Evas_Object* ewkFrame, bool hasRun)
17751775 }
17761776}
17771777
 1778/**
 1779 * @internal
 1780 * Reports that reflected XSS is encountered in the page and suppressed.
 1781 *
 1782 * @param xssInfo Information received from the XSSAuditor when XSS is
 1783 * encountered in the page.
 1784 *
 1785 * Emits signal: "xss,detected" with pointer to Ewk_Frame_Xss_Notification.
 1786 */
 1787void ewk_frame_xss_detected(Evas_Object* ewkFrame, const Ewk_Frame_Xss_Notification *xssInfo)
 1788{
 1789 evas_object_smart_callback_call(ewkFrame, "xss,detected", (void*)xssInfo);
 1790}
 1791
17781792namespace EWKPrivate {
17791793
17801794WebCore::Frame* coreFrame(const Evas_Object* ewkFrame)

Source/WebKit/efl/ewk/ewk_frame.h

6363 * - "state,save", void: frame's state will be saved as a history item.
6464 * - "title,changed", const char*: title of the main frame was changed.
6565 * - "uri,changed", const char*: uri of the main frame was changed.
 66 * - "xss,detected", Ewk_Frame_Xss_Notification*: reflected XSS is encountered in the page and suppressed.
6667 */
6768
6869#ifndef ewk_frame_h

@@struct _Ewk_Frame_Resource_Request {
111112 Eina_Bool is_main_frame_request; /** < indicates if the request is for the main frame */
112113};
113114
 115/// Creates a type name for Ewk_Frame_Xss_Notification.
 116typedef struct _Ewk_Frame_Xss_Notification Ewk_Frame_Xss_Notification;
 117
 118/**
 119 * @brief Structure used to report reflected XSS is encountered in the page.
 120 *
 121 * This structure contains information received from the XSSAuditor when reflected XSS
 122 * is encountered in the page. The string is temporary reference and should @b not
 123 * be used after the signal callback returns. If it's required, make a copy of it.
 124 */
 125struct _Ewk_Frame_Xss_Notification {
 126 const char *insecure_url; /**< insecure url of the document */
 127 Eina_Bool is_entire_page_blocked; /** < indicates if the entire page was blocked by XSSAuditor */
 128};
 129
114130/// Enum containing hit test data types
115131typedef enum {
116132 EWK_HIT_TEST_RESULT_CONTEXT_DOCUMENT = 1 << 1,

Source/WebKit/efl/ewk/ewk_private.h

@@void ewk_frame_mixed_content_displayed_set(Evas_Object* ewkFrame, bool hasDispla
243243void ewk_frame_mixed_content_run_set(Evas_Object* ewkFrame, bool hasRun);
244244void ewk_view_mixed_content_displayed_set(Evas_Object* ewkView, bool hasDisplayed);
245245void ewk_view_mixed_content_run_set(Evas_Object* ewkView, bool hasRun);
 246void ewk_frame_xss_detected(Evas_Object* ewkFrame, const Ewk_Frame_Xss_Notification* xssInfo);
246247
247248#if USE(ACCELERATED_COMPOSITING)
248249bool ewk_view_accelerated_compositing_object_create(Evas_Object* ewkView, Evas_Native_Surface* nativeSurface, const WebCore::IntRect& rect);

Source/WebKit/efl/ewk/ewk_view.cpp

@@struct _Ewk_View_Private_Data {
207207 bool localStorage : 1;
208208 bool offlineAppCache : 1;
209209 bool pageCache : 1;
 210 bool enableXSSAuditor : 1;
210211 struct {
211212 float minScale;
212213 float maxScale;

@@static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData)
665666 priv->pageSettings->setUsesPageCache(true);
666667 priv->pageSettings->setUsesEncodingDetector(false);
667668 priv->pageSettings->setWebGLEnabled(true);
 669 priv->pageSettings->setXSSAuditorEnabled(true);
668670
669671 url = priv->pageSettings->userStyleSheetLocation();
670672 priv->settings.userStylesheet = eina_stringshare_add(url.string().utf8().data());

@@static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData)
701703 priv->settings.enableScripts = priv->pageSettings->isScriptEnabled();
702704 priv->settings.enablePlugins = priv->pageSettings->arePluginsEnabled();
703705 priv->settings.enableFrameFlattening = priv->pageSettings->frameFlatteningEnabled();
 706 priv->settings.enableXSSAuditor = priv->pageSettings->xssAuditorEnabled();
704707 priv->settings.scriptsCanOpenWindows = priv->pageSettings->javaScriptCanOpenWindowsAutomatically();
705708 priv->settings.scriptsCanCloseWindows = priv->pageSettings->allowScriptsToCloseWindows();
706709 priv->settings.resizableTextareas = priv->pageSettings->textAreasAreResizable();

@@void ewk_view_soup_session_set(Evas_Object* ewkView, SoupSession* session)
39533956 priv->soupSession = session;
39543957}
39553958
 3959Eina_Bool ewk_view_setting_enable_xss_auditor_get(const Evas_Object* ewkView)
 3960{
 3961 EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, EINA_FALSE);
 3962 EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, EINA_FALSE);
 3963 return priv->settings.enableXSSAuditor;
 3964}
 3965
 3966void ewk_view_setting_enable_xss_auditor_set(Evas_Object* ewkView, Eina_Bool enable)
 3967{
 3968 EWK_VIEW_SD_GET(ewkView, smartData);
 3969 EWK_VIEW_PRIV_GET(smartData, priv);
 3970 enable = !!enable;
 3971 if (priv->settings.enableXSSAuditor != enable) {
 3972 priv->pageSettings->setXSSAuditorEnabled(enable);
 3973 priv->settings.enableXSSAuditor = enable;
 3974 }
 3975}
 3976
39563977#if USE(ACCELERATED_COMPOSITING)
39573978bool ewk_view_accelerated_compositing_object_create(Evas_Object* ewkView, Evas_Native_Surface* nativeSurface, const WebCore::IntRect& rect)
39583979{

Source/WebKit/efl/ewk/ewk_view.h

@@EAPI SoupSession* ewk_view_soup_session_get(const Evas_Object *o);
23682368 */
23692369EAPI void ewk_view_soup_session_set(Evas_Object *o, SoupSession *session);
23702370
 2371/**
 2372 * Returns whether XSSAuditor feature is enabled.
 2373 *
 2374 * @param o view object to query whether XSSAuditor feature is enabled.
 2375 *
 2376 * @return @c EINA_TRUE if the XSSAuditor feature is enabled,
 2377 * @c EINA_FALSE if not or on failure.
 2378 */
 2379EAPI Eina_Bool ewk_view_setting_enable_xss_auditor_get(const Evas_Object *o);
 2380
 2381/**
 2382 * Enables/disables the XSSAuditor feature.
 2383 *
 2384 * The XSSAuditor (cross-site scripting protection) feature provides protection
 2385 * from reflected XSS attacks on vulnerable web sites. It notifies FrameLoaderClient
 2386 * with didDetectXSS when XSS is encountered in the page and provides additional
 2387 * information on whether the entire page was blocked or only injected scripts were
 2388 * removed. This feature is enabled by default.
 2389 *
 2390 * @param o view object to set the XSSAuditor feature.
 2391 * @param enable @c EINA_TRUE to enable the XSSAuditor feature,
 2392 * @c EINA_FALSE to disable.
 2393 */
 2394EAPI void ewk_view_setting_enable_xss_auditor_set(Evas_Object *o, Eina_Bool enable);
 2395
23712396#ifdef __cplusplus
23722397}
23732398#endif

Tools/ChangeLog

 12012-04-11 Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com>
 2
 3 [EFL] Add setting API to enable/disable XSSAuditor
 4 https://bugs.webkit.org/show_bug.cgi?id=83281
 5
 6 Add missing implementation setXSSAuditorEnabled to EFL's LayoutTestController
 7 in order to unskip tests in http/tests/security/xssAuditor. Also, catch the signal
 8 'xss,detected' in DRT to enable a test, which is expecting a line containing
 9 'didDetectXSS' in the output when reflected XSS is encountered in the page.
 10
 11 Reviewed by NOBODY (OOPS!).
 12
 13 * DumpRenderTree/efl/DumpRenderTreeChrome.cpp:
 14 (DumpRenderTreeChrome::createView):
 15 (DumpRenderTreeChrome::onDidDetectXSS):
 16 (DumpRenderTreeChrome::onFrameCreated):
 17 * DumpRenderTree/efl/DumpRenderTreeChrome.h:
 18 (DumpRenderTreeChrome):
 19 * DumpRenderTree/efl/LayoutTestControllerEfl.cpp:
 20 (LayoutTestController::setXSSAuditorEnabled):
 21
1222012-04-10 Kent Tamura <tkent@chromium.org>
223
324 Unreviewed. Using tkent+wkapi@ for ChromiumPublicApi notifications.

Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp

@@Evas_Object* DumpRenderTreeChrome::createView() const
105105 evas_object_smart_callback_add(mainFrame, "load,committed", onFrameLoadCommitted, 0);
106106 evas_object_smart_callback_add(mainFrame, "load,finished", onFrameLoadFinished, 0);
107107 evas_object_smart_callback_add(mainFrame, "load,error", onFrameLoadError, 0);
 108 evas_object_smart_callback_add(mainFrame, "xss,detected", onDidDetectXSS, 0);
108109
109110 return view;
110111}

@@void DumpRenderTreeChrome::onLoadStarted(void*, Evas_Object* view, void*)
240241 topLoadingFrame = frame;
241242}
242243
 244void DumpRenderTreeChrome::onDidDetectXSS(void*, Evas_Object* view, void*)
 245{
 246 if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
 247 printf("didDetectXSS\n");
 248}
 249
243250Eina_Bool DumpRenderTreeChrome::processWork(void* data)
244251{
245252 if (WorkQueue::shared()->processWork() && !gLayoutTestController->waitToDump())

@@void DumpRenderTreeChrome::onFrameCreated(void*, Evas_Object*, void* eventInfo)
346353 evas_object_smart_callback_add(frame, "load,committed", onFrameLoadCommitted, 0);
347354 evas_object_smart_callback_add(frame, "load,finished", onFrameLoadFinished, 0);
348355 evas_object_smart_callback_add(frame, "load,error", onFrameLoadError, 0);
 356 evas_object_smart_callback_add(frame, "xss,detected", onDidDetectXSS, 0);
349357}
350358
351359void DumpRenderTreeChrome::onFrameProvisionalLoad(void*, Evas_Object* frame, void*)

Tools/DumpRenderTree/efl/DumpRenderTreeChrome.h

@@private:
9393 static void onFrameLoadFinished(void*, Evas_Object*, void*);
9494
9595 static void onFrameLoadError(void*, Evas_Object*, void*);
 96 static void onDidDetectXSS(void*, Evas_Object*, void*);
9697};
9798
9899#endif // DumpRenderTreeChrome_h

Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp

@@void LayoutTestController::setJavaScriptCanAccessClipboard(bool)
325325 notImplemented();
326326}
327327
328 void LayoutTestController::setXSSAuditorEnabled(bool)
 328void LayoutTestController::setXSSAuditorEnabled(bool flag)
329329{
330  notImplemented();
 330 ewk_view_setting_enable_xss_auditor_set(browser->mainView(), flag);
331331}
332332
333333void LayoutTestController::setFrameFlatteningEnabled(bool flag)