trusted-types
trusted-types copied to clipboard
getPropertyType/getAttributeType when null namespaces are passed.
cc @smaug---- @mbrodesser-Igalia @lukewarlow
elementNs
and attrNS
are optional nullable arguments defaulting to the empty string, so we should test what happens when null values are used:
optional DOMString? elementNs = ""
optional DOMString? attrNs = ""
-
For
attrNS
, a null value is explicitly handled in Get Trusted Type data for attribute. This case is covered by "getAttributeType with full namespace info" cases ofTrustedTypePolicyFactory-getAttributeType-namespace.html
becauseattribute.namespaceURI
is null here, but maybe a more explicit test with a null argument would help. -
For
elementNs
, the step retrieving the "element interface for localName and elementNs" is similar to step 7 of DOM's create an element. Probably this is not very explicit, but I understand this falls back to theElement
interface for null namespace, similarly to createElementNs(null, "foo"). However, we don't have any tests for that (see #429).