diff --git a/dom.bs b/dom.bs index ad8b27a3c..97898fb10 100644 --- a/dom.bs +++ b/dom.bs @@ -6189,6 +6189,40 @@ in an element element, run these steps:
+ +To create an attribute by value +given a qualifiedName, value and element element, run these steps: + +
    +
  1. Create an attribute whose + local name is qualifiedName, value is + value, and node document is context object's + node document. + +

  2. Append this attribute to + element + +
  3. Return. +
+ +To get a valid attribute by name +given a qualifiedName, and element element, run these steps: + +
    +
  1. If qualifiedName does not match the Name production in + XML, then throw an "{{InvalidCharacterError!!exception}}" {{DOMException}}. + +

  2. If element is in the HTML namespace and its node document + is an HTML document, then set qualifiedName to qualifiedName in + ASCII lowercase. + + +

  3. Let attribute be the first attribute in element's attribute list + whose qualified name is qualifiedName, and null otherwise. + +

  4. Return qualifiedName, and attribute. +
+ To get an attribute by name given a qualifiedName and element element, run these steps: @@ -6528,23 +6562,10 @@ method, when invoked, must these steps: method, when invoked, must run these steps:
    -
  1. If qualifiedName does not match the Name production in - XML, then throw an "{{InvalidCharacterError!!exception}}" {{DOMException}}. - -

  2. If the context object is in the HTML namespace and its - node document is an HTML document, then set qualifiedName to - qualifiedName in ASCII lowercase. +

  3. Let qualifiedName and attribute be the result of running get a valid attribute by name given the qualifiedName and context object -

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

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

  6. If attribute is null, run create an attribute by value given the qualifiedName, value and context object, and then return.

  7. Change attribute from context object to value. @@ -6590,36 +6611,25 @@ when invoked, must run these steps: method, when invoked, must run these steps:

      -
    1. If qualifiedName does not match the Name production in - XML, then throw an "{{InvalidCharacterError!!exception}}" {{DOMException}}. - -

    2. If the context object is in the HTML namespace and its - node document is an HTML document, then set qualifiedName to - qualifiedName in ASCII lowercase. - -

    3. Let attribute be the first attribute in the context object's - attribute list whose qualified name is qualifiedName, - and null otherwise. - +

    4. Let qualifiedName and attribute be the result of running get a valid attribute by name given the qualifiedName and context object

    5. If attribute is null, then:

        -
      1. 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 the context object's - node document, then append this attribute - to the context object, and then return true. +

      2. If force is given and is false, return false. -

      3. Return false. +

      4. Run create an attribute by value given the qualifiedName, the empty string and context object. + +

      5. Return true.
      -
    6. Otherwise, if force is not given or is false, - remove an attribute given qualifiedName and the - context object, and then return false. +

    7. Otherwise, if force is given and is true, return true. -

    8. Return true. +

    9. Remove an attribute given qualifiedName and the + context object. + +

    10. Return false.

    The