From ee9915efa94b8b2b344cf74b9befe1eb85d8c35c Mon Sep 17 00:00:00 2001 From: Luke Warlow Date: Thu, 11 Apr 2024 13:12:42 +0100 Subject: [PATCH] Remove sink values from spec --- dom.bs | 89 ++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 49 insertions(+), 40 deletions(-) diff --git a/dom.bs b/dom.bs index eb48d9a5..52e447f7 100644 --- a/dom.bs +++ b/dom.bs @@ -4278,7 +4278,7 @@ empty string instead, and then do as described below, switching on the interface
{{Attr}} -

Set an existing attribute value with this, the given value, and "Node nodeValue". +

Set an existing attribute value with this, the given value.

{{CharacterData}}

Replace data with node this, offset 0, count this's @@ -4331,8 +4331,7 @@ do as defined below, switching on the interface node implements

String replace all with value within node.

{{Attr}} -

Set an existing attribute value with node, value and - "Node textContent". +

Set an existing attribute value with node, value.

{{CharacterData}}

Replace data with node node, offset 0, count node's @@ -4455,7 +4454,8 @@ dom-Range-extractContents, dom-Range-cloneContents -->

  1. Let copyAttribute be a clone of attribute. -

  2. Append copyAttribute to copy. +

  3. Append copyAttribute to copy, + with false.

@@ -6368,26 +6368,36 @@ given a document, localName, namespace, and opt

To change an -attribute attribute to value, with string sink, run these steps: +attribute attribute to value, run these steps:

  1. Let oldValue be attribute's value.

  2. Validate and set attribute value value for attribute, with - attribute's element, and sink. + attribute's element. -

  3. Handle attribute changes for attribute with attribute's - element, oldValue, and value. +

  4. If attribute's element has + an attribute attribute, then handle attribute changes for + attribute with attribute's element, oldValue, and + value. + +

  5. Otherwise, throw an "{{InvalidStateError!!exception}}" {{DOMException}}.

To append an attribute attribute to an element element, with optional -string sink (default ""), run these steps: +boolean validate (default true), run these steps:

    -
  1. If sink is not an empty string Validate and set attribute value - attribute's value for attribute with element, - and sink. +

  2. +

    If validate, then: +

      +
    1. Validate and set attribute value + attribute's value for attribute with element. + +

    2. If element has an attribute + attribute, then throw an "{{InvalidStateError!!exception}}" {{DOMException}}. +

  3. Append attribute to element's attribute list. @@ -6432,12 +6442,12 @@ string sink (default ""), run these steps:

    To validate and set attribute value {{TrustedType}} or a string value for an attribute attribute, with -element element, and string sink: +element element:

    1. Let validValue be the result of calling get Trusted Types-compliant attribute value for attribute, with - element, value, and sink. [[!TRUSTED-TYPES]] + element, value. [[!TRUSTED-TYPES]]

    2. Set attribute's value to validValue.

    @@ -6491,8 +6501,7 @@ string namespace (default null):

    To set an attribute given an -attribute attr, an element element, -and a string sink: +attribute attr, an element element.

    1. If attr's element is neither null nor element, @@ -6510,13 +6519,16 @@ and a string sink:

      -
    2. Otherwise, append attr to element - with sink. +

    3. Otherwise, append attr to element.

    4. Return oldAttr.

    @@ -6526,7 +6538,7 @@ and a string sink:

    To set an attribute value given an element element, a string localName, a string or {{TrustedType}} value, an optional null or string prefix (default null), an optional null -or string namespace (default null), and an optional string sink (default ""): +or string namespace (default null):

    1. Let attribute be the result of @@ -6537,10 +6549,9 @@ or string namespace (default null), and an optional string sink< namespace, namespace prefix is prefix, local name is localName, value is value, and node document is element's node document, then - append this attribute to element with - sink, and then return. + append this attribute to element, and then return. -
    2. Change attribute to value, with sink. +

    3. Change attribute to value.

    @@ -6801,13 +6812,12 @@ method steps are: and null otherwise. -
  4. 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 with - "Element setAttribute", and then return. +

  5. 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. -

  6. Change attribute to value, with "Element setAttribute". +

  7. Change attribute to value.

The @@ -6819,7 +6829,7 @@ method steps are: passing namespace and qualifiedName to validate and extract.

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

    The @@ -6868,8 +6878,8 @@ method steps are:

  • If force is not given or is true, create an attribute whose local name is qualifiedName, value is the empty string, and node document is this's node document, then - append this attribute to this with - "Element toggleAttribute", and then return true. + append this attribute to this, + and then return true.

  • Return false. @@ -6907,11 +6917,11 @@ method steps are to return the result of

    The setAttributeNode(attr) methods steps are to return the result of setting an attribute given attr and -this, and "Element setAttributeNode". +this.

    The setAttributeNodeNS(attr) methods steps are to return the result of setting an attribute given attr, -this, and "Element setAttributeNodeNS". +this.

    The removeAttributeNode(attr) method steps are: @@ -7268,11 +7278,11 @@ method steps are to return the result of

    The setNamedItem(attr) method steps are to return the result of setting an attribute given attr, -element, and "NamedNodeMap setNamedItem". +element.

    The setNamedItemNS(attr) method steps are to return the result of setting an attribute given attr, -element, and "NamedNodeMap setNamedItemNS". +element.

    The removeNamedItem(qualifiedName) method steps are: @@ -7377,14 +7387,13 @@ null. value.

    To set an existing attribute value, given an attribute attribute, -string value, and string sink, run these steps: +string value, run these steps:

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

    2. Otherwise, change attribute to value, - with sink. +

    3. Otherwise, change attribute to value.

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