From 0f7381c436acbfd025eace58137cf96895e03451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Wang?= Date: Mon, 6 Jan 2025 16:18:17 +0100 Subject: [PATCH] Add test to verify legacy sinks for TrustedScript are not supported (#49920) This verifies some API for ParentNode/ChildNode [1] [2] don't do any check for trusted types. This might already be covered by IDL tests but we just perform a direct verification here. This test fails in Chromium, which is not aligned with the DOM spec here [3] and performs specific checks for HTML script elements. Chromium also implements similar behavior for `ChildNodePart.replaceChildren()` but that's currently not shipped [4]. [1] https://dom.spec.whatwg.org/#interface-parentnode [2] https://dom.spec.whatwg.org/#interface-childnode [3] https://github.com/w3c/trusted-types/issues/494#issuecomment-2572883416 [4] https://groups.google.com/a/chromium.org/g/blink-dev/c/wIADRnljZDA/m/whzEaaAADAAJ --- trusted-types/legacy-trusted-scripts.html | 32 +++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 trusted-types/legacy-trusted-scripts.html diff --git a/trusted-types/legacy-trusted-scripts.html b/trusted-types/legacy-trusted-scripts.html new file mode 100644 index 000000000000000..05866fbaab505fe --- /dev/null +++ b/trusted-types/legacy-trusted-scripts.html @@ -0,0 +1,32 @@ + + + + +
+ + + + + + +