From c37772cc51a1f4b5e9780a09567685da30c5b73f Mon Sep 17 00:00:00 2001 From: Mirko Brodesser Date: Wed, 21 Feb 2024 12:34:15 +0100 Subject: [PATCH] Change namespace for Trusted-Types tests for `setAttributeNS` to `null` See and . Preparation to fix . --- .../block-string-assignment-to-Element-setAttributeNS.html | 2 +- trusted-types/support/helper.sub.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/trusted-types/block-string-assignment-to-Element-setAttributeNS.html b/trusted-types/block-string-assignment-to-Element-setAttributeNS.html index 346e077a666507..e714de6a414390 100644 --- a/trusted-types/block-string-assignment-to-Element-setAttributeNS.html +++ b/trusted-types/block-string-assignment-to-Element-setAttributeNS.html @@ -21,7 +21,7 @@ assert_element_accepts_trusted_script_url_set_ns(window, '2', t, 'a', 'b', RESULTS.SCRIPTURL); }, "Element.setAttributeNS assigned via policy (successful ScriptURL transformation)"); - // Unknown, namespaced attributes should not be TT checked: + // Unknown attributes should not be TT checked: test(t => { assert_element_accepts_non_trusted_type_set_ns('a', 'b', 'A string', 'A string'); }, "Element.setAttributeNS accepts untrusted string for non-specced accessor"); diff --git a/trusted-types/support/helper.sub.js b/trusted-types/support/helper.sub.js index 2d1bd436bdf35f..219b42a8ae94cb 100644 --- a/trusted-types/support/helper.sub.js +++ b/trusted-types/support/helper.sub.js @@ -125,7 +125,7 @@ function assert_element_accepts_non_trusted_type_explicit_set(tag, attribute, va assert_equals(elem.getAttribute(attribute), expected); } -let namespace = 'http://www.w3.org/1999/xhtml'; +let namespace = null; function assert_element_accepts_trusted_html_set_ns(win, c, t, tag, attribute, expected) { let p = createHTML_policy(win, c); let html = p.createHTML(INPUTS.HTML);