diff --git a/dom.bs b/dom.bs index e61c3fc0..91f00454 100644 --- a/dom.bs +++ b/dom.bs @@ -50,9 +50,11 @@ spec:html; type:element

This specification depends on the Infra Standard. [[!INFRA]]

Some of the terms used in this specification are defined in Encoding, -Selectors, Web IDL, XML, and Namespaces in XML. +Selectors, Trusted Types, Web IDL, XML, and +Namespaces in XML. [[!ENCODING]] [[!SELECTORS4]] +[[!TRUSTED-TYPES]] [[!WEBIDL]] [[!XML]] [[!XML-NAMES]] @@ -6633,8 +6635,8 @@ interface Element : Node { sequence<DOMString> getAttributeNames(); DOMString? getAttribute(DOMString qualifiedName); DOMString? getAttributeNS(DOMString? namespace, DOMString localName); - [CEReactions] undefined setAttribute(DOMString qualifiedName, DOMString value); - [CEReactions] undefined setAttributeNS(DOMString? namespace, DOMString qualifiedName, DOMString value); + [CEReactions] undefined setAttribute(DOMString qualifiedName, (TrustedType or DOMString) value); + [CEReactions] undefined setAttributeNS(DOMString? namespace, DOMString qualifiedName, (TrustedType or DOMString) value); [CEReactions] undefined removeAttribute(DOMString qualifiedName); [CEReactions] undefined removeAttributeNS(DOMString? namespace, DOMString localName); [CEReactions] boolean toggleAttribute(DOMString qualifiedName, optional boolean force); @@ -7115,6 +7117,11 @@ string namespace (default null):

attribute attr and an element element:
    +
  1. Let verifiedValue be the result of calling + get trusted type compliant attribute value with attr's + local name, attr's namespace, element, and + attr's value. [[!TRUSTED-TYPES]] +

  2. If attr's element is neither null nor element, throw an "{{InUseAttributeError!!exception}}" {{DOMException}}. @@ -7125,6 +7132,8 @@ string namespace (default null):

  3. If oldAttr is attr, return attr. +

  4. Set attr's value to verifiedValue. +

  5. If oldAttr is non-null, then replace oldAttr with attr. @@ -7414,17 +7423,22 @@ method steps are: HTML document, then set qualifiedName to qualifiedName in ASCII lowercase. +

  6. Let verifiedValue be the result of calling + get trusted type compliant attribute value with qualifiedName, null, this, + and value. [[!TRUSTED-TYPES]] +

  7. Let attribute be the first attribute in this's attribute list whose qualified name is qualifiedName, and null otherwise. - -

  8. If attribute is null, create an attribute whose - local name is qualifiedName, value is - value, and node document is this's node document, - then append this attribute to this, and then return. +

  9. If attribute is non-null, then change + attribute to verifiedValue and return. -

  10. Change attribute to value. +

  11. Set attribute to a new attribute whose local name is + qualifiedName, value is verifiedValue, and + node document is this's node document. + +

  12. Append attribute to this.

The @@ -7436,8 +7450,12 @@ method steps are: [=validate and extract|validating and extracting=] namespace and qualifiedName given "element". -

  • Set an attribute value for this using localName, value, - and also prefix and namespace. +

  • Let verifiedValue be the result of calling + get trusted type compliant attribute value with localName, namespace, + this, and value. [[!TRUSTED-TYPES]] + +

  • Set an attribute value for this using localName, + verifiedValue, prefix, and namespace.

    The @@ -8026,9 +8044,19 @@ string value, run these steps:

    1. If attribute's element is null, then set attribute's - value to value. + value to value and return. + +

    2. Let element be attribute's element. + +

    3. Let verifiedValue be the result of calling + get trusted type compliant attribute value with attribute's + local name, attribute's namespace, element, + and value. [[!TRUSTED-TYPES]] + +

    4. If attribute's element is null, then set attribute's + value to verifiedValue and return. -

    5. Otherwise, change attribute to value. +

    6. Change attribute to verifiedValue.

    The {{Attr/value}} setter steps are to set an existing attribute value with this