From 72a2f99e968571989790d58f5b35e8465c52a462 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Sat, 4 Oct 2014 08:55:19 +0200 Subject: [PATCH] Add Symbol.iterator support (sometimes more) to NodeList, HTMLCollection, NamedNodeMap, DOMTokenList, and DOMSettableTokenList https://www.w3.org/Bugs/Public/show_bug.cgi?id=23212 --- Overview.src.html | 14 +++++++++++--- dom-core.html | 16 ++++++++++++---- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/Overview.src.html b/Overview.src.html index 69803732..a0987709 100644 --- a/Overview.src.html +++ b/Overview.src.html @@ -2151,10 +2151,10 @@
Interface NodeList
collection of nodes. -
[ArrayClass]
-interface NodeList {
+
interface NodeList {
   getter Node? item(unsigned long index);
   readonly attribute unsigned long length;
+  iterable<Node>;
 };
@@ -2197,6 +2197,9 @@
Interface NodeList
indexth node in the collection, then the method must return null. +

The values to iterate over are the nodes +represented by the collection. +

@@ -2206,6 +2209,7 @@
Interface HTMLCollection
readonly attribute unsigned long length; getter Element? item(unsigned long index); getter Element? namedItem(DOMString name); + legacyiterable<Element>; };

An HTMLCollection object is a @@ -5635,8 +5639,8 @@

Interface NamedNodeMap

Attr? setNamedItemNS(Attr attr); Attr removeNamedItem(DOMString name); Attr removeNamedItemNS(DOMString? namespace, DOMString localName); + legacyiterator<Attr>; }; -

A NamedNodeMap has an associated element (an @@ -8532,6 +8536,7 @@

Interface DOMTokenList

void remove(DOMString... tokens); boolean toggle(DOMString token, optional boolean force); stringifier; + iterable<DOMString>; };

A DOMTokenList object has an associated ordered set of @@ -8734,6 +8739,9 @@

Interface DOMTokenList

ordered set serializer for tokens. +

The values to iterate over are the +tokens. + diff --git a/dom-core.html b/dom-core.html index 86f7ae96..b360611e 100644 --- a/dom-core.html +++ b/dom-core.html @@ -9,7 +9,7 @@

DOM

-

Living Standard — Last Updated 3 October 2014

+

Living Standard — Last Updated 4 October 2014

@@ -2230,10 +2230,10 @@
4.2.7.1 Interface < collection of nodes. -
[ArrayClass]
-interface NodeList {
+
interface NodeList {
   getter Node? item(unsigned long index);
   readonly attribute unsigned long length;
+  iterable<Node>;
 };
@@ -2275,6 +2275,9 @@
4.2.7.1 Interface < node in the collection. If there is no indexth node in the collection, then the method must return null. +

The values to iterate over are the nodes +represented by the collection. +

@@ -2284,6 +2287,7 @@
4.2.7.2 Interface < readonly attribute unsigned long length; getter Element? item(unsigned long index); getter Element? namedItem(DOMString name); + legacyiterable<Element>; };

An HTMLCollection object is a @@ -5705,8 +5709,8 @@

4.8.1 Interface Attr? setNamedItemNS(Attr attr); Attr removeNamedItem(DOMString name); Attr removeNamedItemNS(DOMString? namespace, DOMString localName); + legacyiterator<Attr>; }; -

A NamedNodeMap has an associated element (an @@ -8601,6 +8605,7 @@

7.1 Interface < void remove(DOMString... tokens); boolean toggle(DOMString token, optional boolean force); stringifier; + iterable<DOMString>; };

A DOMTokenList object has an associated ordered set of @@ -8803,6 +8808,9 @@

7.1 Interface < ordered set serializer for tokens. +

The values to iterate over are the +tokens. +