Skip to content

Commit

Permalink
Added definition for DOMStringList. See #28
Browse files Browse the repository at this point in the history
  • Loading branch information
inexorabletash committed Aug 5, 2016
1 parent f506ff1 commit fe20e00
Show file tree
Hide file tree
Showing 2 changed files with 146 additions and 16 deletions.
56 changes: 54 additions & 2 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1875,8 +1875,8 @@ the database is being deleted. See the [=steps for running an upgrade
transaction=].

Events are constructed as defined in <a
href="https://dom.spec.whatwg.org/#constructing-events">Constructing
events</a>, in [[!WHATWG-DOM]].
href="https://www.w3.org/TR/domcore/#constructing-events">Constructing
events</a>, in [[!DOM]].

To <dfn>fire a version change event</dfn> named |e| at |target| given
|oldVersion| and |newVersion|, dispatch an event at |target|. The
Expand Down Expand Up @@ -4150,6 +4150,54 @@ event handler for the <code>error</code> event.
the <code>success</code> event fires.
</aside>

<!-- ============================================================ -->
<h3 id=domstringlist>The {{DOMStringList}} interface</h3>
<!-- ============================================================ -->

The {{DOMStringList}} interface represents an immutable ordered
collection of zero or more {{DOMString}} values. The items in a
{{DOMStringList}} are accessible via an integral index, starting from
zero.

<aside class=note>
The {{DOMStringList}} interface was previously defined in
[[DOM-Level-3-core]] but has been removed from the current versions
of [[DOM]] and is now only referenced in this specification. It is
hoped that in the future all uses of this type can be replaced by
conceptually similar <code>FrozenArray&lt;DOMString&gt;</code> to
enable the use of other [=Array=] methods, but retaining support for
the {{DOMStringList/contains()}} method for compatibility with
deployed content.
</aside>

<pre class=idl>
interface DOMStringList {
readonly attribute unsigned long length;
getter DOMString (unsigned long index);
DOMString? item(unsigned long index);

boolean contains(DOMString str);
};
</pre>

The [=supported property indices=] for a {{DOMStringList}} |list|
are the numbers zero to the number of items in |list| minus one.
If |list| has no items, it has no [=supported property indices=].

To [=determine the value of an indexed property=] for a given index
|index| in a {{DOMStringList}} |list|, return the |index|<sup>th</sup>
item in |list|.

The <dfn attribute for=DOMStringList>length</dfn> attribute's
getter must return the number of items in the collection.

The <dfn method for=DOMStringList>item(|index|)</dfn> method must
return the |index|<sup>th</sup> item in the collection, or null
if there are less than |index| + 1 items in the collection.

The <dfn method for=DOMStringList>contains(|str|)</dfn> method must
return true if |str| is equal to any item in the collection, and false
otherwise.


<!-- ============================================================ -->
Expand Down Expand Up @@ -5898,6 +5946,10 @@ document's Revision History</a>.
<a href="https://github.com/w3c/IndexedDB/issues/77">bug #79</a>,
<a href="https://github.com/w3c/IndexedDB/issues/77">bug #81</a>)

* Added {{DOMStringList}}.
(<a href="https://github.com/w3c/IndexedDB/issues/28">bug #28</a>)


<!-- ============================================================ -->
<h2 id=acknowledgements>Acknowledgements</h2>
<!-- ============================================================ -->
Expand Down
Loading

0 comments on commit fe20e00

Please sign in to comment.