Skip to content

Commit 86b265a

Browse files
committed
feat(types): add CSP, keeping existing legacy dictionary members
1 parent 075a935 commit 86b265a

File tree

4 files changed

+79
-4
lines changed

4 files changed

+79
-4
lines changed

baselines/dom.generated.d.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,15 +1604,20 @@ interface ScrollToOptions extends ScrollOptions {
16041604

16051605
interface SecurityPolicyViolationEventInit extends EventInit {
16061606
blockedURI?: string;
1607+
blockedURL?: string;
1608+
colno?: number;
16071609
columnNumber?: number;
1610+
disposition: SecurityPolicyViolationEventDisposition;
16081611
documentURI?: string;
1609-
effectiveDirective?: string;
1612+
documentURL: string;
1613+
effectiveDirective: string;
16101614
lineNumber?: number;
1611-
originalPolicy?: string;
1615+
lineno?: number;
1616+
originalPolicy: string;
16121617
referrer?: string;
1618+
sample?: string;
16131619
sourceFile?: string;
1614-
statusCode?: number;
1615-
violatedDirective?: string;
1620+
statusCode: number;
16161621
}
16171622

16181623
interface ShadowRootInit {
@@ -13452,11 +13457,13 @@ declare var ScriptProcessorNode: {
1345213457
interface SecurityPolicyViolationEvent extends Event {
1345313458
readonly blockedURI: string;
1345413459
readonly columnNumber: number;
13460+
readonly disposition: SecurityPolicyViolationEventDisposition;
1345513461
readonly documentURI: string;
1345613462
readonly effectiveDirective: string;
1345713463
readonly lineNumber: number;
1345813464
readonly originalPolicy: string;
1345913465
readonly referrer: string;
13466+
readonly sample: string;
1346013467
readonly sourceFile: string;
1346113468
readonly statusCode: number;
1346213469
readonly violatedDirective: string;
@@ -18264,6 +18271,7 @@ type ScrollBehavior = "auto" | "smooth";
1826418271
type ScrollLogicalPosition = "center" | "end" | "nearest" | "start";
1826518272
type ScrollRestoration = "auto" | "manual";
1826618273
type ScrollSetting = "" | "up";
18274+
type SecurityPolicyViolationEventDisposition = "enforce" | "report";
1826718275
type SelectionMode = "end" | "preserve" | "select" | "start";
1826818276
type ServiceWorkerState = "activated" | "activating" | "installed" | "installing" | "parsed" | "redundant";
1826918277
type ServiceWorkerUpdateViaCache = "all" | "imports" | "none";

baselines/webworker.generated.d.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,24 @@ interface RsaPssParams extends Algorithm {
509509
saltLength: number;
510510
}
511511

512+
interface SecurityPolicyViolationEventInit extends EventInit {
513+
blockedURI?: string;
514+
blockedURL?: string;
515+
colno?: number;
516+
columnNumber?: number;
517+
disposition: SecurityPolicyViolationEventDisposition;
518+
documentURI?: string;
519+
documentURL: string;
520+
effectiveDirective: string;
521+
lineNumber?: number;
522+
lineno?: number;
523+
originalPolicy: string;
524+
referrer?: string;
525+
sample?: string;
526+
sourceFile?: string;
527+
statusCode: number;
528+
}
529+
512530
interface StorageEstimate {
513531
quota?: number;
514532
usage?: number;
@@ -2701,6 +2719,27 @@ declare var Response: {
27012719
redirect(url: string, status?: number): Response;
27022720
};
27032721

2722+
/** Inherits from Event, and represents the event object of an event sent on a document or worker when its content security policy is violated. */
2723+
interface SecurityPolicyViolationEvent extends Event {
2724+
readonly blockedURI: string;
2725+
readonly columnNumber: number;
2726+
readonly disposition: SecurityPolicyViolationEventDisposition;
2727+
readonly documentURI: string;
2728+
readonly effectiveDirective: string;
2729+
readonly lineNumber: number;
2730+
readonly originalPolicy: string;
2731+
readonly referrer: string;
2732+
readonly sample: string;
2733+
readonly sourceFile: string;
2734+
readonly statusCode: number;
2735+
readonly violatedDirective: string;
2736+
}
2737+
2738+
declare var SecurityPolicyViolationEvent: {
2739+
prototype: SecurityPolicyViolationEvent;
2740+
new(type: string, eventInitDict?: SecurityPolicyViolationEventInit): SecurityPolicyViolationEvent;
2741+
};
2742+
27042743
interface ServiceWorkerEventMap extends AbstractWorkerEventMap {
27052744
"statechange": Event;
27062745
}
@@ -5781,6 +5820,7 @@ type RequestMode = "cors" | "navigate" | "no-cors" | "same-origin";
57815820
type RequestRedirect = "error" | "follow" | "manual";
57825821
type ResizeQuality = "high" | "low" | "medium" | "pixelated";
57835822
type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect";
5823+
type SecurityPolicyViolationEventDisposition = "enforce" | "report";
57845824
type ServiceWorkerState = "activated" | "activating" | "installed" | "installing" | "parsed" | "redundant";
57855825
type ServiceWorkerUpdateViaCache = "all" | "imports" | "none";
57865826
type VisibilityState = "hidden" | "visible";

inputfiles/idlSources.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
"title": "Compatibility",
1515
"shortName": "compat"
1616
},
17+
{
18+
"url": "https://w3c.github.io/webappsec-csp/",
19+
"title": "Content Security Policy",
20+
"shortName": "CSP"
21+
},
1722
{
1823
"url": "https://w3c.github.io/requestidlecallback/",
1924
"title": "Cooperative Scheduling of Background Tasks",

inputfiles/overridingTypes.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3178,6 +3178,28 @@
31783178
}
31793179
}
31803180
},
3181+
"SecurityPolicyViolationEventInit": {
3182+
"members": {
3183+
"member": {
3184+
"documentURI": {
3185+
"name": "documentURI",
3186+
"type": "DOMString"
3187+
},
3188+
"blockedURI": {
3189+
"name": "blockedURI",
3190+
"type": "DOMString"
3191+
},
3192+
"lineNumber": {
3193+
"name": "lineNumber",
3194+
"type": "unsigned long"
3195+
},
3196+
"columnNumber": {
3197+
"name": "columnNumber",
3198+
"type": "unsigned long"
3199+
}
3200+
}
3201+
}
3202+
},
31813203
"UnderlyingSource": {
31823204
"type-parameters": [
31833205
{

0 commit comments

Comments
 (0)