summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/trusted-types/support/helper.sub.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/trusted-types/support/helper.sub.js')
-rw-r--r--testing/web-platform/tests/trusted-types/support/helper.sub.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/testing/web-platform/tests/trusted-types/support/helper.sub.js b/testing/web-platform/tests/trusted-types/support/helper.sub.js
index 2d1bd436bd..1775cd985c 100644
--- a/testing/web-platform/tests/trusted-types/support/helper.sub.js
+++ b/testing/web-platform/tests/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);
@@ -158,9 +158,10 @@ function assert_throws_no_trusted_type_set_ns(tag, attribute, value) {
});
}
-function assert_element_accepts_non_trusted_type_set_ns(tag, attribute, value, expected) {
- let elem = document.createElement(tag);
- elem.setAttributeNS(namespace, attribute, value);
- let attr_node = elem.getAttributeNodeNS(namespace, attribute);
+function assert_element_accepts_non_trusted_type_set_ns(tag, attribute, value, expected,
+ elementNamespace, attributeNamespace) {
+ let elem = document.createElementNS(elementNamespace, tag);
+ elem.setAttributeNS(attributeNamespace, attribute, value);
+ let attr_node = elem.getAttributeNodeNS(attributeNamespace, attribute);
assert_equals(attr_node.value + "", expected);
}