From 24b8c4f7fcd89596eaf5335d813a559bddbb65cd Mon Sep 17 00:00:00 2001
From: Domenic Denicola The HTMLAllCollection interface is used for the legacy document.all attribute. It operates similarly to
- HTMLCollection; the main differences are that its namedItem() method returns an
- HTMLCollection object when there are multiple matching elements, and that its item() method can be used as a synonym for its namedItem() method.HTMLCollection; the main differences are that it allows a staggering variety of
+ different (ab)uses of its methods to all end up returning something, and that it can be called as
+ a function as an alternative to property access.
All Returns the item with index index from the collection. The items are sorted in tree order. Returns the item with index index from the collection (determined by tree order). The object's supported property indices are as defined for
The supported property names consist of the non-empty values of all the On getting, the The indexed property getter must return the result of getting the "all"-indexed element from this
+ The The If nameOrIndex was not provided, return null. If nameOrIndex, converted to a
+ JavaScript string value, is an array index property name, return the result of getting the "all"-indexed element from this
+ Return the result of getting the "all"-named
+ element(s) from this The following elements are "all"-named elements:
The supported property names consist of the non-empty values of all the On getting, the To get the "all"-indexed element from an
+ The The To get the "all"-named element(s) from an
+ If name is the empty string, return null. Let collection be an Let subCollection be an "all"-named elements with a elements with an ID equal to name. If there is exactly one element in subCollection, then return that
+ element. Otherwise, if subCollection is empty, return null. Otherwise, return subCollection.HTMLAllCollection objects are rooted at a Document
and have a filter that matches all elements, so the elements represented by the
@@ -7156,9 +7154,9 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
[LegacyUnenumerableNamedProperties]
interface HTMLAllCollection {
readonly attribute unsigned long length;
- getter Element? item(unsigned long index);
- (HTMLCollection or Element)? item(DOMString name);
- legacycaller getter (HTMLCollection or Element)? namedItem(DOMString name);
+ getter Element? (unsigned long index);
+ getter (HTMLCollection or Element)? namedItem(DOMString name);
+ legacycaller (HTMLCollection or Element)? item(optional DOMString nameOrIndex);
};
@@ -7169,13 +7167,14 @@ interface HTMLAllCollection {
item(index)item(name)item(name)item(name)item(name)namedItem(name)namedItem(name)HTMLCollection objects.id attributes of all the elements represented by the
+ collection, and the non-empty values of all the name attributes of
+ all the "all"-named elements represented by the collection, in
+ tree order, ignoring later duplicates, with the id of
+ an element preceding its name if it contributes both, they differ from each
+ other, and neither is the duplicate of an earlier entry.length
+ attribute must return the number of nodes represented by the collection.HTMLAllCollection given the passed index.namedItem(name)
+ method must return the result of getting the "all"-named
+ element(s) from this HTMLAllCollection given name.item(nameOrIndex)
+ method (and the legacycaller behavior) must run the following steps:
+
+
+ HTMLAllCollection given the number represented by nameOrIndex.HTMLAllCollection given
+ nameOrIndex.
+
a,
@@ -7219,53 +7255,37 @@ interface HTMLAllCollection {
textarea
id attributes of all the elements represented by the
- collection, and the non-empty values of all the name attributes of
- all the "all"-named elements represented by the collection, in
- tree order, ignoring later duplicates, with the id of
- an element preceding its name if it contributes both, they differ from each
- other, and neither is the duplicate of an earlier entry.length
- attribute must return the number of nodes represented by the collection.HTMLAllCollection collection given an index index, return the
+ indexth element in collection, or null if there is no such
+ indexth element.item(index) method
- must return the indexth element in the collection. If there is no
- indexth element in the collection,
- then the method must return null.item(name) and namedItem(name)
- methods must act according to the following algorithm:HTMLAllCollection collection given a name name, perform the
+ following steps:
-
-
@@ -117160,6 +117180,7 @@ INSERT INTERFACES HERE
Anthony Boyd,
Anthony Bryan,
Anthony Hickson,
+ Anthony Ramine,
Anthony Ricaud,
Antti Koivisto,
Arkadiusz Michalski,
HTMLCollection object rooted at the
- same Document as the HTMLAllCollection object on which the method was
- invoked, whose filter matches only elements that are either:HTMLCollection object rooted at the same
+ Document as collection, whose filter matches only elements that are
+ either:
+
-
name attribute equal to
+ name, or,name attribute equal to
- name, or,