Skip to content

Commit

Permalink
Add note about sorting name lists by code unit (Resolves #179)
Browse files Browse the repository at this point in the history
Uses suggested text c/o @aphillips
  • Loading branch information
inexorabletash authored Mar 24, 2017
1 parent f986b33 commit 7eccbd5
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 28 deletions.
24 changes: 17 additions & 7 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ spec: ecma262; urlPrefix: https://tc39.github.io/ecma262/
text: Promise; url: sec-promise-objects
text: Realm; url: realm
text: current Realm; url: current-realm
text: Array.prototype.sort; url: sec-array.prototype.sort
spec: webidl; urlPrefix: https://heycam.github.io/webidl/
type: dfn
text: sequence<DOMString>; url: idl-sequence
Expand Down Expand Up @@ -366,9 +367,6 @@ from the database. Ideally the user will never see this.
<h2 id=constructs>Constructs</h2>
<!-- ============================================================ -->

A <dfn>sorted list</dfn> is a list containing strings
sorted in ascending order by code unit.

A <dfn>name</dfn> is a string equivalent to a {{DOMString}};
that is, an arbitrary sequence of 16-bit code units of any length,
including the empty string. [=/Names=] are always compared as
Expand All @@ -386,6 +384,18 @@ opaque sequences of 16-bit code units.
can store.
</aside>

A <dfn>sorted name list</dfn> is a list containing [=/names=]
sorted in ascending order by 16-bit code unit.

<details class=note>
This matches the [=Array.prototype.sort=] on an [=Array=] of
[=Strings=]. This ordering compares the 16-bit code units in each
string, producing a highly efficient, consistent, and deterministic
sort order. The resulting list will not match any particular
alphabet or lexicographical order, particularly for code points
represented by a surrogate pair.
</details>


<!-- ============================================================ -->
<h3 id=database-construct>Database</h3>
Expand Down Expand Up @@ -2468,7 +2478,7 @@ must return this [=/connection=]'s
</div>

The <dfn attribute for=IDBDatabase>objectStoreNames</dfn> attribute's
getter must return a {{DOMStringList}} associated with a [=sorted list=] of the [=object-store/names=] of
getter must return a {{DOMStringList}} associated with a [=sorted name list=] of the [=object-store/names=] of
the [=/object stores=] in this [=/connection=]'s [=object store set=].

<details class=note>
Expand Down Expand Up @@ -2841,7 +2851,7 @@ object has no effect on the [=/object store=].


The <dfn attribute for=IDBObjectStore>indexNames</dfn> attribute's
getter must return a {{DOMStringList}} associated with a [=sorted list=] of the [=index/names=]
getter must return a {{DOMStringList}} associated with a [=sorted name list=] of the [=index/names=]
of [=/indexes=] in this [=/object store handle=]'s
[=index set=].

Expand Down Expand Up @@ -5055,12 +5065,12 @@ The <dfn attribute for=IDBTransaction>objectStoreNames</dfn>
attribute's getter must run the following steps:

1. If this [=/transaction=] is an [=upgrade transaction=],
return a {{DOMStringList}} associated with a [=sorted list=] of the [=object-store/names=]
return a {{DOMStringList}} associated with a [=sorted name list=] of the [=object-store/names=]
of the [=/object stores=] in this
[=/transaction=]'s [=/connection=]'s [=object store
set=].

2. Otherwise, return a {{DOMStringList}} associated with a [=sorted list=] of the
2. Otherwise, return a {{DOMStringList}} associated with a [=sorted name list=] of the
[=object-store/names=] of the [=/object stores=] in
this [=/transaction=]'s [=transaction/scope=].

Expand Down
Loading

0 comments on commit 7eccbd5

Please sign in to comment.