LibWeb: Update get_trusted_type_data_for_attribute according to the spec

It now takes into consideration the namespace of the element to decide
if it needs a TrustedType or not.

We also win a few WPT subtests :)
This commit is contained in:
Tete17 2025-10-29 13:08:28 +01:00 committed by Jelle Raaijmakers
parent d601badd6c
commit 1d1182cad8
Notes: github-actions[bot] 2025-12-01 08:55:54 +00:00
15 changed files with 1778 additions and 14 deletions

View file

@ -355,7 +355,9 @@ WebIDL::ExceptionOr<Utf16String> get_trusted_types_compliant_attribute_value(Fly
// attributeName
// attributeNs
auto const attribute_data = get_trusted_type_data_for_attribute(
element_interface_name(Utf16String::from_utf8(element.local_name()), attribute_ns.has_value() ? attribute_ns.value() : Utf16String::from_utf8(Namespace::HTML)),
element_interface(
Utf16String::from_utf8(element.local_name()),
element.namespace_uri().value_or(Namespace::HTML)),
Utf16String::from_utf8(attribute_name),
attribute_ns);
@ -393,18 +395,18 @@ WebIDL::ExceptionOr<Utf16String> get_trusted_types_compliant_attribute_value(Fly
Script.to_string());
}
Utf16String element_interface_name(Utf16String const& local_name, Utf16String const& element_ns)
ElementInterface element_interface(Utf16String const& local_name, FlyString const& element_ns)
{
// FIXME: We don't have a method in ElementFactory that can give us the interface name but these are all the cases
// we care about in the table in get_trusted_type_data_for_attribute function
if (local_name == HTML::TagNames::iframe && element_ns == Namespace::HTML)
return "HTMLIFrameElement"_utf16;
return { "HTMLIFrameElement"_utf16, element_ns };
if (local_name == HTML::TagNames::script && element_ns == Namespace::HTML)
return "HTMLScriptElement"_utf16;
return { "HTMLScriptElement"_utf16, element_ns };
if (local_name == SVG::TagNames::script && element_ns == Namespace::SVG)
return "SVGScriptElement"_utf16;
return { "SVGScriptElement"_utf16, element_ns };
return "Element"_utf16;
return { "Element"_utf16, element_ns };
}
}

View file

@ -6,6 +6,7 @@
#pragma once
#include <AK/FlyString.h>
#include <LibJS/Forward.h>
#include <LibWeb/Bindings/PlatformObject.h>
#include <LibWeb/Bindings/TrustedTypePolicyPrototype.h>
@ -71,6 +72,12 @@ WebIDL::ExceptionOr<Utf16String> get_trusted_type_compliant_string(TrustedTypeNa
WebIDL::ExceptionOr<Utf16String> get_trusted_types_compliant_attribute_value(FlyString const& attribute_name, Optional<Utf16String> attribute_ns, DOM::Element const& element, Variant<GC::Root<TrustedHTML>, GC::Root<TrustedScript>, GC::Root<TrustedScriptURL>, Utf16String> const& new_value);
Utf16String element_interface_name(Utf16String const& local_name, Utf16String const& element_ns);
// FIXME: Add-hoc definition of an element interface
struct ElementInterface {
Utf16String element_name;
FlyString element_ns;
};
ElementInterface element_interface(Utf16String const& local_name, FlyString const& element_ns);
}

View file

@ -49,7 +49,7 @@ Optional<Utf16String> TrustedTypePolicyFactory::get_attribute_type(Utf16String c
attr_ns.clear();
// 5. Let interface be the element interface for localName and elementNs.
Utf16String const interface = element_interface_name(local_name, element_ns.value());
auto const interface = element_interface(local_name, element_ns.value().to_utf8());
// 6. Let expectedType be null.
Optional<Utf16String> expected_type {};
@ -297,13 +297,16 @@ ContentSecurityPolicy::Directives::Directive::Result TrustedTypePolicyFactory::s
}
// https://w3c.github.io/trusted-types/dist/spec/#get-trusted-type-data-for-attribute
Optional<TrustedTypeData> get_trusted_type_data_for_attribute(Utf16String const& element, Utf16String const& attribute, Optional<Utf16String> const& attribute_ns)
Optional<TrustedTypeData> get_trusted_type_data_for_attribute(ElementInterface const& element, Utf16String const& attribute, Optional<Utf16String> const& attribute_ns)
{
// 1. Let data be null.
Optional<TrustedTypeData const&> data {};
// 2. If attributeNs is null, and attribute is the name of an event handler content attribute, then:
if (!attribute_ns.has_value()) {
auto const& [element_name, element_ns] = element;
// 2. If attributeNs is null, « HTML namespace, SVG namespace, MathML namespace » contains elements namespace, and attribute is the name of an event handler content attribute:
if (!attribute_ns.has_value()
&& (Namespace::HTML == element_ns || Namespace::SVG == element_ns || Namespace::MathML == element_ns)) {
#undef __ENUMERATE
#define __ENUMERATE(attribute_name, event_name) \
if (attribute == HTML::AttributeNames::attribute_name) { \
@ -324,8 +327,8 @@ Optional<TrustedTypeData> get_trusted_type_data_for_attribute(Utf16String const&
// 3. Find the row in the following table, where element is in the first column, attributeNs is in the second column,
// and attribute is in the third column. If a matching row is found, set data to that row.
data = table.first_matching([&element, &attribute, &attribute_ns](auto const& row) {
return row.element == element && row.attribute_ns == attribute_ns && row.attribute_local_name == attribute;
data = table.first_matching([&element_name, &attribute, &attribute_ns](auto const& row) {
return row.element == element_name && row.attribute_ns == attribute_ns && row.attribute_local_name == attribute;
});
// 4. Return data

View file

@ -69,6 +69,6 @@ struct TrustedTypeData {
InjectionSink sink;
};
Optional<TrustedTypeData> get_trusted_type_data_for_attribute(Utf16String const&, Utf16String const&, Optional<Utf16String> const&);
Optional<TrustedTypeData> get_trusted_type_data_for_attribute(ElementInterface const& element, Utf16String const&, Optional<Utf16String> const&);
}

View file

@ -0,0 +1,12 @@
Harness status: OK
Found 7 tests
7 Pass
Pass HTMLIFrameElement.setAttribute('srcdoc', plain_string)
Pass HTMLIFrameElement.setAttributeNS(null, 'srcdoc', plain_string)
Pass HTMLScriptElement.setAttribute('src', plain_string)
Pass HTMLScriptElement.setAttributeNS(null, 'src', plain_string)
Pass SVGScriptElement.setAttribute('href', plain_string)
Pass SVGScriptElement.setAttributeNS(null, 'href', plain_string)
Pass SVGScriptElement.setAttributeNS(NSURI_XLINK, 'href', plain_string)

View file

@ -0,0 +1,120 @@
Harness status: OK
Found 23 tests
23 Pass
Pass getAttributeType(
"DIV",
"onclick",
"http://www.w3.org/1999/xhtml",
"null") == "TrustedScript"
Pass getAttributeType(
"g",
"ondblclick",
"http://www.w3.org/2000/svg",
"null") == "TrustedScript"
Pass getAttributeType(
"mrow",
"onmousedown",
"http://www.w3.org/1998/Math/MathML",
"null") == "TrustedScript"
Pass getAttributeType(
"IFRAME",
"srcdoc",
"http://www.w3.org/1999/xhtml",
"null") == "TrustedHTML"
Pass getAttributeType(
"SCRIPT",
"src",
"http://www.w3.org/1999/xhtml",
"null") == "TrustedScriptURL"
Pass getAttributeType(
"script",
"href",
"http://www.w3.org/2000/svg",
"null") == "TrustedScriptURL"
Pass getAttributeType(
"script",
"href",
"http://www.w3.org/2000/svg",
"http://www.w3.org/1999/xlink") == "TrustedScriptURL"
Pass getAttributeType(
"foo",
"onmouseup",
"https://example.com/namespace",
"null") == "null"
Pass getAttributeType(
"DIV",
"onclick",
"http://www.w3.org/1999/xhtml",
"https://example.com/namespace") == "null"
Pass getAttributeType(
"DIV",
"ondoesnotexist",
"http://www.w3.org/1999/xhtml",
"null") == "null"
Pass getAttributeType(
"DIV",
"data-onclick",
"http://www.w3.org/1999/xhtml",
"null") == "null"
Pass getAttributeType(
"DIV",
"srcdoc",
"http://www.w3.org/1999/xhtml",
"null") == "null"
Pass getAttributeType(
"iframe",
"srcdoc",
"https://example.com/namespace",
"null") == "null"
Pass getAttributeType(
"IFRAME",
"srcdoc",
"http://www.w3.org/1999/xhtml",
"https://example.com/namespace") == "null"
Pass getAttributeType(
"IFRAME",
"data-srcdoc",
"http://www.w3.org/1999/xhtml",
"null") == "null"
Pass getAttributeType(
"DIV",
"src",
"http://www.w3.org/1999/xhtml",
"null") == "null"
Pass getAttributeType(
"script",
"src",
"https://example.com/namespace",
"null") == "null"
Pass getAttributeType(
"SCRIPT",
"src",
"http://www.w3.org/1999/xhtml",
"https://example.com/namespace") == "null"
Pass getAttributeType(
"SCRIPT",
"data-src",
"http://www.w3.org/1999/xhtml",
"null") == "null"
Pass getAttributeType(
"g",
"href",
"http://www.w3.org/2000/svg",
"null") == "null"
Pass getAttributeType(
"SCRIPT",
"href",
"http://www.w3.org/1999/xhtml",
"null") == "null"
Pass getAttributeType(
"script",
"href",
"http://www.w3.org/2000/svg",
"https://example.com/namespace") == "null"
Pass getAttributeType(
"script",
"src",
"http://www.w3.org/2000/svg",
"null") == "null"

View file

@ -0,0 +1,253 @@
Harness status: OK
Found 248 tests
248 Pass
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete other attribute before)
Pass Element.setAttribute works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete other attribute before)
Pass Element.setAttribute works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete other attribute before)
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (delete other attribute before)
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (delete other attribute before)
Pass Element.setAttribute works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (delete other attribute before)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete other attribute before)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete other attribute before)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete other attribute before)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (delete other attribute before)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (delete other attribute before)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (delete other attribute before)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (delete other attribute before)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete other attribute before)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete other attribute before)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete other attribute before)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (delete other attribute before)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (delete other attribute before)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (delete other attribute before)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (delete other attribute before)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete other attribute before)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete other attribute before)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete other attribute before)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (delete other attribute before)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (delete other attribute before)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (delete other attribute before)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (delete other attribute before)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete other attribute before)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete other attribute before)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete other attribute before)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (delete other attribute before)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (delete other attribute before)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (delete other attribute before)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (delete other attribute before)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete other attribute before)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete other attribute before)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete other attribute before)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (delete other attribute before)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (delete other attribute before)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (delete other attribute before)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (delete other attribute before)
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete other attribute before)
Pass Attr.value works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete other attribute before)
Pass Attr.value works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete other attribute before)
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (delete other attribute before)
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (delete other attribute before)
Pass Attr.value works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (delete other attribute before)
Pass Attr.value works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (delete other attribute before)
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete other attribute before)
Pass Node.nodeValue works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete other attribute before)
Pass Node.nodeValue works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete other attribute before)
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (delete other attribute before)
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (delete other attribute before)
Pass Node.nodeValue works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (delete other attribute before)
Pass Node.nodeValue works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (delete other attribute before)
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete other attribute before)
Pass Node.textContent works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete other attribute before)
Pass Node.textContent works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete other attribute before)
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (delete other attribute before)
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (delete other attribute before)
Pass Node.textContent works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (delete other attribute before)
Pass Node.textContent works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (delete other attribute before)
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete attribute)
Pass Element.setAttribute works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete attribute)
Pass Element.setAttribute works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete attribute)
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (delete attribute)
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (delete attribute)
Pass Element.setAttribute works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (delete attribute)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete attribute)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete attribute)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete attribute)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (delete attribute)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (delete attribute)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (delete attribute)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (delete attribute)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete attribute)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete attribute)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete attribute)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (delete attribute)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (delete attribute)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (delete attribute)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (delete attribute)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete attribute)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete attribute)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete attribute)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (delete attribute)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (delete attribute)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (delete attribute)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (delete attribute)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete attribute)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete attribute)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete attribute)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (delete attribute)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (delete attribute)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (delete attribute)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (delete attribute)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete attribute)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete attribute)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete attribute)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (delete attribute)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (delete attribute)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (delete attribute)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (delete attribute)
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete attribute)
Pass Attr.value works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete attribute)
Pass Attr.value works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete attribute)
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (delete attribute)
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (delete attribute)
Pass Attr.value works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (delete attribute)
Pass Attr.value works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (delete attribute)
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete attribute)
Pass Node.nodeValue works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete attribute)
Pass Node.nodeValue works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete attribute)
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (delete attribute)
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (delete attribute)
Pass Node.nodeValue works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (delete attribute)
Pass Node.nodeValue works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (delete attribute)
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (delete attribute)
Pass Node.textContent works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (delete attribute)
Pass Node.textContent works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (delete attribute)
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (delete attribute)
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (delete attribute)
Pass Node.textContent works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (delete attribute)
Pass Node.textContent works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (delete attribute)
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (modify attribute)
Pass Element.setAttribute works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (modify attribute)
Pass Element.setAttribute works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (modify attribute)
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (modify attribute)
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (modify attribute)
Pass Element.setAttribute works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (modify attribute)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (modify attribute)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (modify attribute)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (modify attribute)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (modify attribute)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (modify attribute)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (modify attribute)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (modify attribute)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (modify attribute)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (modify attribute)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (modify attribute)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (modify attribute)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (modify attribute)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (modify attribute)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (modify attribute)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (modify attribute)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (modify attribute)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (modify attribute)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (modify attribute)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (modify attribute)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (modify attribute)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (modify attribute)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (modify attribute)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (modify attribute)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (modify attribute)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (modify attribute)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (modify attribute)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (modify attribute)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (modify attribute)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (modify attribute)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (modify attribute)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (modify attribute)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (modify attribute)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (modify attribute)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (modify attribute)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (modify attribute)
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (modify attribute)
Pass Attr.value works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (modify attribute)
Pass Attr.value works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (modify attribute)
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (modify attribute)
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (modify attribute)
Pass Attr.value works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (modify attribute)
Pass Attr.value works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (modify attribute)
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (modify attribute)
Pass Node.nodeValue works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (modify attribute)
Pass Node.nodeValue works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (modify attribute)
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (modify attribute)
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (modify attribute)
Pass Node.nodeValue works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (modify attribute)
Pass Node.nodeValue works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (modify attribute)
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (modify attribute)
Pass Node.textContent works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (modify attribute)
Pass Node.textContent works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (modify attribute)
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (modify attribute)
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (modify attribute)
Pass Node.textContent works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (modify attribute)
Pass Node.textContent works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (modify attribute)
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (move attribute node to another element)
Pass Element.setAttribute works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (move attribute node to another element)
Pass Element.setAttribute works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (move attribute node to another element)
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (move attribute node to another element)
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (move attribute node to another element)
Pass Element.setAttribute works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (move attribute node to another element)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (move attribute node to another element)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (move attribute node to another element)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (move attribute node to another element)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (move attribute node to another element)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (move attribute node to another element)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (move attribute node to another element)
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (move attribute node to another element)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (move attribute node to another element)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (move attribute node to another element)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (move attribute node to another element)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (move attribute node to another element)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (move attribute node to another element)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (move attribute node to another element)
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (move attribute node to another element)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (move attribute node to another element)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (move attribute node to another element)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (move attribute node to another element)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (move attribute node to another element)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (move attribute node to another element)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (move attribute node to another element)
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (move attribute node to another element)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (move attribute node to another element)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (move attribute node to another element)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (move attribute node to another element)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (move attribute node to another element)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (move attribute node to another element)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (move attribute node to another element)
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (move attribute node to another element)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (move attribute node to another element)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (move attribute node to another element)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (move attribute node to another element)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (move attribute node to another element)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (move attribute node to another element)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (move attribute node to another element)
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (move attribute node to another element)
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (move attribute node to another element)
Pass Attr.value works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (move attribute node to another element)
Pass Attr.value works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (move attribute node to another element)
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (move attribute node to another element)
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (move attribute node to another element)
Pass Attr.value works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (move attribute node to another element)
Pass Attr.value works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (move attribute node to another element)
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (move attribute node to another element)
Pass Node.nodeValue works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (move attribute node to another element)
Pass Node.nodeValue works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (move attribute node to another element)
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (move attribute node to another element)
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (move attribute node to another element)
Pass Node.nodeValue works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (move attribute node to another element)
Pass Node.nodeValue works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (move attribute node to another element)
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick (move attribute node to another element)
Pass Node.textContent works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick (move attribute node to another element)
Pass Node.textContent works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown (move attribute node to another element)
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc (move attribute node to another element)
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src (move attribute node to another element)
Pass Node.textContent works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href (move attribute node to another element)
Pass Node.textContent works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href (move attribute node to another element)

View file

@ -0,0 +1,269 @@
Harness status: OK
Found 264 tests
264 Pass
Pass Element.setAttribute applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick
Pass Element.setAttribute applies default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick
Pass Element.setAttribute applies default policy for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown
Pass Element.setAttribute applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc
Pass Element.setAttribute applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src
Pass Element.setAttribute applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href
Pass Element.setAttribute does not apply default policy for elementNS=https://example.com/namespace, element=foo, attrName=onmouseup
Pass Element.setAttribute does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=ondoesnotexist
Pass Element.setAttribute does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=data-onclick
Pass Element.setAttribute does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=srcdoc
Pass Element.setAttribute does not apply default policy for elementNS=https://example.com/namespace, element=iframe, attrName=srcdoc
Pass Element.setAttribute does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=data-srcdoc
Pass Element.setAttribute does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=src
Pass Element.setAttribute does not apply default policy for elementNS=https://example.com/namespace, element=script, attrName=src
Pass Element.setAttribute does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=data-src
Pass Element.setAttribute does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=href
Pass Element.setAttribute does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=href
Pass Element.setAttribute does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=src
Pass Element.setAttributeNS applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick
Pass Element.setAttributeNS applies default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick
Pass Element.setAttributeNS applies default policy for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown
Pass Element.setAttributeNS applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc
Pass Element.setAttributeNS applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src
Pass Element.setAttributeNS applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href
Pass Element.setAttributeNS applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href
Pass Element.setAttributeNS does not apply default policy for elementNS=https://example.com/namespace, element=foo, attrName=onmouseup
Pass Element.setAttributeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrNS=https://example.com/namespace, attrName=onclick
Pass Element.setAttributeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=ondoesnotexist
Pass Element.setAttributeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=data-onclick
Pass Element.setAttributeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=srcdoc
Pass Element.setAttributeNS does not apply default policy for elementNS=https://example.com/namespace, element=iframe, attrName=srcdoc
Pass Element.setAttributeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrNS=https://example.com/namespace, attrName=srcdoc
Pass Element.setAttributeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=data-srcdoc
Pass Element.setAttributeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=src
Pass Element.setAttributeNS does not apply default policy for elementNS=https://example.com/namespace, element=script, attrName=src
Pass Element.setAttributeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrNS=https://example.com/namespace, attrName=src
Pass Element.setAttributeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=data-src
Pass Element.setAttributeNS does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=href
Pass Element.setAttributeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=href
Pass Element.setAttributeNS does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=https://example.com/namespace, attrName=href
Pass Element.setAttributeNS does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=src
Pass Element.setAttributeNode applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick
Pass Element.setAttributeNode applies default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick
Pass Element.setAttributeNode applies default policy for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown
Pass Element.setAttributeNode applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc
Pass Element.setAttributeNode applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src
Pass Element.setAttributeNode applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href
Pass Element.setAttributeNode applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href
Pass Element.setAttributeNode does not apply default policy for elementNS=https://example.com/namespace, element=foo, attrName=onmouseup
Pass Element.setAttributeNode does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrNS=https://example.com/namespace, attrName=onclick
Pass Element.setAttributeNode does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=ondoesnotexist
Pass Element.setAttributeNode does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=data-onclick
Pass Element.setAttributeNode does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=srcdoc
Pass Element.setAttributeNode does not apply default policy for elementNS=https://example.com/namespace, element=iframe, attrName=srcdoc
Pass Element.setAttributeNode does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrNS=https://example.com/namespace, attrName=srcdoc
Pass Element.setAttributeNode does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=data-srcdoc
Pass Element.setAttributeNode does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=src
Pass Element.setAttributeNode does not apply default policy for elementNS=https://example.com/namespace, element=script, attrName=src
Pass Element.setAttributeNode does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrNS=https://example.com/namespace, attrName=src
Pass Element.setAttributeNode does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=data-src
Pass Element.setAttributeNode does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=href
Pass Element.setAttributeNode does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=href
Pass Element.setAttributeNode does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=https://example.com/namespace, attrName=href
Pass Element.setAttributeNode does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=src
Pass Element.setAttributeNodeNS applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick
Pass Element.setAttributeNodeNS applies default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick
Pass Element.setAttributeNodeNS applies default policy for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown
Pass Element.setAttributeNodeNS applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc
Pass Element.setAttributeNodeNS applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src
Pass Element.setAttributeNodeNS applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href
Pass Element.setAttributeNodeNS applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href
Pass Element.setAttributeNodeNS does not apply default policy for elementNS=https://example.com/namespace, element=foo, attrName=onmouseup
Pass Element.setAttributeNodeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrNS=https://example.com/namespace, attrName=onclick
Pass Element.setAttributeNodeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=ondoesnotexist
Pass Element.setAttributeNodeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=data-onclick
Pass Element.setAttributeNodeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=srcdoc
Pass Element.setAttributeNodeNS does not apply default policy for elementNS=https://example.com/namespace, element=iframe, attrName=srcdoc
Pass Element.setAttributeNodeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrNS=https://example.com/namespace, attrName=srcdoc
Pass Element.setAttributeNodeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=data-srcdoc
Pass Element.setAttributeNodeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=src
Pass Element.setAttributeNodeNS does not apply default policy for elementNS=https://example.com/namespace, element=script, attrName=src
Pass Element.setAttributeNodeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrNS=https://example.com/namespace, attrName=src
Pass Element.setAttributeNodeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=data-src
Pass Element.setAttributeNodeNS does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=href
Pass Element.setAttributeNodeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=href
Pass Element.setAttributeNodeNS does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=https://example.com/namespace, attrName=href
Pass Element.setAttributeNodeNS does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=src
Pass NamedNodeMap.setNamedItem applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick
Pass NamedNodeMap.setNamedItem applies default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick
Pass NamedNodeMap.setNamedItem applies default policy for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown
Pass NamedNodeMap.setNamedItem applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc
Pass NamedNodeMap.setNamedItem applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src
Pass NamedNodeMap.setNamedItem applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href
Pass NamedNodeMap.setNamedItem applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href
Pass NamedNodeMap.setNamedItem does not apply default policy for elementNS=https://example.com/namespace, element=foo, attrName=onmouseup
Pass NamedNodeMap.setNamedItem does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrNS=https://example.com/namespace, attrName=onclick
Pass NamedNodeMap.setNamedItem does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=ondoesnotexist
Pass NamedNodeMap.setNamedItem does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=data-onclick
Pass NamedNodeMap.setNamedItem does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=srcdoc
Pass NamedNodeMap.setNamedItem does not apply default policy for elementNS=https://example.com/namespace, element=iframe, attrName=srcdoc
Pass NamedNodeMap.setNamedItem does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrNS=https://example.com/namespace, attrName=srcdoc
Pass NamedNodeMap.setNamedItem does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=data-srcdoc
Pass NamedNodeMap.setNamedItem does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=src
Pass NamedNodeMap.setNamedItem does not apply default policy for elementNS=https://example.com/namespace, element=script, attrName=src
Pass NamedNodeMap.setNamedItem does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrNS=https://example.com/namespace, attrName=src
Pass NamedNodeMap.setNamedItem does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=data-src
Pass NamedNodeMap.setNamedItem does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=href
Pass NamedNodeMap.setNamedItem does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=href
Pass NamedNodeMap.setNamedItem does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=https://example.com/namespace, attrName=href
Pass NamedNodeMap.setNamedItem does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=src
Pass NamedNodeMap.setNamedItemNS applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick
Pass NamedNodeMap.setNamedItemNS applies default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick
Pass NamedNodeMap.setNamedItemNS applies default policy for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown
Pass NamedNodeMap.setNamedItemNS applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc
Pass NamedNodeMap.setNamedItemNS applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src
Pass NamedNodeMap.setNamedItemNS applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href
Pass NamedNodeMap.setNamedItemNS applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href
Pass NamedNodeMap.setNamedItemNS does not apply default policy for elementNS=https://example.com/namespace, element=foo, attrName=onmouseup
Pass NamedNodeMap.setNamedItemNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrNS=https://example.com/namespace, attrName=onclick
Pass NamedNodeMap.setNamedItemNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=ondoesnotexist
Pass NamedNodeMap.setNamedItemNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=data-onclick
Pass NamedNodeMap.setNamedItemNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=srcdoc
Pass NamedNodeMap.setNamedItemNS does not apply default policy for elementNS=https://example.com/namespace, element=iframe, attrName=srcdoc
Pass NamedNodeMap.setNamedItemNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrNS=https://example.com/namespace, attrName=srcdoc
Pass NamedNodeMap.setNamedItemNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=data-srcdoc
Pass NamedNodeMap.setNamedItemNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=src
Pass NamedNodeMap.setNamedItemNS does not apply default policy for elementNS=https://example.com/namespace, element=script, attrName=src
Pass NamedNodeMap.setNamedItemNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrNS=https://example.com/namespace, attrName=src
Pass NamedNodeMap.setNamedItemNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=data-src
Pass NamedNodeMap.setNamedItemNS does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=href
Pass NamedNodeMap.setNamedItemNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=href
Pass NamedNodeMap.setNamedItemNS does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=https://example.com/namespace, attrName=href
Pass NamedNodeMap.setNamedItemNS does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=src
Pass Attr.value applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick
Pass Attr.value applies default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick
Pass Attr.value applies default policy for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown
Pass Attr.value applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc
Pass Attr.value applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src
Pass Attr.value applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href
Pass Attr.value applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href
Pass Attr.value does not apply default policy for elementNS=https://example.com/namespace, element=foo, attrName=onmouseup
Pass Attr.value does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrNS=https://example.com/namespace, attrName=onclick
Pass Attr.value does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=ondoesnotexist
Pass Attr.value does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=data-onclick
Pass Attr.value does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=srcdoc
Pass Attr.value does not apply default policy for elementNS=https://example.com/namespace, element=iframe, attrName=srcdoc
Pass Attr.value does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrNS=https://example.com/namespace, attrName=srcdoc
Pass Attr.value does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=data-srcdoc
Pass Attr.value does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=src
Pass Attr.value does not apply default policy for elementNS=https://example.com/namespace, element=script, attrName=src
Pass Attr.value does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrNS=https://example.com/namespace, attrName=src
Pass Attr.value does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=data-src
Pass Attr.value does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=href
Pass Attr.value does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=href
Pass Attr.value does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=https://example.com/namespace, attrName=href
Pass Attr.value does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=src
Pass Node.nodeValue applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick
Pass Node.nodeValue applies default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick
Pass Node.nodeValue applies default policy for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown
Pass Node.nodeValue applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc
Pass Node.nodeValue applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src
Pass Node.nodeValue applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href
Pass Node.nodeValue applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href
Pass Node.nodeValue does not apply default policy for elementNS=https://example.com/namespace, element=foo, attrName=onmouseup
Pass Node.nodeValue does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrNS=https://example.com/namespace, attrName=onclick
Pass Node.nodeValue does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=ondoesnotexist
Pass Node.nodeValue does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=data-onclick
Pass Node.nodeValue does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=srcdoc
Pass Node.nodeValue does not apply default policy for elementNS=https://example.com/namespace, element=iframe, attrName=srcdoc
Pass Node.nodeValue does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrNS=https://example.com/namespace, attrName=srcdoc
Pass Node.nodeValue does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=data-srcdoc
Pass Node.nodeValue does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=src
Pass Node.nodeValue does not apply default policy for elementNS=https://example.com/namespace, element=script, attrName=src
Pass Node.nodeValue does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrNS=https://example.com/namespace, attrName=src
Pass Node.nodeValue does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=data-src
Pass Node.nodeValue does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=href
Pass Node.nodeValue does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=href
Pass Node.nodeValue does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=https://example.com/namespace, attrName=href
Pass Node.nodeValue does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=src
Pass Node.textContent applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick
Pass Node.textContent applies default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick
Pass Node.textContent applies default policy for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown
Pass Node.textContent applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc
Pass Node.textContent applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src
Pass Node.textContent applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href
Pass Node.textContent applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href
Pass Node.textContent does not apply default policy for elementNS=https://example.com/namespace, element=foo, attrName=onmouseup
Pass Node.textContent does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrNS=https://example.com/namespace, attrName=onclick
Pass Node.textContent does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=ondoesnotexist
Pass Node.textContent does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=data-onclick
Pass Node.textContent does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=srcdoc
Pass Node.textContent does not apply default policy for elementNS=https://example.com/namespace, element=iframe, attrName=srcdoc
Pass Node.textContent does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrNS=https://example.com/namespace, attrName=srcdoc
Pass Node.textContent does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=data-srcdoc
Pass Node.textContent does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=src
Pass Node.textContent does not apply default policy for elementNS=https://example.com/namespace, element=script, attrName=src
Pass Node.textContent does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrNS=https://example.com/namespace, attrName=src
Pass Node.textContent does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=data-src
Pass Node.textContent does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=href
Pass Node.textContent does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=href
Pass Node.textContent does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=https://example.com/namespace, attrName=href
Pass Node.textContent does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=src
Pass Element.setAttribute does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick and a TrustedScript input.
Pass Element.setAttribute does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick and a TrustedScript input.
Pass Element.setAttribute does not apply default policy for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown and a TrustedScript input.
Pass Element.setAttribute does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc and a TrustedHTML input.
Pass Element.setAttribute does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src and a TrustedScriptURL input.
Pass Element.setAttribute does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href and a TrustedScriptURL input.
Pass Element.setAttributeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick and a TrustedScript input.
Pass Element.setAttributeNS does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick and a TrustedScript input.
Pass Element.setAttributeNS does not apply default policy for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown and a TrustedScript input.
Pass Element.setAttributeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc and a TrustedHTML input.
Pass Element.setAttributeNS does not apply default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src and a TrustedScriptURL input.
Pass Element.setAttributeNS does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href and a TrustedScriptURL input.
Pass Element.setAttributeNS does not apply default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href and a TrustedScriptURL input.
Pass Element.setAttributeNode applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick and a TrustedScript input.
Pass Element.setAttributeNode applies default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick and a TrustedScript input.
Pass Element.setAttributeNode applies default policy for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown and a TrustedScript input.
Pass Element.setAttributeNode applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc and a TrustedHTML input.
Pass Element.setAttributeNode applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src and a TrustedScriptURL input.
Pass Element.setAttributeNode applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href and a TrustedScriptURL input.
Pass Element.setAttributeNode applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href and a TrustedScriptURL input.
Pass Element.setAttributeNodeNS applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick and a TrustedScript input.
Pass Element.setAttributeNodeNS applies default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick and a TrustedScript input.
Pass Element.setAttributeNodeNS applies default policy for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown and a TrustedScript input.
Pass Element.setAttributeNodeNS applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc and a TrustedHTML input.
Pass Element.setAttributeNodeNS applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src and a TrustedScriptURL input.
Pass Element.setAttributeNodeNS applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href and a TrustedScriptURL input.
Pass Element.setAttributeNodeNS applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href and a TrustedScriptURL input.
Pass NamedNodeMap.setNamedItem applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick and a TrustedScript input.
Pass NamedNodeMap.setNamedItem applies default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick and a TrustedScript input.
Pass NamedNodeMap.setNamedItem applies default policy for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown and a TrustedScript input.
Pass NamedNodeMap.setNamedItem applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc and a TrustedHTML input.
Pass NamedNodeMap.setNamedItem applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src and a TrustedScriptURL input.
Pass NamedNodeMap.setNamedItem applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href and a TrustedScriptURL input.
Pass NamedNodeMap.setNamedItem applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href and a TrustedScriptURL input.
Pass NamedNodeMap.setNamedItemNS applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick and a TrustedScript input.
Pass NamedNodeMap.setNamedItemNS applies default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick and a TrustedScript input.
Pass NamedNodeMap.setNamedItemNS applies default policy for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown and a TrustedScript input.
Pass NamedNodeMap.setNamedItemNS applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc and a TrustedHTML input.
Pass NamedNodeMap.setNamedItemNS applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src and a TrustedScriptURL input.
Pass NamedNodeMap.setNamedItemNS applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href and a TrustedScriptURL input.
Pass NamedNodeMap.setNamedItemNS applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href and a TrustedScriptURL input.
Pass Attr.value applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick and a TrustedScript input.
Pass Attr.value applies default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick and a TrustedScript input.
Pass Attr.value applies default policy for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown and a TrustedScript input.
Pass Attr.value applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc and a TrustedHTML input.
Pass Attr.value applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src and a TrustedScriptURL input.
Pass Attr.value applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href and a TrustedScriptURL input.
Pass Attr.value applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href and a TrustedScriptURL input.
Pass Node.nodeValue applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick and a TrustedScript input.
Pass Node.nodeValue applies default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick and a TrustedScript input.
Pass Node.nodeValue applies default policy for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown and a TrustedScript input.
Pass Node.nodeValue applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc and a TrustedHTML input.
Pass Node.nodeValue applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src and a TrustedScriptURL input.
Pass Node.nodeValue applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href and a TrustedScriptURL input.
Pass Node.nodeValue applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href and a TrustedScriptURL input.
Pass Node.textContent applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick and a TrustedScript input.
Pass Node.textContent applies default policy for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick and a TrustedScript input.
Pass Node.textContent applies default policy for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown and a TrustedScript input.
Pass Node.textContent applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc and a TrustedHTML input.
Pass Node.textContent applies default policy for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src and a TrustedScriptURL input.
Pass Node.textContent applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href and a TrustedScriptURL input.
Pass Node.textContent applies default policy for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href and a TrustedScriptURL input.

View file

@ -0,0 +1,269 @@
Harness status: OK
Found 264 tests
264 Pass
Pass Element.setAttribute throws for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick with a plain string
Pass Element.setAttribute throws for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick with a plain string
Pass Element.setAttribute throws for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown with a plain string
Pass Element.setAttribute throws for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc with a plain string
Pass Element.setAttribute throws for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src with a plain string
Pass Element.setAttribute throws for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href with a plain string
Pass Element.setAttribute works for elementNS=https://example.com/namespace, element=foo, attrName=onmouseup with a plain string
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=ondoesnotexist with a plain string
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=data-onclick with a plain string
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=srcdoc with a plain string
Pass Element.setAttribute works for elementNS=https://example.com/namespace, element=iframe, attrName=srcdoc with a plain string
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=data-srcdoc with a plain string
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=src with a plain string
Pass Element.setAttribute works for elementNS=https://example.com/namespace, element=script, attrName=src with a plain string
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=data-src with a plain string
Pass Element.setAttribute works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=href with a plain string
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=href with a plain string
Pass Element.setAttribute works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=src with a plain string
Pass Element.setAttributeNS throws for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick with a plain string
Pass Element.setAttributeNS throws for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick with a plain string
Pass Element.setAttributeNS throws for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown with a plain string
Pass Element.setAttributeNS throws for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc with a plain string
Pass Element.setAttributeNS throws for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src with a plain string
Pass Element.setAttributeNS throws for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href with a plain string
Pass Element.setAttributeNS throws for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href with a plain string
Pass Element.setAttributeNS works for elementNS=https://example.com/namespace, element=foo, attrName=onmouseup with a plain string
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrNS=https://example.com/namespace, attrName=onclick with a plain string
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=ondoesnotexist with a plain string
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=data-onclick with a plain string
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=srcdoc with a plain string
Pass Element.setAttributeNS works for elementNS=https://example.com/namespace, element=iframe, attrName=srcdoc with a plain string
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrNS=https://example.com/namespace, attrName=srcdoc with a plain string
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=data-srcdoc with a plain string
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=src with a plain string
Pass Element.setAttributeNS works for elementNS=https://example.com/namespace, element=script, attrName=src with a plain string
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrNS=https://example.com/namespace, attrName=src with a plain string
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=data-src with a plain string
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=href with a plain string
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=href with a plain string
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=https://example.com/namespace, attrName=href with a plain string
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=src with a plain string
Pass Element.setAttributeNode throws for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick with a plain string
Pass Element.setAttributeNode throws for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick with a plain string
Pass Element.setAttributeNode throws for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown with a plain string
Pass Element.setAttributeNode throws for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc with a plain string
Pass Element.setAttributeNode throws for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src with a plain string
Pass Element.setAttributeNode throws for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href with a plain string
Pass Element.setAttributeNode throws for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href with a plain string
Pass Element.setAttributeNode works for elementNS=https://example.com/namespace, element=foo, attrName=onmouseup with a plain string
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrNS=https://example.com/namespace, attrName=onclick with a plain string
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=ondoesnotexist with a plain string
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=data-onclick with a plain string
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=srcdoc with a plain string
Pass Element.setAttributeNode works for elementNS=https://example.com/namespace, element=iframe, attrName=srcdoc with a plain string
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrNS=https://example.com/namespace, attrName=srcdoc with a plain string
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=data-srcdoc with a plain string
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=src with a plain string
Pass Element.setAttributeNode works for elementNS=https://example.com/namespace, element=script, attrName=src with a plain string
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrNS=https://example.com/namespace, attrName=src with a plain string
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=data-src with a plain string
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=href with a plain string
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=href with a plain string
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=https://example.com/namespace, attrName=href with a plain string
Pass Element.setAttributeNode works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=src with a plain string
Pass Element.setAttributeNodeNS throws for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick with a plain string
Pass Element.setAttributeNodeNS throws for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick with a plain string
Pass Element.setAttributeNodeNS throws for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown with a plain string
Pass Element.setAttributeNodeNS throws for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc with a plain string
Pass Element.setAttributeNodeNS throws for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src with a plain string
Pass Element.setAttributeNodeNS throws for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href with a plain string
Pass Element.setAttributeNodeNS throws for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href with a plain string
Pass Element.setAttributeNodeNS works for elementNS=https://example.com/namespace, element=foo, attrName=onmouseup with a plain string
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrNS=https://example.com/namespace, attrName=onclick with a plain string
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=ondoesnotexist with a plain string
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=data-onclick with a plain string
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=srcdoc with a plain string
Pass Element.setAttributeNodeNS works for elementNS=https://example.com/namespace, element=iframe, attrName=srcdoc with a plain string
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrNS=https://example.com/namespace, attrName=srcdoc with a plain string
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=data-srcdoc with a plain string
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=src with a plain string
Pass Element.setAttributeNodeNS works for elementNS=https://example.com/namespace, element=script, attrName=src with a plain string
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrNS=https://example.com/namespace, attrName=src with a plain string
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=data-src with a plain string
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=href with a plain string
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=href with a plain string
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=https://example.com/namespace, attrName=href with a plain string
Pass Element.setAttributeNodeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=src with a plain string
Pass NamedNodeMap.setNamedItem throws for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick with a plain string
Pass NamedNodeMap.setNamedItem throws for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick with a plain string
Pass NamedNodeMap.setNamedItem throws for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown with a plain string
Pass NamedNodeMap.setNamedItem throws for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc with a plain string
Pass NamedNodeMap.setNamedItem throws for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src with a plain string
Pass NamedNodeMap.setNamedItem throws for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href with a plain string
Pass NamedNodeMap.setNamedItem throws for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href with a plain string
Pass NamedNodeMap.setNamedItem works for elementNS=https://example.com/namespace, element=foo, attrName=onmouseup with a plain string
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrNS=https://example.com/namespace, attrName=onclick with a plain string
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=ondoesnotexist with a plain string
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=data-onclick with a plain string
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=srcdoc with a plain string
Pass NamedNodeMap.setNamedItem works for elementNS=https://example.com/namespace, element=iframe, attrName=srcdoc with a plain string
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrNS=https://example.com/namespace, attrName=srcdoc with a plain string
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=data-srcdoc with a plain string
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=src with a plain string
Pass NamedNodeMap.setNamedItem works for elementNS=https://example.com/namespace, element=script, attrName=src with a plain string
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrNS=https://example.com/namespace, attrName=src with a plain string
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=data-src with a plain string
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=href with a plain string
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=href with a plain string
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=https://example.com/namespace, attrName=href with a plain string
Pass NamedNodeMap.setNamedItem works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=src with a plain string
Pass NamedNodeMap.setNamedItemNS throws for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick with a plain string
Pass NamedNodeMap.setNamedItemNS throws for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick with a plain string
Pass NamedNodeMap.setNamedItemNS throws for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown with a plain string
Pass NamedNodeMap.setNamedItemNS throws for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc with a plain string
Pass NamedNodeMap.setNamedItemNS throws for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src with a plain string
Pass NamedNodeMap.setNamedItemNS throws for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href with a plain string
Pass NamedNodeMap.setNamedItemNS throws for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href with a plain string
Pass NamedNodeMap.setNamedItemNS works for elementNS=https://example.com/namespace, element=foo, attrName=onmouseup with a plain string
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrNS=https://example.com/namespace, attrName=onclick with a plain string
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=ondoesnotexist with a plain string
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=data-onclick with a plain string
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=srcdoc with a plain string
Pass NamedNodeMap.setNamedItemNS works for elementNS=https://example.com/namespace, element=iframe, attrName=srcdoc with a plain string
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrNS=https://example.com/namespace, attrName=srcdoc with a plain string
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=data-srcdoc with a plain string
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=src with a plain string
Pass NamedNodeMap.setNamedItemNS works for elementNS=https://example.com/namespace, element=script, attrName=src with a plain string
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrNS=https://example.com/namespace, attrName=src with a plain string
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=data-src with a plain string
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=href with a plain string
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=href with a plain string
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=https://example.com/namespace, attrName=href with a plain string
Pass NamedNodeMap.setNamedItemNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=src with a plain string
Pass Attr.value throws for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick with a plain string
Pass Attr.value throws for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick with a plain string
Pass Attr.value throws for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown with a plain string
Pass Attr.value throws for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc with a plain string
Pass Attr.value throws for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src with a plain string
Pass Attr.value throws for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href with a plain string
Pass Attr.value throws for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href with a plain string
Pass Attr.value works for elementNS=https://example.com/namespace, element=foo, attrName=onmouseup with a plain string
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrNS=https://example.com/namespace, attrName=onclick with a plain string
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=ondoesnotexist with a plain string
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=data-onclick with a plain string
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=srcdoc with a plain string
Pass Attr.value works for elementNS=https://example.com/namespace, element=iframe, attrName=srcdoc with a plain string
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrNS=https://example.com/namespace, attrName=srcdoc with a plain string
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=data-srcdoc with a plain string
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=src with a plain string
Pass Attr.value works for elementNS=https://example.com/namespace, element=script, attrName=src with a plain string
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrNS=https://example.com/namespace, attrName=src with a plain string
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=data-src with a plain string
Pass Attr.value works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=href with a plain string
Pass Attr.value works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=href with a plain string
Pass Attr.value works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=https://example.com/namespace, attrName=href with a plain string
Pass Attr.value works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=src with a plain string
Pass Node.nodeValue throws for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick with a plain string
Pass Node.nodeValue throws for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick with a plain string
Pass Node.nodeValue throws for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown with a plain string
Pass Node.nodeValue throws for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc with a plain string
Pass Node.nodeValue throws for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src with a plain string
Pass Node.nodeValue throws for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href with a plain string
Pass Node.nodeValue throws for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href with a plain string
Pass Node.nodeValue works for elementNS=https://example.com/namespace, element=foo, attrName=onmouseup with a plain string
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrNS=https://example.com/namespace, attrName=onclick with a plain string
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=ondoesnotexist with a plain string
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=data-onclick with a plain string
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=srcdoc with a plain string
Pass Node.nodeValue works for elementNS=https://example.com/namespace, element=iframe, attrName=srcdoc with a plain string
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrNS=https://example.com/namespace, attrName=srcdoc with a plain string
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=data-srcdoc with a plain string
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=src with a plain string
Pass Node.nodeValue works for elementNS=https://example.com/namespace, element=script, attrName=src with a plain string
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrNS=https://example.com/namespace, attrName=src with a plain string
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=data-src with a plain string
Pass Node.nodeValue works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=href with a plain string
Pass Node.nodeValue works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=href with a plain string
Pass Node.nodeValue works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=https://example.com/namespace, attrName=href with a plain string
Pass Node.nodeValue works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=src with a plain string
Pass Node.textContent throws for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick with a plain string
Pass Node.textContent throws for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick with a plain string
Pass Node.textContent throws for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown with a plain string
Pass Node.textContent throws for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc with a plain string
Pass Node.textContent throws for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src with a plain string
Pass Node.textContent throws for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href with a plain string
Pass Node.textContent throws for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href with a plain string
Pass Node.textContent works for elementNS=https://example.com/namespace, element=foo, attrName=onmouseup with a plain string
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrNS=https://example.com/namespace, attrName=onclick with a plain string
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=ondoesnotexist with a plain string
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=data-onclick with a plain string
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=srcdoc with a plain string
Pass Node.textContent works for elementNS=https://example.com/namespace, element=iframe, attrName=srcdoc with a plain string
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrNS=https://example.com/namespace, attrName=srcdoc with a plain string
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=data-srcdoc with a plain string
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=src with a plain string
Pass Node.textContent works for elementNS=https://example.com/namespace, element=script, attrName=src with a plain string
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrNS=https://example.com/namespace, attrName=src with a plain string
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=data-src with a plain string
Pass Node.textContent works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=href with a plain string
Pass Node.textContent works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=href with a plain string
Pass Node.textContent works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=https://example.com/namespace, attrName=href with a plain string
Pass Node.textContent works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=src with a plain string
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick with a TrustedScript input.
Pass Element.setAttribute works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick with a TrustedScript input.
Pass Element.setAttribute works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown with a TrustedScript input.
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc with a TrustedHTML input.
Pass Element.setAttribute works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src with a TrustedScriptURL input.
Pass Element.setAttribute works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href with a TrustedScriptURL input.
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick with a TrustedScript input.
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick with a TrustedScript input.
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown with a TrustedScript input.
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc with a TrustedHTML input.
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src with a TrustedScriptURL input.
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href with a TrustedScriptURL input.
Pass Element.setAttributeNS works for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href with a TrustedScriptURL input.
Pass Element.setAttributeNode throws for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick with a TrustedScript input.
Pass Element.setAttributeNode throws for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick with a TrustedScript input.
Pass Element.setAttributeNode throws for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown with a TrustedScript input.
Pass Element.setAttributeNode throws for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc with a TrustedHTML input.
Pass Element.setAttributeNode throws for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src with a TrustedScriptURL input.
Pass Element.setAttributeNode throws for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href with a TrustedScriptURL input.
Pass Element.setAttributeNode throws for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href with a TrustedScriptURL input.
Pass Element.setAttributeNodeNS throws for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick with a TrustedScript input.
Pass Element.setAttributeNodeNS throws for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick with a TrustedScript input.
Pass Element.setAttributeNodeNS throws for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown with a TrustedScript input.
Pass Element.setAttributeNodeNS throws for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc with a TrustedHTML input.
Pass Element.setAttributeNodeNS throws for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src with a TrustedScriptURL input.
Pass Element.setAttributeNodeNS throws for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href with a TrustedScriptURL input.
Pass Element.setAttributeNodeNS throws for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href with a TrustedScriptURL input.
Pass NamedNodeMap.setNamedItem throws for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick with a TrustedScript input.
Pass NamedNodeMap.setNamedItem throws for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick with a TrustedScript input.
Pass NamedNodeMap.setNamedItem throws for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown with a TrustedScript input.
Pass NamedNodeMap.setNamedItem throws for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc with a TrustedHTML input.
Pass NamedNodeMap.setNamedItem throws for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src with a TrustedScriptURL input.
Pass NamedNodeMap.setNamedItem throws for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href with a TrustedScriptURL input.
Pass NamedNodeMap.setNamedItem throws for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href with a TrustedScriptURL input.
Pass NamedNodeMap.setNamedItemNS throws for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick with a TrustedScript input.
Pass NamedNodeMap.setNamedItemNS throws for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick with a TrustedScript input.
Pass NamedNodeMap.setNamedItemNS throws for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown with a TrustedScript input.
Pass NamedNodeMap.setNamedItemNS throws for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc with a TrustedHTML input.
Pass NamedNodeMap.setNamedItemNS throws for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src with a TrustedScriptURL input.
Pass NamedNodeMap.setNamedItemNS throws for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href with a TrustedScriptURL input.
Pass NamedNodeMap.setNamedItemNS throws for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href with a TrustedScriptURL input.
Pass Attr.value throws for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick with a TrustedScript input.
Pass Attr.value throws for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick with a TrustedScript input.
Pass Attr.value throws for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown with a TrustedScript input.
Pass Attr.value throws for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc with a TrustedHTML input.
Pass Attr.value throws for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src with a TrustedScriptURL input.
Pass Attr.value throws for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href with a TrustedScriptURL input.
Pass Attr.value throws for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href with a TrustedScriptURL input.
Pass Node.nodeValue throws for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick with a TrustedScript input.
Pass Node.nodeValue throws for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick with a TrustedScript input.
Pass Node.nodeValue throws for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown with a TrustedScript input.
Pass Node.nodeValue throws for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc with a TrustedHTML input.
Pass Node.nodeValue throws for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src with a TrustedScriptURL input.
Pass Node.nodeValue throws for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href with a TrustedScriptURL input.
Pass Node.nodeValue throws for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href with a TrustedScriptURL input.
Pass Node.textContent throws for elementNS=http://www.w3.org/1999/xhtml, element=DIV, attrName=onclick with a TrustedScript input.
Pass Node.textContent throws for elementNS=http://www.w3.org/2000/svg, element=g, attrName=ondblclick with a TrustedScript input.
Pass Node.textContent throws for elementNS=http://www.w3.org/1998/Math/MathML, element=mrow, attrName=onmousedown with a TrustedScript input.
Pass Node.textContent throws for elementNS=http://www.w3.org/1999/xhtml, element=IFRAME, attrName=srcdoc with a TrustedHTML input.
Pass Node.textContent throws for elementNS=http://www.w3.org/1999/xhtml, element=SCRIPT, attrName=src with a TrustedScriptURL input.
Pass Node.textContent throws for elementNS=http://www.w3.org/2000/svg, element=script, attrName=href with a TrustedScriptURL input.
Pass Node.textContent throws for elementNS=http://www.w3.org/2000/svg, element=script, attrNS=http://www.w3.org/1999/xlink, attrName=href with a TrustedScriptURL input.

View file

@ -0,0 +1,98 @@
<!DOCTYPE html>
<head>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="support/namespaces.js"></script>
<meta http-equiv="Content-Security-Policy" content="require-trusted-types-for 'script'">
<link rel="help" href="https://w3c.github.io/trusted-types/dist/spec/#get-trusted-type-data-for-attribute">
<link rel="help" href="https://github.com/whatwg/dom/pull/1268">
</head>
<script>
const input_string = "unsafe string";
const output_string = "safe string";
let iframeElement;
let scriptElement;
let svgScriptElement;
let seenSinkName;
let seenTrustedTypeName;
function resetGlobalVariables() {
iframeElement = document.createElement('iframe');
scriptElement = document.createElement('script');
svgScriptElement = document.createElementNS(NSURI_SVG, 'script');
seenSinkName = undefined;
seenTrustedTypeName = undefined;
}
resetGlobalVariables();
function createTrustedType(input, trustedTypeName, sinkName) {
assert_equals(input, input_string);
assert_equals(seenSinkName, undefined);
seenSinkName = sinkName;
assert_equals(seenTrustedTypeName, undefined);
seenTrustedTypeName = trustedTypeName;
return output_string;
}
trustedTypes.createPolicy("default", {
createHTML: createTrustedType,
createScript: createTrustedType,
createScriptURL: createTrustedType,
});
test(t => {
t.add_cleanup(resetGlobalVariables);
iframeElement.setAttribute("srcdoc", input_string);
assert_equals(seenTrustedTypeName, "TrustedHTML");
assert_equals(seenSinkName, "HTMLIFrameElement srcdoc");
assert_equals(iframeElement.getAttribute("srcdoc"), output_string);
}, "HTMLIFrameElement.setAttribute('srcdoc', plain_string)");
test(t => {
t.add_cleanup(resetGlobalVariables);
iframeElement.setAttributeNS(null, "srcdoc", input_string);
assert_equals(seenTrustedTypeName, "TrustedHTML");
assert_equals(seenSinkName, "HTMLIFrameElement srcdoc");
assert_equals(iframeElement.getAttribute("srcdoc"), output_string);
}, "HTMLIFrameElement.setAttributeNS(null, 'srcdoc', plain_string)");
test(t => {
t.add_cleanup(resetGlobalVariables);
scriptElement.setAttribute("src", input_string);
assert_equals(seenTrustedTypeName, "TrustedScriptURL");
assert_equals(seenSinkName, "HTMLScriptElement src");
assert_equals(scriptElement.getAttribute("src"), output_string);
}, "HTMLScriptElement.setAttribute('src', plain_string)");
test(t => {
t.add_cleanup(resetGlobalVariables);
scriptElement.setAttributeNS(null, "src", input_string);
assert_equals(seenTrustedTypeName, "TrustedScriptURL");
assert_equals(seenSinkName, "HTMLScriptElement src");
assert_equals(scriptElement.getAttribute("src"), output_string);
}, "HTMLScriptElement.setAttributeNS(null, 'src', plain_string)");
test(t => {
t.add_cleanup(resetGlobalVariables);
svgScriptElement.setAttribute("href", input_string);
assert_equals(seenTrustedTypeName, "TrustedScriptURL");
assert_equals(seenSinkName, "SVGScriptElement href");
assert_equals(svgScriptElement.getAttribute("href"), output_string);
}, "SVGScriptElement.setAttribute('href', plain_string)");
test(t => {
t.add_cleanup(resetGlobalVariables);
svgScriptElement.setAttributeNS(null, "href", input_string);
assert_equals(seenTrustedTypeName, "TrustedScriptURL");
assert_equals(seenSinkName, "SVGScriptElement href");
assert_equals(svgScriptElement.getAttribute("href"), output_string);
}, "SVGScriptElement.setAttributeNS(null, 'href', plain_string)");
test(t => {
t.add_cleanup(resetGlobalVariables);
svgScriptElement.setAttributeNS(NSURI_XLINK, "href", input_string);
assert_equals(seenTrustedTypeName, "TrustedScriptURL");
assert_equals(seenSinkName, "SVGScriptElement href");
assert_equals(svgScriptElement.getAttributeNS(NSURI_XLINK, "href"),
output_string);
assert_equals(svgScriptElement.getAttribute("href"), output_string);
}, "SVGScriptElement.setAttributeNS(NSURI_XLINK, 'href', plain_string)");
</script>

View file

@ -0,0 +1,22 @@
<!DOCTYPE html>
<script src="../resources/testharness.js" ></script>
<script src="../resources/testharnessreport.js"></script>
<script src="./support/namespaces.js"></script>
<script src="./support/attributes.js"></script>
<script>
// Verify getAttributeType() for each testcase of trustedTypeDataForAttribute.
trustedTypeDataForAttribute.forEach(testData => {
test(() => {
let type = trustedTypes.getAttributeType(
testData.element().tagName,
testData.attrName,
testData.element().namespaceURI,
testData.attrNS);
assert_equals(type, testData.type);
}, `getAttributeType(
"${testData.element().tagName}",
"${testData.attrName}",
"${testData.element().namespaceURI}",
"${testData.attrNS}") == "${testData.type}"`);
});
</script>

View file

@ -0,0 +1,232 @@
<!DOCTYPE html>
<script src="../resources/testharness.js" ></script>
<script src="../resources/testharnessreport.js"></script>
<script src="./support/namespaces.js"></script>
<script src="./support/attributes.js"></script>
<meta http-equiv="Content-Security-Policy" content="require-trusted-types-for 'script';">
<iframe id="iframe"></iframe>
<script>
// Create a default policy, which performs a mutation and transform its input.
const input_string = "unsafe_input";
const output_string = "safe_output";
const other_string = "other_value";
let applyMutation, finalChecks;
function testCleanup() {
applyMutation = undefined;
finalChecks = undefined;
}
function createTrustedType(input) {
if (window.applyMutation) {
assert_equals(input, input_string);
window.applyMutation();
}
return output_string;
}
trustedTypes.createPolicy("default", {
createHTML: createTrustedType,
createScript: createTrustedType,
createScriptURL: createTrustedType,
});
function assertReturnValue(api, returnValue, attributeNodeInCallback) {
switch (api) {
case "Element.setAttribute":
case "Element.setAttributeNS":
assert_equals(returnValue, undefined);
break;
case "Element.setAttributeNode":
case "Element.setAttributeNodeNS":
case "NamedNodeMap.setNamedItem":
case "NamedNodeMap.setNamedItemNS":
assert_equals(returnValue, attributeNodeInCallback);
break;
case "Attr.value":
case "Node.nodeValue":
case "Node.textContent":
assert_equals(returnValue, input_string);
break;
default:
assert_unreached();
}
}
const mutationsData = {
"delete other attribute before": function(setterData, testData) {
let element = testData.element();
// The attribute map ordering is not specified, but we assume
// beforeName/afterName are respectively placed before/after attrName.
let beforeName = `A`;
let afterName = `${testData.attrName}Z`;
element.setAttributeNS(testData.attrNS, beforeName, other_string);
element.setAttributeNS(testData.attrNS, testData.attrName,
createTrustedOutput(testData.type, other_string));
element.setAttributeNS(testData.attrNS, afterName, other_string);
window.applyMutation = function() {
element.removeAttributeNS(testData.attrNS, beforeName);
attributeNodeInCallback = findAttribute(element, testData.attrNS,
testData.attrName);
};
const returnValue = setterData.runSetter(element, testData.attrNS,
testData.attrName,
input_string, testData.type);
assert_equals(element.attributes.length, 2);
assert_equals(element.getAttributeNS(testData.attrNS,
testData.attrName), output_string);
assert_true(element.hasAttributeNS(testData.attrNS, afterName));
assertReturnValue(setterData.api, returnValue, attributeNodeInCallback);
},
"delete attribute": function(setterData, testData) {
let element = testData.element();
// The attribute map ordering is not specified, but we assume
// beforeName/afterName are respectively placed before/after attrName.
let beforeName = `A`;
let afterName = `${testData.attrName}Z`;
element.setAttributeNS(testData.attrNS, beforeName, other_string);
element.setAttributeNS(testData.attrNS, testData.attrName,
createTrustedOutput(testData.type, other_string));
element.setAttributeNS(testData.attrNS, afterName, other_string);
window.applyMutation = function() {
element.removeAttributeNS(testData.attrNS, testData.attrName);
};
const returnValue = setterData.runSetter(element, testData.attrNS,
testData.attrName,
input_string, testData.type);
switch (setterData.api) {
case "Element.setAttribute":
case "Element.setAttributeNS":
case "Element.setAttributeNode":
case "Element.setAttributeNodeNS":
case "NamedNodeMap.setNamedItem":
case "NamedNodeMap.setNamedItemNS":
// These APIs successfully sets the attribute on the element, even
// though it was deleted by the default policy's callback.
assert_equals(element.attributes.length, 3);
assert_equals(element.getAttributeNS(testData.attrNS,
testData.attrName),
output_string);
break;
case "Attr.value":
case "Node.nodeValue":
case "Node.textContent":
// These APIs successfully sets the attribute node value, but that
// node is detached from the element by the default policy's callback.
assert_equals(element.attributes.length, 2);
assert_equals(setterData.lastAttributeNode.nodeValue, output_string);
break;
default:
assert_unreached();
}
assert_true(element.hasAttributeNS(testData.attrNS, beforeName));
assert_true(element.hasAttributeNS(testData.attrNS, afterName));
assertReturnValue(setterData.api, returnValue, null);
},
"modify attribute": function(setterData, testData) {
let element = testData.element();
let attributeNodeInCallback;
window.applyMutation = function() {
element.setAttributeNS(testData.attrNS, testData.attrName,
createTrustedOutput(testData.type,
other_string));
attributeNodeInCallback = findAttribute(element, testData.attrNS,
testData.attrName);
};
const returnValue = setterData.runSetter(element, testData.attrNS,
testData.attrName,
input_string, testData.type);
assert_equals(element.attributes.length, 1);
assert_equals(element.getAttributeNS(testData.attrNS,
testData.attrName), output_string);
assertReturnValue(setterData.api, returnValue, attributeNodeInCallback);
},
"move attribute node to another element": function(setterData, testData) {
let element = testData.element();
element.setAttributeNS(testData.attrNS, testData.attrName,
createTrustedOutput(testData.type, other_string));
let otherElement = testData.element();
window.applyMutation = function() {
window.applyMutation = undefined;
let ownerElement = setterData.lastAttributeNode.ownerElement;
if (ownerElement) {
ownerElement.removeAttributeNode(setterData.lastAttributeNode);
}
otherElement.setAttributeNode(setterData.lastAttributeNode);
};
let returnValue;
switch (setterData.api) {
case "Element.setAttribute":
case "Element.setAttributeNS":
// These APIs successfully sets the attribute on the element, but the
// default policy's callback also sets it on the other element.
returnValue = setterData.runSetter(element, testData.attrNS,
testData.attrName,
input_string, testData.type);
assert_equals(element.attributes.length, 1);
assert_equals(element.getAttributeNS(testData.attrNS,
testData.attrName),
output_string);
assert_equals(otherElement.attributes.length, 1);
assert_equals(otherElement.getAttributeNS(testData.attrNS,
testData.attrName),
output_string);
break;
case "Element.setAttributeNode":
case "Element.setAttributeNodeNS":
case "NamedNodeMap.setNamedItem":
case "NamedNodeMap.setNamedItemNS":
// These APIs throw a InUseAttributeError, but the default policy's
// callback still sets the attribute on the other element.
assert_throws_dom("InUseAttributeError", _ => {
returnValue = setterData.runSetter(element, testData.attrNS,
testData.attrName,
input_string, testData.type);
});
assert_equals(element.attributes.length, 1);
assert_equals(element.getAttributeNS(testData.attrNS,
testData.attrName),
other_string);
assert_equals(otherElement.attributes.length, 1);
assert_equals(otherElement.getAttributeNS(testData.attrNS,
testData.attrName),
output_string);
break;
case "Attr.value":
case "Node.nodeValue":
case "Node.textContent":
// These APIs successfully sets the attribute node value, the default
// policy's callback moved that node on the other element.
returnValue = setterData.runSetter(element, testData.attrNS,
testData.attrName,
input_string, testData.type);
assert_equals(element.attributes.length, 0);
assert_equals(otherElement.attributes.length, 1);
assert_equals(otherElement.getAttributeNS(testData.attrNS,
testData.attrName),
output_string);
break;
default:
assert_unreached();
}
assertReturnValue(setterData.api, returnValue, undefined);
},
};
// Set an attribute for each testcase of trustedTypeDataForAttribute that are
// trusted type sinks and verify that the default policy works.
for (let mutationName of Object.keys(mutationsData)) {
const mutationData = mutationsData[mutationName];
attributeSetterData.forEach(setterData => {
trustedTypeDataForAttribute.forEach(testData => {
if (testData.attrNS && !setterData.acceptNS) return;
if (testData.type == null) return;
test(t => {
t.add_cleanup(testCleanup);
mutationData(setterData, testData);
}, `${setterData.api} works for \
elementNS=${testData.element().namespaceURI}, \
element=${testData.element().tagName}, \
${testData.attrNS ? 'attrNS='+testData.attrNS+', ' : ''}\
attrName=${testData.attrName} (${mutationName})`);
});
});
}
</script>

View file

@ -0,0 +1,91 @@
<!DOCTYPE html>
<script src="../resources/testharness.js" ></script>
<script src="../resources/testharnessreport.js"></script>
<script src="./support/namespaces.js"></script>
<script src="./support/attributes.js"></script>
<meta http-equiv="Content-Security-Policy" content="require-trusted-types-for 'script';">
<script>
// Create a default policy that check its arguments and transform its input.
const input_string = "unsafe_input";
const output_string = "safe_output";
let seenSinkName;
function resetSeenSinkName() {
seenSinkName = undefined;
}
function createTrustedType(type) {
return function(input, trustedTypeName, sinkName) {
assert_equals(input, input_string);
assert_equals(trustedTypeName, type);
assert_equals(seenSinkName, undefined);
seenSinkName = sinkName;
return output_string;
}
}
trustedTypes.createPolicy("default", {
createHTML: createTrustedType("TrustedHTML"),
createScript: createTrustedType("TrustedScript"),
createScriptURL: createTrustedType("TrustedScriptURL")
});
// Set an attribute for each testcase of trustedTypeDataForAttribute. The CSP
// rule will force the default policy for those corresponding to trusted
// type sinks.
attributeSetterData.forEach(setterData => {
trustedTypeDataForAttribute.forEach(testData => {
if (testData.attrNS && !setterData.acceptNS) return;
test(t => {
t.add_cleanup(resetSeenSinkName);
let element = testData.element();
setterData.runSetter(element, testData.attrNS, testData.attrName,
input_string, testData.type);
let value = element.getAttributeNS(testData.attrNS, testData.attrName);
if (testData.type != null) {
// This is a trusted type sink and default policy applies.
assert_equals(seenSinkName, testData.sink);
assert_equals(value, output_string);
} else {
// Otherwise, this works normally.
assert_equals(seenSinkName, undefined);
assert_equals(value, input_string);
}
}, `${setterData.api} \
${testData.type ? 'applies' : 'does not apply'} default policy for \
elementNS=${testData.element().namespaceURI}, \
element=${testData.element().tagName}, \
${testData.attrNS ? 'attrNS='+testData.attrNS+', ' : ''}\
attrName=${testData.attrName}`);
});
});
// For attributes that are trusted type sinks, try setting them to a value
// that has the expected trusted type.
attributeSetterData.forEach(setterData => {
trustedTypeDataForAttribute.forEach(testData => {
if (testData.attrNS && !setterData.acceptNS) return;
if (!testData.type) return;
test(t => {
t.add_cleanup(resetSeenSinkName);
let element = testData.element();
let trustedInput = createTrustedOutput(testData.type, input_string);
setterData.runSetter(element, testData.attrNS, testData.attrName,
trustedInput, testData.type);
let value = element.getAttributeNS(testData.attrNS, testData.attrName);
if (setterData.acceptTrustedTypeArgumentInIDL) {
// Passing a trusted type should work normally.
assert_equals(seenSinkName, undefined);
assert_equals(value, input_string);
} else {
// TrustedType arguments will be converted to a string when passed
// to this setter, so the default policy applies.
assert_equals(seenSinkName, testData.sink);
assert_equals(value, output_string);
}
}, `${setterData.api} \
${!setterData.acceptTrustedTypeArgumentInIDL ? 'applies' : 'does not apply'} \
default policy for elementNS=${testData.element().namespaceURI}, \
element=${testData.element().tagName}, \
${testData.attrNS ? 'attrNS='+testData.attrNS+', ' : ''} \
attrName=${testData.attrName} and a ${testData.type} input.`);
});
});
</script>

View file

@ -0,0 +1,69 @@
<!DOCTYPE html>
<script src="../resources/testharness.js" ></script>
<script src="../resources/testharnessreport.js"></script>
<script src="./support/namespaces.js"></script>
<script src="./support/attributes.js"></script>
<meta http-equiv="Content-Security-Policy" content="require-trusted-types-for 'script';">
<script>
// Set an attribute for each testcase of trustedTypeDataForAttribute. The CSP
// rule and a null default policy will block those corresponding to trusted
// type sinks.
attributeSetterData.forEach(setterData => {
trustedTypeDataForAttribute.forEach(testData => {
if (testData.attrNS && !setterData.acceptNS) return;
test(() => {
let element = testData.element();
if (testData.type != null) {
// This is a trusted type sink and should be blocked.
assert_throws_js(TypeError, () => {
setterData.runSetter(element, testData.attrNS, testData.attrName,
"neverset", testData.type);
});
} else {
// Otherwise, this works normally.
setterData.runSetter(element, testData.attrNS, testData.attrName,
"somevalue", testData.type);
assert_equals(element.getAttributeNS(testData.attrNS,
testData.attrName), "somevalue");
}
}, `${setterData.api} \
${testData.type ? 'throws' : 'works'} for \
elementNS=${testData.element().namespaceURI}, \
element=${testData.element().tagName}, \
${testData.attrNS ? 'attrNS='+testData.attrNS+', ' : ''} \
attrName=${testData.attrName} with a plain string`);
});
});
// For attributes that are trusted type sinks, try setting them to a value
// that has the expected trusted type.
attributeSetterData.forEach(setterData => {
trustedTypeDataForAttribute.forEach(testData => {
if (!testData.type) return;
if (testData.attrNS && !setterData.acceptNS) return;
test(() => {
let element = testData.element();
let trustedInput = createTrustedOutput(testData.type, "somevalue");
if (setterData.acceptTrustedTypeArgumentInIDL) {
// Passing a trusted type should work normally.
setterData.runSetter(element, testData.attrNS, testData.attrName,
trustedInput, testData.type);
assert_equals(element.getAttributeNS(testData.attrNS,
testData.attrName), "somevalue");
} else {
// TrustedType arguments will be converted to a string when passed
// to this setter, so this is still blocked.
assert_throws_js(TypeError, () => {
setterData.runSetter(element, testData.attrNS, testData.attrName,
"neverset", testData.type);
});
}
}, `${setterData.api} \
${setterData.acceptTrustedTypeArgumentInIDL ? 'works' : 'throws'} for \
elementNS=${testData.element().namespaceURI}, \
element=${testData.element().tagName}, \
${testData.attrNS ? 'attrNS='+testData.attrNS+', ' : ''} \
attrName=${testData.attrName} with a ${testData.type} input.`);
});
});
</script>

View file

@ -0,0 +1,317 @@
const policyWithoutModification =
window.trustedTypes.createPolicy('policyWithoutModification', {
createHTML: s => s,
createScript: s => s,
createScriptURL: s => s,
});
function createTrustedOutput(type, input) {
return type ?
policyWithoutModification[type.replace("Trusted", "create")](input) : input;
}
// This is an array of test cases for testing callers to the
// "Get Trusted Type data for attribute" algorithm e.g. via
// Element.setAttributeNS() or TrustedTypePolicyFactory.getAttributeType().
// https://w3c.github.io/trusted-types/dist/spec/#abstract-opdef-get-trusted-type-data-for-attribute
//
// The test cases are described by objects with the following members:
// - element: a function creating a DOM Element in current document.
// - attrNS: the namespace of the attribute.
// - attrName: the local name of the attribute.
// - type: the required trusted type of the element's attribute as one of the
// string "TrustedHTML", "TrustedScript", "TrustedScriptURL" ; or null if the
// this element's attribute does not correspond to any trusted type sink.
// - sink (optional): If element's attribute is a trusted type sink, this is
// a string with the corresponding sink name.
const trustedTypeDataForAttribute = [
// Valid trusted type sinks for attributes as defined by
// https://w3c.github.io/trusted-types/dist/spec/#abstract-opdef-get-trusted-type-data-for-attribute
// For a more complete coverage of event handler content attributes, see
// set-event-handlers-content-attributes.tentative.html and
// TrustedTypePolicyFactory-getAttributeType-event-handler-content-attributes.tentative.html
{
element: _ => document.createElement("div"),
attrNS: null,
attrName: "onclick",
type: "TrustedScript",
sink: "Element onclick"
},
{
element: _ => document.createElementNS(NSURI_SVG, "g"),
attrNS: null,
attrName: "ondblclick",
type: "TrustedScript",
sink: "Element ondblclick"
},
{
element: _ => document.createElementNS(NSURI_MATHML, "mrow"),
attrNS: null,
attrName: "onmousedown",
type: "TrustedScript",
sink: "Element onmousedown"
},
{
element: _ => document.createElement("iframe"),
attrNS: null,
attrName: "srcdoc",
type: "TrustedHTML",
sink: "HTMLIFrameElement srcdoc",
},
{
element: _ => document.createElement("script"),
attrNS: null,
attrName: "src",
type: "TrustedScriptURL",
sink: "HTMLScriptElement src",
},
{
element: _ => document.createElementNS(NSURI_SVG, "script"),
attrNS: null,
attrName: "href",
type: "TrustedScriptURL",
sink: "SVGScriptElement href",
},
{
element: _ => document.createElementNS(NSURI_SVG, "script"),
attrNS: NSURI_XLINK,
attrName: "href",
type: "TrustedScriptURL",
sink: "SVGScriptElement href",
},
// Below are some cases that are not trusted type sinks.
// event handler attribute name with element in non-HTML/SVG/MathML namespace.
{
element: _ => document.createElementNS(NSURI_FOO, "foo"),
attrNS: null,
attrName: "onmouseup",
type: null,
},
{
// event handler attribute name with non-null namespace.
element: _ => document.createElement("div"),
attrNS: NSURI_FOO,
attrName: "onclick",
type: null,
},
{
// unknown event handler attribute name.
element: _ => document.createElement("div"),
attrNS: null,
attrName: "ondoesnotexist",
type: null,
},
{
// div attribute that is not protected.
element: _ => document.createElement("div"),
attrNS: null,
attrName: "data-onclick",
type: null,
},
{
// srcdoc with element's local name that is not iframe.
element: _ => document.createElement("div"),
attrNS: null,
attrName: "srcdoc",
type: null,
},
{
// srcdoc with element's namespace that is not null.
element: _ => document.createElementNS(NSURI_FOO, "iframe"),
attrNS: null,
attrName: "srcdoc",
type: null,
},
{
// srcdoc with non-null namespace.
element: _ => document.createElement("iframe"),
attrNS: NSURI_FOO,
attrName: "srcdoc",
type: null,
},
{
// iframe attribute name that is not protected.
element: _ => document.createElement("iframe"),
attrNS: null,
attrName: "data-srcdoc",
type: null,
},
{
// src with element's local name that is not script.
element: _ => document.createElement("div"),
attrNS: null,
attrName: "src",
type: null,
},
{
// src with element's namespace that is not null.
element: _ => document.createElementNS(NSURI_FOO, "script"),
attrNS: null,
attrName: "src",
type: null,
},
{
// src with non-null namespace.
element: _ => document.createElement("script"),
attrNS: NSURI_FOO,
attrName: "src",
type: null,
},
{
// script attribute name that is not protected.
element: _ => document.createElement("script"),
attrNS: null,
attrName: "data-src",
type: null,
},
{
// href with element's local name that is not script.
element: _ => document.createElementNS(NSURI_SVG, "g"),
attrNS: null,
attrName: "href",
type: null,
},
{
// href with element's namespace that is not SVG.
element: _ => document.createElement("script"),
attrNS: null,
attrName: "href",
type: null,
},
{
// href with namespace that is neither null nor xlink.
element: _ => document.createElementNS(NSURI_SVG, "script"),
attrNS: NSURI_FOO,
attrName: "href",
type: null,
},
{
// unknown svg script attribute name.
element: _ => document.createElementNS(NSURI_SVG, "script"),
attrNS: null,
attrName: "src",
type: null,
},
];
function findAttribute(element, attrNS, attrName) {
for (let i = 0; i < element.attributes.length; i++) {
let attr = element.attributes[i];
if (attr.namespaceURI === attrNS &&
attr.localName === attrName) {
return attr;
}
}
}
// This is an array of DOM APIs allowing to set attribute values, described as
// objects with the following members:
// - api: the name of the API (e.g "Element.setAttribute").
// - acceptNS: Whether a attribute namespace can be specified as a parameter to
// this API (e.g. setAttributeNS) or if it always works on the null namespace
// (e.g. setAttribute).
// - acceptTrustedTypeArgumentInIDL: Whether the IDL of the API accepts a
// Trusted Type (https://w3c.github.io/trusted-types/dist/spec/#integrations)
// as a parameter (e.g. setAttribute) or if it will otherwise just convert
// such a parameter to a string (e.g. setAttributeNode).
// - runSetter: a function that runs the API to set the element's attribute to
// the specified value. Before being executed, it may need to create an
// attribute node. The attribute node before execution (existing or created)
// is saved on runSetter.lastAttributeNode.
const attributeSetterData = [
{
api: "Element.setAttribute",
acceptNS: false,
acceptTrustedTypeArgumentInIDL: true,
runSetter: function(element, attrNS, attrName, attrValue) {
assert_equals(attrNS, null);
this.lastAttributeNode = findAttribute(element, attrNS, attrName);
return element.setAttribute(attrName, attrValue);
},
},
{
api: "Element.setAttributeNS",
acceptNS: true,
acceptTrustedTypeArgumentInIDL: true,
runSetter: function(element, attrNS, attrName, attrValue) {
this.lastAttributeNode = findAttribute(element, attrNS, attrName);
return element.setAttributeNS(attrNS, attrName, attrValue);
},
},
{
api: "Element.setAttributeNode",
acceptNS: true,
acceptTrustedTypeArgumentInIDL: false,
setterClass: "setAttributeNode",
runSetter: function(element, attrNS, attrName, attrValue, type) {
this.lastAttributeNode = document.createAttributeNS(attrNS, attrName);
this.lastAttributeNode.value = attrValue;
return element.setAttributeNode(this.lastAttributeNode);
},
},
{
api: "Element.setAttributeNodeNS",
acceptNS: true,
acceptTrustedTypeArgumentInIDL: false,
runSetter: function(element, attrNS, attrName, attrValue, type) {
this.lastAttributeNode = document.createAttributeNS(attrNS, attrName);
this.lastAttributeNode.value = attrValue;
return element.setAttributeNodeNS(this.lastAttributeNode);
},
},
{
api: "NamedNodeMap.setNamedItem",
acceptNS: true,
acceptTrustedTypeArgumentInIDL: false,
runSetter: function(element, attrNS, attrName, attrValue, type) {
const nodeMap = element.attributes;
this.lastAttributeNode = document.createAttributeNS(attrNS, attrName);
this.lastAttributeNode.value = attrValue;
return nodeMap.setNamedItem(this.lastAttributeNode);
},
},
{
api: "NamedNodeMap.setNamedItemNS",
acceptNS: true,
acceptTrustedTypeArgumentInIDL: false,
runSetter: function(element, attrNS, attrName, attrValue, type) {
const nodeMap = element.attributes;
this.lastAttributeNode = document.createAttributeNS(attrNS, attrName);
this.lastAttributeNode.value = attrValue;
return nodeMap.setNamedItemNS(this.lastAttributeNode);
},
},
{
api:"Attr.value",
acceptNS: true,
acceptTrustedTypeArgumentInIDL: false,
runSetter: function(element, attrNS, attrName, attrValue, type) {
element.setAttributeNS(attrNS, attrName, createTrustedOutput(type, ""));
this.lastAttributeNode = findAttribute(element, attrNS, attrName);
assert_true(!!this.lastAttributeNode);
return (this.lastAttributeNode.value = attrValue);
},
},
{
api: "Node.nodeValue",
acceptNS: true,
acceptTrustedTypeArgumentInIDL: false,
runSetter: function(element, attrNS, attrName, attrValue, type) {
element.setAttributeNS(attrNS, attrName, createTrustedOutput(type, ""));
this.lastAttributeNode = findAttribute(element, attrNS, attrName);
assert_true(!!this.lastAttributeNode);
return (this.lastAttributeNode.nodeValue = attrValue);
},
},
{
api: "Node.textContent",
acceptNS: true,
acceptTrustedTypeArgumentInIDL: false,
runSetter: function(element, attrNS, attrName, attrValue, type) {
element.setAttributeNS(attrNS, attrName, createTrustedOutput(type, ""));
this.lastAttributeNode = findAttribute(element, attrNS, attrName);
assert_true(!!this.lastAttributeNode);
return (this.lastAttributeNode.textContent = attrValue);
},
},
];