Commit 5bcd6dde authored by mkwst@chromium.org's avatar mkwst@chromium.org

CSP 1.1: Stub out SecurityPolicyViolationEvent interface.

https://bugs.webkit.org/show_bug.cgi?id=112681

Reviewed by Adam Barth.

Source/WebCore:

A first pass at a SecurityPolicyViolationEvent interface is defined in
CSP 1.1's editor's draft[1]. This patch puts the big components into
place so that we can start getting some implementation experience with
the new event interface as it's defined, and feed that back into the
working group.

Here, we're only defining the interface, and creating a listener on the
Document. Events aren't yet being fired when Content Security Policy
violations occur. I'll tackle that in a future patch; adding files is
a big enough annoyance to do it separately.

This patch has only two web-visible impacts:

- Document objects now have an 'onsecuritypolicyviolation' attribute.
- A SecurityPolicyViolationEvent constructor is accessible on the Window object.

Ports that have not enabled the CSP_NEXT flag should experience no change.

[1]: https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#securitypolicyviolationevent-events

Test: http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-basics.html

* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
    Wow! A new file! This is so exciting! I'm going to tell ALL my build
    systems about this!
* dom/Document.h:
* dom/Document.idl:
    Define an 'onsecuritypolicyviolation' event handler on Document objects.
* dom/EventNames.h:
* dom/EventNames.in:
    Define a 'securitypolicyviolation' event type.
* dom/SecurityPolicyViolationEvent.h: Added.
(WebCore::SecurityPolicyViolationEventInit::SecurityPolicyViolationEventInit):
(SecurityPolicyViolationEventInit):
(SecurityPolicyViolationEvent):
(WebCore::SecurityPolicyViolationEvent::create):
(WebCore::SecurityPolicyViolationEvent::documentURI):
(WebCore::SecurityPolicyViolationEvent::referrer):
(WebCore::SecurityPolicyViolationEvent::blockedURI):
(WebCore::SecurityPolicyViolationEvent::violatedDirective):
(WebCore::SecurityPolicyViolationEvent::effectiveDirective):
(WebCore::SecurityPolicyViolationEvent::originalPolicy):
(WebCore::SecurityPolicyViolationEvent::sourceURL):
(WebCore::SecurityPolicyViolationEvent::lineNumber):
(WebCore::SecurityPolicyViolationEvent::interfaceName):
(WebCore::SecurityPolicyViolationEvent::SecurityPolicyViolationEvent):
* dom/SecurityPolicyViolationEvent.idl: Added.
    Define the SecurityPolicyViolationEvent's IDL, and then create all the
    boilerplate necessary to properly initialize a SecurityPolicyViolationEvent
    object with the relevant properties.
* page/DOMWindow.idl:
    Add the new SecurityPolicyViolationEvent constructor to the Window object
    so it's available on a page.

LayoutTests:

* http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-basics-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-basics.html: Added.
    Simple test which checks only that events are created correctly,
    and that the event handler exists on Document. We'll test the
    real functionality once we wire the event up to the handler.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146305 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bd752ec1
2013-03-19 Mike West <mkwst@chromium.org>
CSP 1.1: Stub out SecurityPolicyViolationEvent interface.
https://bugs.webkit.org/show_bug.cgi?id=112681
Reviewed by Adam Barth.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-basics-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-basics.html: Added.
Simple test which checks only that events are created correctly,
and that the event handler exists on Document. We'll test the
real functionality once we wire the event up to the handler.
2013-03-19 Ryosuke Niwa <rniwa@webkit.org>
Qt and GTK+ rebaselines after r146272.
Check that a SecurityPolicyViolationEvent handler exists, and that events can be created.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS typeof document.onsecuritypolicyviolation is "object"
PASS typeof SecurityPolicyViolationEvent is "function"
PASS typeof window.e is "object"
PASS window.e.documentURI is "documentURIValue"
PASS window.e.referrer is "referrerValue"
PASS window.e.blockedURI is "blockedURIValue"
PASS window.e.violatedDirective is "violatedDirectiveValue"
PASS window.e.effectiveDirective is "effectiveDirectiveValue"
PASS window.e.originalPolicy is "originalPolicyValue"
PASS window.e.sourceURL is "sourceURLValue"
PASS window.e.lineNumber is 1
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE html>
<html>
<head>
<script src="/js-test-resources/js-test-pre.js"></script>
<script>
description('Check that a SecurityPolicyViolationEvent handler exists, and that events can be created.');
try {
shouldBeEqualToString('typeof document.onsecuritypolicyviolation', 'object');
shouldBeEqualToString('typeof SecurityPolicyViolationEvent', 'function');
var data = {
'documentURI': 'documentURIValue',
'referrer': 'referrerValue',
'blockedURI': 'blockedURIValue',
'violatedDirective': 'violatedDirectiveValue',
'effectiveDirective': 'effectiveDirectiveValue',
'originalPolicy': 'originalPolicyValue',
'sourceURL': 'sourceURLValue',
'lineNumber': 1
};
window.e = new SecurityPolicyViolationEvent('SecurityPolicyViolation', data);
shouldBeEqualToString('typeof window.e', 'object');
for (key in data)
shouldBe('window.e.' + key, JSON.stringify(data[key]));
} catch (ex) {
testFailed('Exception thrown: ' + ex.message);
}
</script>
<script src="/js-test-resources/js-test-post.js"></script>
</head>
<body>
</body>
</html>
......@@ -385,6 +385,7 @@ set(WebCore_IDL_FILES
dom/RangeException.idl
dom/Range.idl
dom/RequestAnimationFrameCallback.idl
dom/SecurityPolicyViolationEvent.idl
dom/ShadowRoot.idl
dom/StringCallback.idl
dom/TextEvent.idl
......
2013-03-19 Mike West <mkwst@chromium.org>
CSP 1.1: Stub out SecurityPolicyViolationEvent interface.
https://bugs.webkit.org/show_bug.cgi?id=112681
Reviewed by Adam Barth.
A first pass at a SecurityPolicyViolationEvent interface is defined in
CSP 1.1's editor's draft[1]. This patch puts the big components into
place so that we can start getting some implementation experience with
the new event interface as it's defined, and feed that back into the
working group.
Here, we're only defining the interface, and creating a listener on the
Document. Events aren't yet being fired when Content Security Policy
violations occur. I'll tackle that in a future patch; adding files is
a big enough annoyance to do it separately.
This patch has only two web-visible impacts:
- Document objects now have an 'onsecuritypolicyviolation' attribute.
- A SecurityPolicyViolationEvent constructor is accessible on the Window object.
Ports that have not enabled the CSP_NEXT flag should experience no change.
[1]: https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#securitypolicyviolationevent-events
Test: http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-basics.html
* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
Wow! A new file! This is so exciting! I'm going to tell ALL my build
systems about this!
* dom/Document.h:
* dom/Document.idl:
Define an 'onsecuritypolicyviolation' event handler on Document objects.
* dom/EventNames.h:
* dom/EventNames.in:
Define a 'securitypolicyviolation' event type.
* dom/SecurityPolicyViolationEvent.h: Added.
(WebCore::SecurityPolicyViolationEventInit::SecurityPolicyViolationEventInit):
(SecurityPolicyViolationEventInit):
(SecurityPolicyViolationEvent):
(WebCore::SecurityPolicyViolationEvent::create):
(WebCore::SecurityPolicyViolationEvent::documentURI):
(WebCore::SecurityPolicyViolationEvent::referrer):
(WebCore::SecurityPolicyViolationEvent::blockedURI):
(WebCore::SecurityPolicyViolationEvent::violatedDirective):
(WebCore::SecurityPolicyViolationEvent::effectiveDirective):
(WebCore::SecurityPolicyViolationEvent::originalPolicy):
(WebCore::SecurityPolicyViolationEvent::sourceURL):
(WebCore::SecurityPolicyViolationEvent::lineNumber):
(WebCore::SecurityPolicyViolationEvent::interfaceName):
(WebCore::SecurityPolicyViolationEvent::SecurityPolicyViolationEvent):
* dom/SecurityPolicyViolationEvent.idl: Added.
Define the SecurityPolicyViolationEvent's IDL, and then create all the
boilerplate necessary to properly initialize a SecurityPolicyViolationEvent
object with the relevant properties.
* page/DOMWindow.idl:
Add the new SecurityPolicyViolationEvent constructor to the Window object
so it's available on a page.
2013-03-19 Eugene Klyuchnikov <eustas@chromium.org>
Web Inspector: [Timeline] Tune status bar UI for limited-width window.
......@@ -675,6 +675,8 @@ webcore_built_sources += \
DerivedSources/WebCore/JSScriptProfile.h \
DerivedSources/WebCore/JSScriptProfileNode.cpp \
DerivedSources/WebCore/JSScriptProfileNode.h \
DerivedSources/WebCore/JSSecurityPolicyViolationEvent.cpp \
DerivedSources/WebCore/JSSecurityPolicyViolationEvent.h \
DerivedSources/WebCore/JSShadowRoot.cpp \
DerivedSources/WebCore/JSShadowRoot.h \
DerivedSources/WebCore/JSSharedWorkerContext.cpp \
......@@ -1426,6 +1428,7 @@ dom_binding_idls += \
$(WebCore)/dom/Range.idl \
$(WebCore)/dom/RangeException.idl \
$(WebCore)/dom/RequestAnimationFrameCallback.idl \
$(WebCore)/dom/SecurityPolicyViolationEvent.idl \
$(WebCore)/dom/ShadowRoot.idl \
$(WebCore)/dom/StringCallback.idl \
$(WebCore)/dom/Text.idl \
......@@ -3032,6 +3035,7 @@ webcore_sources += \
Source/WebCore/dom/ScriptRunner.h \
Source/WebCore/dom/SecurityContext.cpp \
Source/WebCore/dom/SecurityContext.h \
Source/WebCore/dom/SecurityPolicyViolationEvent.h \
Source/WebCore/dom/SelectorQuery.cpp \
Source/WebCore/dom/SelectorQuery.h \
Source/WebCore/dom/ShadowRoot.cpp \
......
......@@ -338,6 +338,7 @@
'dom/Range.idl',
'dom/RangeException.idl',
'dom/RequestAnimationFrameCallback.idl',
'dom/SecurityPolicyViolationEvent.idl',
'dom/ShadowRoot.idl',
'dom/StringCallback.idl',
'dom/Text.idl',
......@@ -3066,6 +3067,7 @@
'dom/ScriptedAnimationController.h',
'dom/SecurityContext.cpp',
'dom/SecurityContext.h',
'dom/SecurityPolicyViolationEvent.h',
'dom/SelectorQuery.cpp',
'dom/SelectorQuery.h',
'dom/ShadowRoot.cpp',
......@@ -7236,6 +7238,8 @@
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSScriptProfile.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSScriptProfileNode.cpp',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSScriptProfileNode.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSSecurityPolicyViolationEvent.cpp',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSSecurityPolicyViolationEvent.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSSharedWorker.cpp',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSSharedWorker.h',
'<(PRODUCT_DIR)/DerivedSources/WebCore/JSSharedWorkerContext.cpp',
......
......@@ -13858,6 +13858,62 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSSecurityPolicyViolationEvent.cpp"
>
<FileConfiguration
Name="Debug|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug_Cairo_CFLite|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Release_Cairo_CFLite|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug_All|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
Name="Production|Win32"
ExcludedFromBuild="true"
>
<Tool
Name="VCCLCompilerTool"
/>
</FileConfiguration>
</File>
<File
RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSSecurityPolicyViolationEvent.h"
>
</File>
<File
RelativePath="$(ConfigurationBuildDir)\obj\WebCore\DerivedSources\JSShadowRoot.h"
>
......@@ -55306,6 +55362,10 @@
RelativePath="..\dom\SecurityContext.h"
>
</File>
<File
RelativePath="..\dom\SecurityPolicyViolationEvent.h"
>
</File>
<File
RelativePath="..\dom\SelectorQuery.cpp"
>
......@@ -795,6 +795,7 @@
2D481F04146B5C6B00AA7834 /* GeneratorGeneratedImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D2FC0571460CD6F00263633 /* GeneratorGeneratedImage.h */; };
2D5A592F152525230036EE51 /* ImageOrientation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8748D7412CC3F89001FBA41 /* ImageOrientation.cpp */; };
2D5A5931152525D00036EE51 /* ImageOrientation.h in Headers */ = {isa = PBXBuildFile; fileRef = A8748D6612CC3763001FBA41 /* ImageOrientation.h */; settings = {ATTRIBUTES = (Private, ); }; };
2D5BC42716F882EE007048D0 /* SecurityPolicyViolationEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D5BC42516F882BE007048D0 /* SecurityPolicyViolationEvent.h */; };
2D8287F616E4A0380086BD00 /* HitTestLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D8287F416E4A0380086BD00 /* HitTestLocation.cpp */; };
2D8287F716E4A0380086BD00 /* HitTestLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D8287F516E4A0380086BD00 /* HitTestLocation.h */; settings = {ATTRIBUTES = (Private, ); }; };
2D8FEBDC143E3EF70072502B /* CSSCrossfadeValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D8FEBDA143E3EF70072502B /* CSSCrossfadeValue.cpp */; };
......@@ -8184,6 +8185,8 @@
2D2FC0561460CD6F00263633 /* GeneratorGeneratedImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GeneratorGeneratedImage.cpp; sourceTree = "<group>"; };
2D2FC0571460CD6F00263633 /* GeneratorGeneratedImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeneratorGeneratedImage.h; sourceTree = "<group>"; };
2D3A0E3513A7D76100E85AF0 /* SVGParsingError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGParsingError.h; sourceTree = "<group>"; };
2D5BC42516F882BE007048D0 /* SecurityPolicyViolationEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecurityPolicyViolationEvent.h; sourceTree = "<group>"; };
2D5BC42616F882BE007048D0 /* SecurityPolicyViolationEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SecurityPolicyViolationEvent.idl; sourceTree = "<group>"; };
2D8287F416E4A0380086BD00 /* HitTestLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HitTestLocation.cpp; sourceTree = "<group>"; };
2D8287F516E4A0380086BD00 /* HitTestLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HitTestLocation.h; sourceTree = "<group>"; };
2D8FEBDA143E3EF70072502B /* CSSCrossfadeValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSCrossfadeValue.cpp; sourceTree = "<group>"; };
......@@ -22908,6 +22911,8 @@
8A413ADE1207BBA50082016E /* ScriptRunner.h */,
976F36E814686225005E93B4 /* SecurityContext.cpp */,
976F36E914686225005E93B4 /* SecurityContext.h */,
2D5BC42516F882BE007048D0 /* SecurityPolicyViolationEvent.h */,
2D5BC42616F882BE007048D0 /* SecurityPolicyViolationEvent.idl */,
E45322A9140CE267005A0F92 /* SelectorQuery.cpp */,
E45322AA140CE267005A0F92 /* SelectorQuery.h */,
A6D169611346B49B000EB770 /* ShadowRoot.cpp */,
......@@ -26764,6 +26769,7 @@
977E2E0F12F0FC9C00C13380 /* XSSAuditorDelegate.h in Headers */,
FD537353137B651800008DCE /* ZeroPole.h in Headers */,
DAED203116F244480070EC0F /* PageConsole.h in Headers */,
2D5BC42716F882EE007048D0 /* SecurityPolicyViolationEvent.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -307,6 +307,9 @@ public:
#if ENABLE(PAGE_VISIBILITY_API)
DEFINE_ATTRIBUTE_EVENT_LISTENER(webkitvisibilitychange);
#endif
#if ENABLE(CSP_NEXT)
DEFINE_ATTRIBUTE_EVENT_LISTENER(securitypolicyviolation);
#endif
void setViewportArguments(const ViewportArguments& viewportArguments) { m_viewportArguments = viewportArguments; }
ViewportArguments viewportArguments() const { return m_viewportArguments; }
......
......@@ -341,6 +341,7 @@
[NotEnumerable, Conditional=FULLSCREEN_API] attribute EventListener onwebkitfullscreenerror;
[NotEnumerable, Conditional=POINTER_LOCK] attribute EventListener onwebkitpointerlockchange;
[NotEnumerable, Conditional=POINTER_LOCK] attribute EventListener onwebkitpointerlockerror;
[NotEnumerable, Conditional=CSP_NEXT, V8EnabledAtRuntime=experimentalContentSecurityPolicyFeatures] attribute EventListener onsecuritypolicyviolation;
#endif
#if defined(ENABLE_TOUCH_EVENTS) && ENABLE_TOUCH_EVENTS
......
......@@ -259,6 +259,8 @@ namespace WebCore {
macro(webkitprerenderload) \
macro(webkitprerenderdomcontentloaded) \
\
macro(securitypolicyviolation) \
\
// end of DOM_EVENT_NAMES_FOR_EACH
......
......@@ -57,3 +57,4 @@ MediaKeyNeededEvent conditional=ENCRYPTED_MEDIA_V2
TrackEvent conditional=VIDEO_TRACK
AutocompleteErrorEvent conditional=REQUEST_AUTOCOMPLETE
CSSFontFaceLoadEvent conditional=FONT_LOAD_EVENTS
SecurityPolicyViolationEvent conditional=CSP_NEXT
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SecurityPolicyViolationEvent_h
#define SecurityPolicyViolationEvent_h
#if ENABLE(CSP_NEXT)
#include "Event.h"
#include "EventNames.h"
namespace WebCore {
struct SecurityPolicyViolationEventInit : public EventInit {
SecurityPolicyViolationEventInit()
{
}
String documentURI;
String referrer;
String blockedURI;
String violatedDirective;
String effectiveDirective;
String originalPolicy;
String sourceURL;
int lineNumber;
};
class SecurityPolicyViolationEvent : public Event {
public:
static PassRefPtr<SecurityPolicyViolationEvent> create()
{
return adoptRef(new SecurityPolicyViolationEvent());
}
static PassRefPtr<SecurityPolicyViolationEvent> create(const AtomicString& type, const SecurityPolicyViolationEventInit& initializer)
{
return adoptRef(new SecurityPolicyViolationEvent(type, initializer));
}
const String& documentURI() const { return m_documentURI; }
const String& referrer() const { return m_referrer; }
const String& blockedURI() const { return m_blockedURI; }
const String& violatedDirective() const { return m_violatedDirective; }
const String& effectiveDirective() const { return m_effectiveDirective; }
const String& originalPolicy() const { return m_originalPolicy; }
const String& sourceURL() const { return m_sourceURL; }
int lineNumber() const { return m_lineNumber; }
virtual const AtomicString& interfaceName() const { return eventNames().interfaceForSecurityPolicyViolationEvent; }
private:
SecurityPolicyViolationEvent()
{
}
SecurityPolicyViolationEvent(const AtomicString& type, const SecurityPolicyViolationEventInit& initializer)
: Event(type, initializer)
, m_documentURI(initializer.documentURI)
, m_referrer(initializer.referrer)
, m_blockedURI(initializer.blockedURI)
, m_violatedDirective(initializer.violatedDirective)
, m_effectiveDirective(initializer.effectiveDirective)
, m_originalPolicy(initializer.originalPolicy)
, m_sourceURL(initializer.sourceURL)
, m_lineNumber(initializer.lineNumber)
{
}
String m_documentURI;
String m_referrer;
String m_blockedURI;
String m_violatedDirective;
String m_effectiveDirective;
String m_originalPolicy;
String m_sourceURL;
int m_lineNumber;
};
} // namespace WebCore
#endif // ENABLE(CSP_NEXT)
#endif // SecurityPolicyViolationEvent_h
/*
* Copyright (C) 2013 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
[
Conditional=CSP_NEXT,
ConstructorTemplate=Event,
] interface SecurityPolicyViolationEvent : Event {
[InitializedByEventConstructor] readonly attribute DOMString documentURI;
[InitializedByEventConstructor] readonly attribute DOMString referrer;
[InitializedByEventConstructor] readonly attribute DOMString blockedURI;
[InitializedByEventConstructor] readonly attribute DOMString violatedDirective;
[InitializedByEventConstructor] readonly attribute DOMString effectiveDirective;
[InitializedByEventConstructor] readonly attribute DOMString originalPolicy;
[InitializedByEventConstructor] readonly attribute DOMString sourceURL;
[InitializedByEventConstructor] readonly attribute long lineNumber;
};
......@@ -570,6 +570,7 @@
[Conditional=WEBGL] attribute WebGLContextEventConstructor WebGLContextEvent;
[Conditional=PROXIMITY_EVENTS] attribute DeviceProximityEventConstructor DeviceProximityEvent;
[Conditional=REQUEST_AUTOCOMPLETE] attribute AutocompleteErrorEventConstructor AutocompleteErrorEvent;
[Conditional=CSP_NEXT, V8EnabledAtRuntime=experimentalContentSecurityPolicyFeatures] attribute SecurityPolicyViolationEventConstructor SecurityPolicyViolationEvent;
attribute EventExceptionConstructor EventException;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment