trusted-types icon indicating copy to clipboard operation
trusted-types copied to clipboard

getPropertyType/getAttributeType when null namespaces are passed.

Open fred-wang opened this issue 4 months ago • 1 comments

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 of TrustedTypePolicyFactory-getAttributeType-namespace.html because attribute.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 the Element interface for null namespace, similarly to createElementNs(null, "foo"). However, we don't have any tests for that (see #429).

fred-wang avatar Oct 22 '24 10:10 fred-wang