Commit 853b29d0 authored by Mike West's avatar Mike West Committed by Commit Bot

[TrustedTypes] Lock the API to secure contexts.

This addresses only the IDL changes. We'll need to decide how the CSP
integration ought to work (e.g. whether `require-sri-for` has any
impact on non-secure pages) in the next CL.

Bug: 1059554
Change-Id: Ie67a3cc1dbaac1e52e2d63bed45b43eb2ffa020b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2093214
Commit-Queue: Mike West <mkwst@chromium.org>
Reviewed-by: default avatarYifan Luo <lyf@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748064}
parent f4ed7b1f
......@@ -209,7 +209,7 @@
[DisableInNewIDLCompiler] attribute DOMMatrixConstructor WebKitCSSMatrix;
// TrustedTypes API: http://github.com/wicg/trusted-types
[RuntimeEnabled=TrustedDOMTypes] readonly attribute TrustedTypePolicyFactory trustedTypes;
[RuntimeEnabled=TrustedDOMTypes, SecureContext] readonly attribute TrustedTypePolicyFactory trustedTypes;
};
Window includes GlobalEventHandlers;
......
......@@ -8,7 +8,8 @@ typedef (DOMString or TrustedHTML) HTMLString;
[
Exposed=Window,
RuntimeEnabled=TrustedDOMTypes
RuntimeEnabled=TrustedDOMTypes,
SecureContext
] interface TrustedHTML {
stringifier;
};
......
......@@ -8,7 +8,8 @@ typedef (DOMString or TrustedScript) ScriptString;
[
Exposed=Window,
RuntimeEnabled=TrustedDOMTypes
RuntimeEnabled=TrustedDOMTypes,
SecureContext
] interface TrustedScript {
stringifier;
};
......@@ -8,7 +8,8 @@ typedef (DOMString or TrustedScriptURL) ScriptURLString;
[
Exposed=Window,
RuntimeEnabled=TrustedDOMTypes
RuntimeEnabled=TrustedDOMTypes,
SecureContext
] interface TrustedScriptURL {
stringifier;
};
......@@ -8,7 +8,8 @@ typedef (DOMString or TrustedHTML or TrustedScript or TrustedScriptURL) TrustedS
[
Exposed=Window,
RuntimeEnabled=TrustedDOMTypes
RuntimeEnabled=TrustedDOMTypes,
SecureContext
] interface TrustedTypePolicy {
readonly attribute DOMString name;
[CallWith=ScriptState, RaisesException] TrustedHTML createHTML(DOMString input, any... args);
......
......@@ -6,7 +6,8 @@
[
Exposed=(Window, Worker),
RuntimeEnabled=TrustedDOMTypes
RuntimeEnabled=TrustedDOMTypes,
SecureContext
] interface TrustedTypePolicyFactory {
[RaisesException] TrustedTypePolicy createPolicy(DOMString policyName, TrustedTypePolicyOptions policyOptions);
readonly attribute TrustedTypePolicy defaultPolicy;
......
......@@ -201,8 +201,8 @@ SET TIMEOUT: service-workers/service-worker/resources/resource-timing-worker.js
SET TIMEOUT: shadow-dom/Document-prototype-currentScript.html
SET TIMEOUT: shadow-dom/scroll-to-the-fragment-in-shadow-tree.html
SET TIMEOUT: shadow-dom/slotchange-event.html
SET TIMEOUT: trusted-types/block-string-assignment-to-DOMWindowTimers-setTimeout-setInterval.tentative.html
SET TIMEOUT: trusted-types/DOMWindowTimers-setTimeout-setInterval.tentative.html
SET TIMEOUT: trusted-types/block-string-assignment-to-DOMWindowTimers-setTimeout-setInterval.tentative.https.html
SET TIMEOUT: trusted-types/DOMWindowTimers-setTimeout-setInterval.tentative.https.html
SET TIMEOUT: user-timing/*
SET TIMEOUT: web-animations/timing-model/animations/*
SET TIMEOUT: webaudio/the-audio-api/the-mediaelementaudiosourcenode-interface/mediaElementAudioSourceToScriptProcessorTest.html
......
......@@ -186,7 +186,6 @@ PASS childWindow.status is ''
PASS childWindow.statusbar.visible is false
PASS childWindow.styleMedia.type is ''
PASS childWindow.toolbar.visible is false
PASS childWindow.trustedTypes.defaultPolicy is null
PASS childWindow.visualViewport.height is 0
PASS childWindow.visualViewport.offsetLeft is 0
PASS childWindow.visualViewport.offsetTop is 0
......
......@@ -186,7 +186,6 @@ PASS childWindow.status is ''
PASS childWindow.statusbar.visible is false
PASS childWindow.styleMedia.type is ''
PASS childWindow.toolbar.visible is false
PASS childWindow.trustedTypes.defaultPolicy is null
PASS childWindow.visualViewport.height is 0
PASS childWindow.visualViewport.offsetLeft is 0
PASS childWindow.visualViewport.offsetTop is 0
......
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