From 6b06d0be1b3130f590ad0f49f32603974069ad60 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Wed, 30 Mar 2016 18:59:05 +0200 Subject: [PATCH] Editorial: cleanup for NamedNodeMap/Attr/CharacterData --- dom.bs | 109 +++++++++++++++++++++++-------------------------------- dom.html | 59 +++++++++++++++--------------- 2 files changed, 75 insertions(+), 93 deletions(-) diff --git a/dom.bs b/dom.bs index 2f06aab01..d85e7cd94 100644 --- a/dom.bs +++ b/dom.bs @@ -6005,21 +6005,17 @@ range zero to the number of attributes in its attribute list is empty, in which case there are no supported property indices. -The length attribute's getter -must return the number of attributes in the -attribute list. +

The length attribute's getter must return +the number of attributes in the attribute list. -The -item(index) method, -when invoked, must run these steps: +

The item(index) method, when +invoked, must run these steps:

    -
  1. If index is equal to or greater than the number of - attributes in the +
  2. If index is equal to or greater than the number of attributes in the attribute list, return null. -

  3. Otherwise, return the indexth - attribute in the +
  4. Otherwise, return the indexth attribute in the attribute list.

@@ -6049,23 +6045,23 @@ steps:
  • Return names. -The getNamedItem(qualifiedName) +

    The getNamedItem(qualifiedName) method, when invoked, must return the result of getting an attribute given qualifiedName and element. -The -getNamedItemNS(namespace, localName) +

    The +getNamedItemNS(namespace, localName) method, when invoked, must return the result of getting an attribute given namespace, localName, and element. -The setNamedItem(attr) and +

    The setNamedItem(attr) and setNamedItemNS(attr) methods, when invoked, must return the result of setting an attribute given attr and element. Rethrow any exceptions. -The removeNamedItem(qualifiedName) +

    The removeNamedItem(qualifiedName) method, when invoked, must run these steps:

      @@ -6079,20 +6075,18 @@ method, when invoked, must run these steps:
    1. Return attr.

    -The -removeNamedItemNS(namespace, localName) +

    The +removeNamedItemNS(namespace, localName) method, when invoked, must run these steps:

      -
    1. Let attr be the result of - removing an attribute - given namespace, localName, and - element. +
    2. Let attr be the result of + removing an attribute given + namespace, localName, and element. -

    3. If attr is null, throw a - {{NotFoundError}} exception. +
    4. If attr is null, throw a {{NotFoundError}} exception. -

    5. Return attr. +
    6. Return attr.

    @@ -6194,13 +6188,12 @@ handling is required.
    -The ownerElement attribute's getter -must return the element. +

    The ownerElement attribute's getter must return +context object's element.


    -The specified attribute's getter must -return true. +

    The specified attribute's getter must return true.

    Interface {{CharacterData}}

    @@ -6353,48 +6346,36 @@ To data. -The data attribute -must return data, and on setting, must -replace data with node -context object offset 0, count -{{CharacterData/length}} attribute value, and data -new value. +

    The data attribute's getter must return +context object's data. Its setter must replace data with node +context object offset 0, count {{CharacterData/length}} attribute value, and data new value. -The length -attribute must return the number of -code units in -data. +

    The length attribute's getter must return +the number of code units in context object's data. -The -substringData(offset, count) -method must substring data with node -context object, offset offset, and count -count. +

    The +substringData(offset, count) +method, when invoked, must return the result of running substring data with node +context object, offset offset, and count count. -The -appendData(data) -method must replace data with node -context object, offset -{{CharacterData/length}} attribute value, count 0, -and data data. +

    The appendData(data) method, when +invoked, must replace data with node context object, offset {{CharacterData/length}} +attribute value, count 0, and data data. -The -insertData(offset, data) -method must replace data with node -context object, offset offset, count 0, and -data data. +

    The +insertData(offset, data) +method, when invoked, must replace data with node context object, offset +offset, count 0, and data data. -The -deleteData(offset, count) -method must replace data with node -context object, offset offset, count -count, and data the empty string. +

    The +deleteData(offset, count) +method, when invoked, must replace data with node context object, offset +offset, count count, and data the empty string. -The -replaceData(offset, count, data) -method must replace data with node -context object, offset offset, count -count, and data data. +

    The +replaceData(offset, count, data) +method, when invoked, must replace data with node context object, offset +offset, count count, and data data.

    Interface {{Text}}

    diff --git a/dom.html b/dom.html index df68f505e..f1be56fd8 100644 --- a/dom.html +++ b/dom.html @@ -3301,13 +3301,15 @@

    A NamedNodeMap object’s supported property indices are the numbers in the range zero to the number of attributes in its attribute list map minus one, unless the attribute list is empty, in which case there are no supported property indices.

    -

    The length attribute’s getter -must return the number of attributes in the attribute list.

    -

    The item(index) method, -when invoked, must run these steps:

    +

    The length attribute’s getter must return +the number of attributes in the attribute list.

    +

    The item(index) method, when +invoked, must run these steps:

      -
    1. If index is equal to or greater than the number of attributes in the attribute list, return null. -
    2. Otherwise, return the indexth attribute in the attribute list. +
    3. +

      If index is equal to or greater than the number of attributes in the attribute list, return null.

      +
    4. +

      Otherwise, return the indexth attribute in the attribute list.

    A NamedNodeMap object’s supported property names are the return value of running these steps:

    @@ -3326,10 +3328,10 @@

    Return names.

    -

    The getNamedItem(qualifiedName) method, when invoked, must return the result of getting an attribute given qualifiedName and element.

    -

    The getNamedItemNS(namespace, localName) method, when invoked, must return the result of getting an attribute given namespace, localName, and element.

    -

    The setNamedItem(attr) and setNamedItemNS(attr) methods, when invoked, must return the result of setting an attribute given attr and element. Rethrow any exceptions.

    -

    The removeNamedItem(qualifiedName) method, when invoked, must run these steps:

    +

    The getNamedItem(qualifiedName) method, when invoked, must return the result of getting an attribute given qualifiedName and element.

    +

    The getNamedItemNS(namespace, localName) method, when invoked, must return the result of getting an attribute given namespace, localName, and element.

    +

    The setNamedItem(attr) and setNamedItemNS(attr) methods, when invoked, must return the result of setting an attribute given attr and element. Rethrow any exceptions.

    +

    The removeNamedItem(qualifiedName) method, when invoked, must run these steps:

    1. Let attr be the result of removing an attribute given qualifiedName and element.

      @@ -3338,11 +3340,14 @@

      Return attr.

    -

    The removeNamedItemNS(namespace, localName) method, when invoked, must run these steps:

    +

    The removeNamedItemNS(namespace, localName) method, when invoked, must run these steps:

      -
    1. Let attr be the result of removing an attribute given namespace, localName, and element. -
    2. If attr is null, throw a NotFoundError exception. -
    3. Return attr. +
    4. +

      Let attr be the result of removing an attribute given namespace, localName, and element.

      +
    5. +

      If attr is null, throw a NotFoundError exception.

      +
    6. +

      Return attr.

    4.9.2. Interface Attr

    [Exposed=Window]
    @@ -3386,11 +3391,9 @@ 

    Unlike node’s textContent, no special null handling is required.


    -

    The ownerElement attribute’s getter -must return the element.

    +

    The ownerElement attribute’s getter must return context object’s element.


    -

    The specified attribute’s getter must -return true.

    +

    The specified attribute’s getter must return true.

    4.10. Interface CharacterData

    [Exposed=Window]
     interface CharacterData : Node {
    @@ -3432,17 +3435,15 @@ 

    Return a string whose value is the code units from the offsetth code unit to the offset+countth code unit in node’s data. -

    The data attribute -must return data, and on setting, must replace data with node context object offset 0, count length attribute value, and data -new value.

    -

    The length attribute must return the number of code units in data.

    -

    The substringData(offset, count) method must substring data with node context object, offset offset, and count count.

    -

    The appendData(data) method must replace data with node context object, offset length attribute value, count 0, -and data data.

    -

    The insertData(offset, data) method must replace data with node context object, offset offset, count 0, and -data data.

    -

    The deleteData(offset, count) method must replace data with node context object, offset offset, count count, and data the empty string.

    -

    The replaceData(offset, count, data) method must replace data with node context object, offset offset, count count, and data data.

    +

    The data attribute’s getter must return context object’s data. Its setter must replace data with node context object offset 0, count length attribute value, and data new value.

    +

    The length attribute’s getter must return +the number of code units in context object’s data.

    +

    The substringData(offset, count) method, when invoked, must return the result of running substring data with node context object, offset offset, and count count.

    +

    The appendData(data) method, when +invoked, must replace data with node context object, offset length attribute value, count 0, and data data.

    +

    The insertData(offset, data) method, when invoked, must replace data with node context object, offset offset, count 0, and data data.

    +

    The deleteData(offset, count) method, when invoked, must replace data with node context object, offset offset, count count, and data the empty string.

    +

    The replaceData(offset, count, data) method, when invoked, must replace data with node context object, offset offset, count count, and data data.

    4.11. Interface Text

    [Constructor(optional DOMString data = ""),
      Exposed=Window]