Skip to content

Commit

Permalink
Add stubs for Trusted Types API
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=266980

Reviewed by Ryosuke Niwa and Alex Christensen.

This patch adds a runtime feature flag and the initial bindings for the Trusted Types API.
None of the enforcement logic is implemented yet, nor any changes to the DOM sinks.

Spec: https://w3c.github.io/trusted-types/dist/spec

* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/content-security-policy/securitypolicyviolation/source-file-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/DOMParser-parseFromString-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/DOMWindowTimers-setTimeout-setInterval-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/Document-write-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/Element-insertAdjacentHTML-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/Element-insertAdjacentText-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/Element-outerHTML-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/Element-setAttribute-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/Element-setAttributeNS-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/GlobalEventHandlers-onclick-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/HTMLElement-generic-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/HTMLScriptElement-internal-slot-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/Node-multiple-arguments-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/Range-createContextualFragment-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/TrustedType-AttributeNodes-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/TrustedTypePolicy-CSP-no-name-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/TrustedTypePolicy-CSP-wildcard-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/TrustedTypePolicy-createXXX-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/TrustedTypePolicyFactory-blocking-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/TrustedTypePolicyFactory-constants-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/TrustedTypePolicyFactory-createPolicy-createXYZTests-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-noNamesGiven-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-none-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-none-skip-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/TrustedTypePolicyFactory-createPolicy-cspTests-wildcard-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/TrustedTypePolicyFactory-createPolicy-nameTests-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/TrustedTypePolicyFactory-createPolicy-unenforced-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/TrustedTypePolicyFactory-defaultPolicy-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/TrustedTypePolicyFactory-getAttributeType-namespace-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/TrustedTypePolicyFactory-getPropertyType-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/TrustedTypePolicyFactory-isXXX-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/TrustedTypePolicyFactory-metadata-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/Window-TrustedTypes-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/WorkerGlobalScope-eval-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/WorkerGlobalScope-importScripts-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/block-Document-execCommand-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/block-Node-multiple-arguments-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/block-string-assignment-to-DOMParser-parseFromString-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/block-string-assignment-to-DOMWindowTimers-setTimeout-setInterval-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/block-string-assignment-to-Document-write-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/block-string-assignment-to-Element-insertAdjacentHTML-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/block-string-assignment-to-Element-outerHTML-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/block-string-assignment-to-Element-setAttribute-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/block-string-assignment-to-Element-setAttributeNS-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/block-string-assignment-to-HTMLElement-generic-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/block-string-assignment-to-Range-createContextualFragment-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/block-text-node-insertion-into-script-element-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/csp-block-eval-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/default-policy-callback-arguments-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/default-policy-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/default-policy-report-only-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/empty-default-policy-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/empty-default-policy-report-only-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/eval-csp-no-tt-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/eval-csp-tt-default-policy-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/eval-csp-tt-no-default-policy-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/eval-function-constructor-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/eval-no-csp-no-tt-default-policy-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/eval-no-csp-no-tt-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/eval-with-permissive-csp-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/no-require-trusted-types-for-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/no-require-trusted-types-for-report-only-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/require-trusted-types-for-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/trusted-types-createHTMLDocument-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/trusted-types-duplicate-names-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/trusted-types-duplicate-names-list-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/trusted-types-duplicate-names-list-report-only-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/trusted-types-duplicate-names-without-enforcement-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/trusted-types-eval-reporting-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/trusted-types-eval-reporting-no-unsafe-eval-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/trusted-types-eval-reporting-report-only-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/trusted-types-from-literal-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/trusted-types-report-only-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/trusted-types-reporting-check-report-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/trusted-types-source-file-path-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/trusted-types-svg-script-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/trusted-types-tojson-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/tt-block-eval-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/trusted-types/worker-constructor.https-expected.txt:
* LayoutTests/platform/gtk/TestExpectations:
* LayoutTests/platform/ios-wk2/TestExpectations:
* LayoutTests/platform/mac-wk1/TestExpectations:
* LayoutTests/platform/wpe/TestExpectations:
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/CMakeLists.txt:
* Source/WebCore/DerivedSources-input.xcfilelist:
* Source/WebCore/DerivedSources-output.xcfilelist:
* Source/WebCore/DerivedSources.make:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/bindings/js/WebCoreBuiltinNames.h:
* Source/WebCore/dom/CreateHTMLCallback.h: Added.
* Source/WebCore/dom/CreateHTMLCallback.idl: Added.
* Source/WebCore/dom/CreateScriptCallback.h: Added.
* Source/WebCore/dom/CreateScriptCallback.idl: Added.
* Source/WebCore/dom/CreateScriptURLCallback.h: Added.
* Source/WebCore/dom/CreateScriptURLCallback.idl: Added.
* Source/WebCore/dom/TrustedHTML.cpp: Added.
(WebCore::TrustedHTML::create):
(WebCore::TrustedHTML::TrustedHTML):
* Source/WebCore/dom/TrustedHTML.h: Added.
(WebCore::TrustedHTML::toString const):
(WebCore::TrustedHTML::toJSON const):
* Source/WebCore/dom/TrustedHTML.idl: Added.
* Source/WebCore/dom/TrustedScript.cpp: Added.
(WebCore::TrustedScript::create):
(WebCore::TrustedScript::TrustedScript):
* Source/WebCore/dom/TrustedScript.h: Added.
* Source/WebCore/dom/TrustedScript.idl: Added.
* Source/WebCore/dom/TrustedScriptURL.cpp: Added.
(WebCore::TrustedScriptURL::create):
(WebCore::TrustedScriptURL::TrustedScriptURL):
* Source/WebCore/dom/TrustedScriptURL.h: Added.
(WebCore::TrustedScriptURL::toString const):
(WebCore::TrustedScriptURL::toJSON const):
* Source/WebCore/dom/TrustedScriptURL.idl: Added.
* Source/WebCore/dom/TrustedTypePolicy.cpp: Added.
(WebCore::TrustedTypePolicy::create):
(WebCore::TrustedTypePolicy::TrustedTypePolicy):
(WebCore::TrustedTypePolicy::createHTML):
(WebCore::TrustedTypePolicy::createScript):
(WebCore::TrustedTypePolicy::createScriptURL):
* Source/WebCore/dom/TrustedTypePolicy.h: Added.
(WebCore::TrustedTypePolicy::name const):
* Source/WebCore/dom/TrustedTypePolicy.idl: Added.
* Source/WebCore/dom/TrustedTypePolicyFactory.cpp: Added.
(WebCore::TrustedTypePolicyFactory::create):
(WebCore::TrustedTypePolicyFactory::createPolicy):
(WebCore::TrustedTypePolicyFactory::isHTML const):
(WebCore::TrustedTypePolicyFactory::isScript const):
(WebCore::TrustedTypePolicyFactory::isScriptURL const):
(WebCore::TrustedTypePolicyFactory::emptyHTML const):
(WebCore::TrustedTypePolicyFactory::emptyScript const):
(WebCore::TrustedTypePolicyFactory::getAttributeType const):
(WebCore::TrustedTypePolicyFactory::getPropertyType const):
* Source/WebCore/dom/TrustedTypePolicyFactory.h: Added.
(WebCore::TrustedTypePolicyFactory::defaultPolicy const):
* Source/WebCore/dom/TrustedTypePolicyFactory.idl: Added.
* Source/WebCore/dom/TrustedTypePolicyOptions.h: Added.
* Source/WebCore/dom/TrustedTypePolicyOptions.idl: Added.
* Source/WebCore/dom/WindowOrWorkerGlobalScope+TrustedTypes.idl: Added.
* Source/WebCore/dom/WindowOrWorkerGlobalScopeTrustedTypes.cpp: Added.
(WebCore::DOMWindowTrustedTypes::supplementName):
(WebCore::WorkerGlobalScopeTrustedTypes::supplementName):
(WebCore::DOMWindowTrustedTypes::DOMWindowTrustedTypes):
(WebCore::DOMWindowTrustedTypes::from):
(WebCore::DOMWindowTrustedTypes::trustedTypes const):
(WebCore::WorkerGlobalScopeTrustedTypes::WorkerGlobalScopeTrustedTypes):
(WebCore::WorkerGlobalScopeTrustedTypes::from):
(WebCore::WorkerGlobalScopeTrustedTypes::trustedTypes const):
(WebCore::WindowOrWorkerGlobalScopeTrustedTypes::trustedTypes):
* Source/WebCore/dom/WindowOrWorkerGlobalScopeTrustedTypes.h: Added.
* Source/WebCore/page/ios/DOMTimerHoldingTank.h:
* Source/WebCore/Modules/WebGPU/GPUOutOfMemoryError.h:

Canonical link: https://commits.webkit.org/273817@main
  • Loading branch information
lukewarlow committed Jan 31, 2024
1 parent 5d81c0c commit 74d050d
Show file tree
Hide file tree
Showing 120 changed files with 2,537 additions and 310 deletions.
3 changes: 3 additions & 0 deletions LayoutTests/TestExpectations
Original file line number Diff line number Diff line change
Expand Up @@ -5501,6 +5501,9 @@ webkit.org/b/261849 imported/w3c/web-platform-tests/css/css-scroll-anchoring/sta

# Trusted Types aren't implemented yet
webkit.org/b/266630 imported/w3c/web-platform-tests/trusted-types/trusted-types-event-handlers.html [ Skip ]
webkit.org/b/266630 imported/w3c/web-platform-tests/trusted-types/block-string-assignment-to-DOMWindowTimers-setTimeout-setInterval.html [ Skip ]
webkit.org/b/266630 imported/w3c/web-platform-tests/trusted-types/WorkerGlobalScope-eval.html [ Skip ]
webkit.org/b/266630 imported/w3c/web-platform-tests/trusted-types/WorkerGlobalScope-importScripts.html [ Skip ]

# These tests are image failures
imported/w3c/web-platform-tests/css/css-scroll-anchoring/vertical-rl-viewport-size-change-000.html [ Skip ]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@

Harness Error (FAIL), message = ReferenceError: Can't find variable: trustedTypes
Harness Error (TIMEOUT), message = null

TIMEOUT Basic HTTPS URL Test timed out
NOTRUN Basic HTTP URL
NOTRUN Basic WSS URL
NOTRUN Basic WS URL
NOTRUN Fragment
NOTRUN Query
NOTRUN Port
NOTRUN User:password
NOTRUN User
NOTRUN Invalid URL
NOTRUN file:
NOTRUN Custom protocol
NOTRUN about:blank
NOTRUN about:custom
NOTRUN data:
NOTRUN blob:
NOTRUN javascript:

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

FAIL document.innerText assigned via policy (successful HTML transformation). undefined is not an object (evaluating 'win.trustedTypes.createPolicy')
PASS document.innerText assigned via policy (successful HTML transformation).
PASS document.innerText = null.

Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'require-trusted-types-for'.

CONSOLE MESSAGE: ReferenceError: Can't find variable: trustedTypes

Harness Error (FAIL), message = ReferenceError: Can't find variable: trustedTypes
Harness Error (TIMEOUT), message = null

FAIL window.setTimeout assigned via policy (successful Script transformation). undefined is not an object (evaluating 'win.trustedTypes.createPolicy')
FAIL window.setInterval assigned via policy (successful Script transformation). undefined is not an object (evaluating 'win.trustedTypes.createPolicy')
PASS window.setTimeout assigned via policy (successful Script transformation).
PASS window.setInterval assigned via policy (successful Script transformation).
TIMEOUT window.setTimeout assigned via default policy (successful Script transformation). Test timed out
TIMEOUT window.setInterval assigned via default policy (successful Script transformation). Test timed out
PASS window.setTimeout assigned with a function handler shouldn't go through default policy.
PASS window.setInterval assigned with a function handler shouldn't go through default policy.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Quack, I want to be a duck!

FAIL document.write with html assigned via policy (successful transformation). undefined is not an object (evaluating 'win.trustedTypes.createPolicy')
PASS document.write with html assigned via policy (successful transformation).

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

FAIL insertAdjacentHTML with html assigned via policy (successful HTML transformation). undefined is not an object (evaluating 'win.trustedTypes.createPolicy')
PASS insertAdjacentHTML with html assigned via policy (successful HTML transformation).

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

FAIL insertAdjacentHTML with html assigned via policy (successful HTML transformation). undefined is not an object (evaluating 'win.trustedTypes.createPolicy')
PASS insertAdjacentHTML with html assigned via policy (successful HTML transformation).

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@

FAIL outerHTML with html assigned via policy (successful HTML transformation). undefined is not an object (evaluating 'win.trustedTypes.createPolicy')
PASS outerHTML with html assigned via policy (successful HTML transformation).

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

FAIL embed.src assigned via policy (successful ScriptURL transformation) undefined is not an object (evaluating 'win.trustedTypes.createPolicy')
FAIL script.src assigned via policy (successful ScriptURL transformation) undefined is not an object (evaluating 'win.trustedTypes.createPolicy')
FAIL iframe.srcdoc assigned via policy (successful HTML transformation) undefined is not an object (evaluating 'win.trustedTypes.createPolicy')
FAIL script.src assigned via policy (successful script transformation) undefined is not an object (evaluating 'win.trustedTypes.createPolicy')
PASS embed.src assigned via policy (successful ScriptURL transformation)
PASS script.src assigned via policy (successful ScriptURL transformation)
PASS iframe.srcdoc assigned via policy (successful HTML transformation)
PASS script.src assigned via policy (successful script transformation)
PASS a.rel accepts strings
PASS a.rel accepts null

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

FAIL Element.setAttributeNS assigned via policy (successful HTML transformation) undefined is not an object (evaluating 'win.trustedTypes.createPolicy')
FAIL Element.setAttributeNS assigned via policy (successful Script transformation) undefined is not an object (evaluating 'win.trustedTypes.createPolicy')
FAIL Element.setAttributeNS assigned via policy (successful ScriptURL transformation) undefined is not an object (evaluating 'win.trustedTypes.createPolicy')
PASS Element.setAttributeNS assigned via policy (successful HTML transformation)
PASS Element.setAttributeNS assigned via policy (successful Script transformation)
PASS Element.setAttributeNS assigned via policy (successful ScriptURL transformation)

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'require-trusted-types-for'.

CONSOLE MESSAGE: TypeError: undefined is not an object (evaluating 'win.trustedTypes.createPolicy')

Harness Error (FAIL), message = TypeError: undefined is not an object (evaluating 'win.trustedTypes.createPolicy')

PASS a.setAttribte('onclick') sets a trusted script.
FAIL a.setAttribute('onclick') sets an unsuitable trusted type. assert_unreached: Reached unreachable code
FAIL a.setAttribute('click') sets a test string. assert_unreached: Reached unreachable code

Original file line number Diff line number Diff line change
@@ -1,5 +1,109 @@
CONSOLE MESSAGE: ReferenceError: Can't find variable: trustedTypes
CONSOLE MESSAGE: SyntaxError: Unexpected identifier 'simple'
CONSOLE MESSAGE: SyntaxError: Unexpected identifier 'simple'
CONSOLE MESSAGE: SyntaxError: Unexpected identifier 'simple'
CONSOLE MESSAGE: SyntaxError: Unexpected identifier 'simple'
CONSOLE MESSAGE: SyntaxError: Unexpected identifier 'simple'
CONSOLE MESSAGE: SyntaxError: Unexpected identifier 'simple'
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'require-trusted-types-for'.

Harness Error (FAIL), message = ReferenceError: Can't find variable: trustedTypes
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'require-trusted-types-for'.

CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'require-trusted-types-for'.

CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'require-trusted-types-for'.

CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'require-trusted-types-for'.

CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'require-trusted-types-for'.

CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'require-trusted-types-for'.

CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'require-trusted-types-for'.

CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'require-trusted-types-for'.

CONSOLE MESSAGE: SyntaxError: Unexpected identifier 'simple'
CONSOLE MESSAGE: SyntaxError: Unexpected identifier 'simple'
CONSOLE MESSAGE: SyntaxError: Unexpected identifier 'simple'
CONSOLE MESSAGE: SyntaxError: Unexpected identifier 'simple'
CONSOLE MESSAGE: SyntaxError: Unexpected identifier 'simple'
CONSOLE MESSAGE: SyntaxError: Unexpected identifier 'simple'
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'require-trusted-types-for'.

CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'require-trusted-types-for'.

CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'require-trusted-types-for'.

CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'require-trusted-types-for'.

CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'require-trusted-types-for'.

CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'require-trusted-types-for'.


a simple string
a simple string

a simple string
a simple string


Harness Error (FAIL), message = SyntaxError: Unexpected identifier 'simple'

PASS TT disabled: embed.src = String on a connected element.
PASS TT disabled: embed.src = String on a non-connected element.
PASS TT disabled: embed.src = String on a connected element.
PASS TT disabled: embed.src = String on a non-connected element.
PASS TT disabled: script.src = String on a connected element.
PASS TT disabled: script.src = String on a non-connected element.
PASS TT disabled: script.src = String on a connected element.
PASS TT disabled: script.src = String on a non-connected element.
PASS TT disabled: div.innerHTML = String on a connected element.
PASS TT disabled: div.innerHTML = String on a non-connected element.
PASS TT disabled: div.innerHTML = String on a connected element.
PASS TT disabled: div.innerHTML = String on a non-connected element.
PASS TT disabled: iframe.srcdoc = String on a connected element.
PASS TT disabled: iframe.srcdoc = String on a non-connected element.
PASS TT disabled: iframe.srcdoc = String on a connected element.
PASS TT disabled: iframe.srcdoc = String on a non-connected element.
PASS TT disabled: script.text = String on a connected element.
PASS TT disabled: script.text = String on a non-connected element.
PASS TT disabled: script.text = String on a connected element.
PASS TT disabled: script.text = String on a non-connected element.
PASS TT disabled: script.innerText = String on a connected element.
PASS TT disabled: script.innerText = String on a non-connected element.
PASS TT disabled: script.innerText = String on a connected element.
PASS TT disabled: script.innerText = String on a non-connected element.
PASS TT disabled: script.textContent = String on a connected element.
PASS TT disabled: script.textContent = String on a non-connected element.
PASS TT disabled: script.textContent = String on a connected element.
PASS TT disabled: script.textContent = String on a non-connected element.
FAIL TT enabled: embed.src = String on a connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: embed.src = String on a non-connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: embed.src = String on a connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: embed.src = String on a non-connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: script.src = String on a connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: script.src = String on a non-connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: script.src = String on a connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: script.src = String on a non-connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: div.innerHTML = String on a connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: div.innerHTML = String on a non-connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: div.innerHTML = String on a connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: div.innerHTML = String on a non-connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: iframe.srcdoc = String on a connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: iframe.srcdoc = String on a non-connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: iframe.srcdoc = String on a connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: iframe.srcdoc = String on a non-connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: script.text = String on a connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: script.text = String on a non-connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: script.text = String on a connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: script.text = String on a non-connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: script.innerText = String on a connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: script.innerText = String on a non-connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: script.innerText = String on a connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: script.innerText = String on a non-connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: script.textContent = String on a connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: script.textContent = String on a non-connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: script.textContent = String on a connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw
FAIL TT enabled: script.textContent = String on a non-connected element. assert_throws_js: function "_ => { elem[attr] = value; }" did not throw

Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'require-trusted

CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'require-trusted-types-for'.

CONSOLE MESSAGE: ReferenceError: Can't find variable: trustedTypes
CONSOLE MESSAGE: Unrecognized Content-Security-Policy directive 'require-trusted-types-for'.



Harness Error (FAIL), message = ReferenceError: Can't find variable: trustedTypes

FAIL Test TT application when manipulating <script> elements during loading. promise_test: Unhandled rejection with value: "First message should have been blocked: first script element executed"
PASS Script set via .textContent executes on a connected HTMLScriptElement.
PASS Script set via .textContent executes on an unconnected HTMLScriptElement.
PASS Script set via .innerText executes on a connected HTMLScriptElement.
PASS Script set via .innerText executes on an unconnected HTMLScriptElement.
FAIL Setting .src to a plain string should throw an exception and not modify the script state, on an unconnected script element. promise_test: Unhandled rejection with value: undefined
PASS Setting .src to a TrustedScriptURL should work and should execute the referenced script instead of the script body, on an unconnected script element.
PASS Setting .src to a plain string should throw an exception and not modify the script state, on a connected script element.
PASS Setting .src to a TrustedScriptURL should work and should execute the referenced script instead of the script body, on a onnected script element.

Loading

0 comments on commit 74d050d

Please sign in to comment.