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