diff --git a/dom.bs b/dom.bs index 9321d93d4..e88bbf5d5 100644 --- a/dom.bs +++ b/dom.bs @@ -52,9 +52,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]] @@ -6033,8 +6035,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); @@ -6357,7 +6359,8 @@ given a document, localName, namespace, and opt
Let oldValue be attribute's value.
Set attribute's value to value. +
Validate and set attribute value value for attribute, with + attribute's element.
Handle attribute changes for attribute with attribute's element, oldValue, and value. @@ -6409,6 +6412,18 @@ steps: value.
To validate and set attribute value +{{TrustedType}} or a string value for an attribute attribute, with +element element: + +
Let validValue be the result of calling + get Trusted Types-compliant attribute value for attribute, with + element and value. [[!TRUSTED-TYPES]] + +
Set attribute's value to validValue. +
If oldAttr is attr, return attr. +
Validate and set attribute value newAttr's value for + newAttr with element. +
If oldAttr is non-null, then replace oldAttr with attr. @@ -6482,21 +6500,30 @@ string namespace (default null):
To set an attribute value given an -element element, a string localName, a string value, -an optional null or string prefix (default null), and an optional null or string -namespace (default null): +element element, a string localName, a string or {{TrustedType}} +value, an optional null or string prefix (default null), and an optional null +or string namespace (default null):
If attribute is null, then: +
Set attribute to a new attribute whose namespace is + namespace, namespace prefix is prefix, + local name is localName and node document is + element's node document. + +
Validate and set attribute value value for attribute with + element. + +
Append attribute to element. + +
Return. +
Change attribute to value.
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. +
If attribute is null, then: + +
Set attribute to a new attribute whose local name is + qualifiedName and node document is this's + node document. + +
Validate and set attribute value value for attribute, + with this. + +
Return. +
Change attribute to value.