Skip to content

Commit f986b33

Browse files
Define a 'name' construct, reference Charmod-Norm (Resolves #177, Resolves #178)
1 parent 8e3a272 commit f986b33

File tree

2 files changed

+58
-40
lines changed

2 files changed

+58
-40
lines changed

index.bs

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,23 @@ from the database. Ideally the user will never see this.
369369
A <dfn>sorted list</dfn> is a list containing strings
370370
sorted in ascending order by code unit.
371371

372+
A <dfn>name</dfn> is a string equivalent to a {{DOMString}};
373+
that is, an arbitrary sequence of 16-bit code units of any length,
374+
including the empty string. [=/Names=] are always compared as
375+
opaque sequences of 16-bit code units.
376+
377+
<aside class=note>
378+
As a result, [=/name=] comparison is sensitive to variations in case
379+
as well as other minor variations such as normalization form, the
380+
inclusion or omission of controls, and other variations in Unicode
381+
text. [[Charmod-Norm]]
382+
383+
If an implementation uses a storage mechanism which does not support
384+
arbitrary strings, the implementation must use an escaping mechanism
385+
or something similar to map the provided name to a string that it
386+
can store.
387+
</aside>
388+
372389

373390
<!-- ============================================================ -->
374391
<h3 id=database-construct>Database</h3>
@@ -381,18 +398,8 @@ hold the data stored in the database.
381398
<div dfn-for=database>
382399

383400
A [=database=] has a <dfn>name</dfn> which identifies it within a
384-
specific [=/origin=]. The name can be any string value, including
385-
the empty string, and stays constant for the lifetime of the database.
386-
Database names are always compared in a case-sensitive manner, as
387-
opaque sequences of 16-bit code units. Implementations must support
388-
all names.
389-
390-
<aside class=note>
391-
If an implementation uses a storage mechanism which can't handle
392-
arbitrary database names, the implementation must use an escaping
393-
mechanism or something similar to map the provided name to a name
394-
that it can handle.
395-
</aside>
401+
specific [=/origin=]. The name is a [=/name=],
402+
and stays constant for the lifetime of the database.
396403

397404
A [=database=] has a <dfn>version</dfn>. When a database is first
398405
created, its [=database/version=] is 0 (zero).
@@ -500,11 +507,9 @@ data stored in the object store. Each <dfn>record</dfn> consists of a
500507
[=ascending=] order. There can never be multiple records in a given object
501508
store with the same key.
502509

503-
An [=/object store=] has a <dfn>name</dfn>. The name can be any string
504-
value, including the empty string. At any one time, the name is unique
505-
within the [=database=] to which it belongs. Object store names are
506-
always compared in a case-sensitive manner, as opaque sequences of
507-
16-bit code units.
510+
An [=/object store=] has a <dfn>name</dfn>, which is a [=/name=].
511+
At any one time, the name is unique
512+
within the [=database=] to which it belongs.
508513

509514
An [=/object store=] optionally has a <dfn>key path</dfn>. If the
510515
object store has a key path it is said to use <dfn>in-line keys</dfn>.
@@ -855,11 +860,9 @@ contain multiple records with the same key. Such records are
855860
additionally sorted according to the [=/index=]'s [=object-store/record=]'s value
856861
(meaning the key of the record in the referenced [=/object store=]).
857862

858-
An [=/index=] has a <dfn>name</dfn>. The name can be any
859-
string value, including the empty string. At any one time, the name is
863+
An [=/index=] has a <dfn>name</dfn>, which is a [=/name=].
864+
At any one time, the name is
860865
unique within index's [=referenced=] [=/object store=].
861-
Index names are always compared in a case-sensitive manner, as opaque
862-
sequences of 16-bit code units.
863866

864867
An [=/index=] has a <dfn>unique flag</dfn>. When this flag is
865868
set, the index enforces that no two [=object-store/records=] in the index has

index.html

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,20 +1852,27 @@ <h2 class="heading settled" data-level="1" id="introduction"><span class="secno"
18521852
<h2 class="heading settled" data-level="2" id="constructs"><span class="secno">2. </span><span class="content">Constructs</span><a class="self-link" href="#constructs"></a></h2>
18531853
<p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="sorted-list">sorted list</dfn> is a list containing strings
18541854
sorted in ascending order by code unit.</p>
1855+
<p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="name">name</dfn> is a string equivalent to a <code class="idl"><a data-link-type="idl" href="https://heycam.github.io/webidl/#idl-DOMString">DOMString</a></code>;
1856+
that is, an arbitrary sequence of 16-bit code units of any length,
1857+
including the empty string. <a data-link-type="dfn" href="#name" id="ref-for-name-1">Names</a> are always compared as
1858+
opaque sequences of 16-bit code units.</p>
1859+
<aside class="note">
1860+
As a result, <a data-link-type="dfn" href="#name" id="ref-for-name-2">name</a> comparison is sensitive to variations in case
1861+
as well as other minor variations such as normalization form, the
1862+
inclusion or omission of controls, and other variations in Unicode
1863+
text. <a data-link-type="biblio" href="#biblio-charmod-norm">[Charmod-Norm]</a>
1864+
<p>If an implementation uses a storage mechanism which does not support
1865+
arbitrary strings, the implementation must use an escaping mechanism
1866+
or something similar to map the provided name to a string that it
1867+
can store.</p>
1868+
</aside>
18551869
<h3 class="heading settled" data-level="2.1" id="database-construct"><span class="secno">2.1. </span><span class="content">Database</span><a class="self-link" href="#database-construct"></a></h3>
18561870
<p>Each <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin">origin</a> has an associated set of <a data-link-type="dfn" href="#database" id="ref-for-database-1">databases</a>. A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport="" id="database">database</dfn> has zero or more <a data-link-type="dfn" href="#object-store" id="ref-for-object-store-1">object stores</a> which
18571871
hold the data stored in the database.</p>
18581872
<div>
18591873
<p>A <a data-link-type="dfn" href="#database" id="ref-for-database-2">database</a> has a <dfn class="dfn-paneled" data-dfn-for="database" data-dfn-type="dfn" data-noexport="" id="database-name">name</dfn> which identifies it within a
1860-
specific <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin">origin</a>. The name can be any string value, including
1861-
the empty string, and stays constant for the lifetime of the database.
1862-
Database names are always compared in a case-sensitive manner, as
1863-
opaque sequences of 16-bit code units. Implementations must support
1864-
all names.</p>
1865-
<aside class="note"> If an implementation uses a storage mechanism which can’t handle
1866-
arbitrary database names, the implementation must use an escaping
1867-
mechanism or something similar to map the provided name to a name
1868-
that it can handle. </aside>
1874+
specific <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin">origin</a>. The name is a <a data-link-type="dfn" href="#name" id="ref-for-name-3">name</a>,
1875+
and stays constant for the lifetime of the database.</p>
18691876
<p>A <a data-link-type="dfn" href="#database" id="ref-for-database-3">database</a> has a <dfn class="dfn-paneled" data-dfn-for="database" data-dfn-type="dfn" data-noexport="" id="database-version">version</dfn>. When a database is first
18701877
created, its <a data-link-type="dfn" href="#database-version" id="ref-for-database-version-1">version</a> is 0 (zero).</p>
18711878
<aside class="note"> Each <a data-link-type="dfn" href="#database" id="ref-for-database-4">database</a> has one version at a time; a <a data-link-type="dfn" href="#database" id="ref-for-database-5">database</a> can’t
@@ -1927,11 +1934,9 @@ <h3 class="heading settled" data-level="2.2" id="object-store-construct"><span c
19271934
<p>An <a data-link-type="dfn" href="#object-store" id="ref-for-object-store-6">object store</a> has a <dfn class="dfn-paneled" data-dfn-for="object-store" data-dfn-type="dfn" data-noexport="" id="object-store-list-of-records">list of records</dfn> which hold the
19281935
data stored in the object store. Each <dfn class="dfn-paneled" data-dfn-for="object-store" data-dfn-type="dfn" data-noexport="" id="object-store-record">record</dfn> consists of a <a data-link-type="dfn" href="#key" id="ref-for-key-1">key</a> and a <a data-link-type="dfn" href="#value" id="ref-for-value-1">value</a>. The list is sorted according to key in <a data-link-type="dfn" href="#greater-than" id="ref-for-greater-than-1">ascending</a> order. There can never be multiple records in a given object
19291936
store with the same key.</p>
1930-
<p>An <a data-link-type="dfn" href="#object-store" id="ref-for-object-store-7">object store</a> has a <dfn class="dfn-paneled" data-dfn-for="object-store" data-dfn-type="dfn" data-noexport="" id="object-store-name">name</dfn>. The name can be any string
1931-
value, including the empty string. At any one time, the name is unique
1932-
within the <a data-link-type="dfn" href="#database" id="ref-for-database-16">database</a> to which it belongs. Object store names are
1933-
always compared in a case-sensitive manner, as opaque sequences of
1934-
16-bit code units.</p>
1937+
<p>An <a data-link-type="dfn" href="#object-store" id="ref-for-object-store-7">object store</a> has a <dfn class="dfn-paneled" data-dfn-for="object-store" data-dfn-type="dfn" data-noexport="" id="object-store-name">name</dfn>, which is a <a data-link-type="dfn" href="#name" id="ref-for-name-4">name</a>.
1938+
At any one time, the name is unique
1939+
within the <a data-link-type="dfn" href="#database" id="ref-for-database-16">database</a> to which it belongs.</p>
19351940
<p>An <a data-link-type="dfn" href="#object-store" id="ref-for-object-store-8">object store</a> optionally has a <dfn class="dfn-paneled" data-dfn-for="object-store" data-dfn-type="dfn" data-noexport="" id="object-store-key-path">key path</dfn>. If the
19361941
object store has a key path it is said to use <dfn class="dfn-paneled" data-dfn-for="object-store" data-dfn-type="dfn" data-noexport="" id="object-store-in-line-keys">in-line keys</dfn>.
19371942
Otherwise it is said to use <dfn class="dfn-paneled" data-dfn-for="object-store" data-dfn-type="dfn" data-noexport="" id="object-store-out-of-line-keys">out-of-line keys</dfn>.</p>
@@ -2226,11 +2231,9 @@ <h3 class="heading settled" data-level="2.6" id="index-construct"><span class="s
22262231
contain multiple records with the same key. Such records are
22272232
additionally sorted according to the <a data-link-type="dfn" href="#index-concept" id="ref-for-index-concept-3">index</a>'s <a data-link-type="dfn" href="#object-store-record" id="ref-for-object-store-record-10">record</a>'s value
22282233
(meaning the key of the record in the referenced <a data-link-type="dfn" href="#object-store" id="ref-for-object-store-18">object store</a>).</p>
2229-
<p>An <a data-link-type="dfn" href="#index-concept" id="ref-for-index-concept-4">index</a> has a <dfn class="dfn-paneled" data-dfn-for="index" data-dfn-type="dfn" data-noexport="" id="index-name">name</dfn>. The name can be any
2230-
string value, including the empty string. At any one time, the name is
2231-
unique within index’s <a data-link-type="dfn" href="#index-referenced" id="ref-for-index-referenced-5">referenced</a> <a data-link-type="dfn" href="#object-store" id="ref-for-object-store-19">object store</a>.
2232-
Index names are always compared in a case-sensitive manner, as opaque
2233-
sequences of 16-bit code units.</p>
2234+
<p>An <a data-link-type="dfn" href="#index-concept" id="ref-for-index-concept-4">index</a> has a <dfn class="dfn-paneled" data-dfn-for="index" data-dfn-type="dfn" data-noexport="" id="index-name">name</dfn>, which is a <a data-link-type="dfn" href="#name" id="ref-for-name-5">name</a>.
2235+
At any one time, the name is
2236+
unique within index’s <a data-link-type="dfn" href="#index-referenced" id="ref-for-index-referenced-5">referenced</a> <a data-link-type="dfn" href="#object-store" id="ref-for-object-store-19">object store</a>.</p>
22342237
<p>An <a data-link-type="dfn" href="#index-concept" id="ref-for-index-concept-5">index</a> has a <dfn class="dfn-paneled" data-dfn-for="index" data-dfn-type="dfn" data-noexport="" id="index-unique-flag">unique flag</dfn>. When this flag is
22352238
set, the index enforces that no two <a data-link-type="dfn" href="#object-store-record" id="ref-for-object-store-record-11">records</a> in the index has
22362239
the same key. If a <a data-link-type="dfn" href="#object-store-record" id="ref-for-object-store-record-12">record</a> in the index’s referenced object
@@ -6979,6 +6982,7 @@ <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="c
69796982
<li>
69806983
name
69816984
<ul>
6985+
<li><a href="#name">definition of</a><span>, in §2</span>
69826986
<li><a href="#database-name">dfn for database</a><span>, in §2.1</span>
69836987
<li><a href="#object-store-name">dfn for object-store</a><span>, in §2.2</span>
69846988
<li><a href="#object-store-handle-name">dfn for object-store-handle</a><span>, in §2.2.1</span>
@@ -7335,6 +7339,8 @@ <h3 class="no-num no-ref heading settled" id="normative"><span class="content">N
73357339
</dl>
73367340
<h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3>
73377341
<dl>
7342+
<dt id="biblio-charmod-norm">[Charmod-Norm]
7343+
<dd>Addison Phillips; et al. <a href="https://www.w3.org/TR/charmod-norm/">Character Model for the World Wide Web: String Matching and Searching</a>. URL: <a href="https://www.w3.org/TR/charmod-norm/">https://www.w3.org/TR/charmod-norm/</a>
73387344
<dt id="biblio-cookies">[COOKIES]
73397345
<dd>A. Barth. <a href="https://tools.ietf.org/html/rfc6265">HTTP State Management Mechanism</a>. April 2011. Proposed Standard. URL: <a href="https://tools.ietf.org/html/rfc6265">https://tools.ietf.org/html/rfc6265</a>
73407346
<dt id="biblio-webstorage">[WEBSTORAGE]
@@ -7554,6 +7560,15 @@ <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">I
75547560
<li><a href="#ref-for-sorted-list-3">4.9. The IDBTransaction interface</a> <a href="#ref-for-sorted-list-4">(2)</a>
75557561
</ul>
75567562
</aside>
7563+
<aside class="dfn-panel" data-for="name">
7564+
<b><a href="#name">#name</a></b><b>Referenced in:</b>
7565+
<ul>
7566+
<li><a href="#ref-for-name-1">2. Constructs</a> <a href="#ref-for-name-2">(2)</a>
7567+
<li><a href="#ref-for-name-3">2.1. Database</a>
7568+
<li><a href="#ref-for-name-4">2.2. Object Store</a>
7569+
<li><a href="#ref-for-name-5">2.6. Index</a>
7570+
</ul>
7571+
</aside>
75577572
<aside class="dfn-panel" data-for="database">
75587573
<b><a href="#database">#database</a></b><b>Referenced in:</b>
75597574
<ul>

0 commit comments

Comments
 (0)