Clarify open w/o version, bug 18502. Move paragraph to fix subsequent note.
authorJoshua bell <jsbell@google.com>
Fri, 01 Mar 2013 11:47:21 -0800
changeset 4033662e5052bc0
parent 402 ee33a01d9d7f
child 404 8fa2c15e036c
Clarify open w/o version, bug 18502. Move paragraph to fix subsequent note.
Overview.html
Speclet_021_IDB_API_Algorithms.html
Speclet_022_IDB_API_Synchronous_APIs.html
Speclet_023_IDB_API_Asynchronous_APIs.html
     1.1 --- a/Overview.html	Fri Mar 01 11:16:20 2013 -0800
     1.2 +++ b/Overview.html	Fri Mar 01 11:47:21 2013 -0800
     1.3 @@ -1610,14 +1610,17 @@
     1.4                  Let <var>origin</var> be the origin of the <a>IDBEnvironment</a> used to access
     1.5                  this <a>IDBFactory</a>, <var>name</var> and <var>version</var> be the <var>name</var>
     1.6                  and <var>version</var> parameters passed to this function, and <var>request</var> be
     1.7 -                the newly created request.
     1.8 +                the newly created request. If the <var>version</var> parameter is not specified,
     1.9 +                let <var>version</var> be <code>undefined</code>.
    1.10                </p>
    1.11                <p>
    1.12 -              	If no version is specified and a database exists,
    1.13 -              	use the current database version and follow the <a>steps for opening a database</a>.
    1.14 -              	If no version is specified and no database exists,
    1.15 -              	set database version to 1, follow the <a>steps for opening a database</a>,
    1.16 -              	and return a database without <a title="object store">object stores</a>.
    1.17 +                If the value of <var>version</var> is <code>0</code> (zero) or a negative number, this method MUST throw a JavaScript <code>TypeError</code> exception.
    1.18 +              </p>
    1.19 +              <p class="note">
    1.20 +                If <var>version</var> is not specified and a <a>database</a> with that name already exists,
    1.21 +                a connection will be opened without changing the <a>version</a>. If <var>version</var>
    1.22 +                is not specified and no <a>database</a> with that name exists, a new <a>database</a>
    1.23 +                will be created with <a>version</a> equal to <code>1</code>.
    1.24                </p>
    1.25                <p>
    1.26                  If an error is returned from the steps above, the implementation MUST set the
    1.27 @@ -1636,9 +1639,6 @@
    1.28                  path</a> of the event is just the request. If the steps above resulted in a <code>"versionchange"</code> transaction being
    1.29                  run, then firing the <code>"success"</code> event MUST be done after the <code>“versionchange”</code> <a>transaction</a> completes.
    1.30                </p>
    1.31 -              <p>
    1.32 -              	If the value of <code>version</code> is <code>0</code> (zero) or a negative number, this method MUST throw a JavaScript <code>TypeError</code> exception.
    1.33 -              </p>
    1.34                <p class="note">
    1.35                  The last requirement is to ensure that in case another version upgrade is about to happen,
    1.36                  the success event is fired on the connection first so that the page gets a chance to register
    1.37 @@ -2882,13 +2882,17 @@
    1.38                  synchronously runs the <a>steps for opening a database</a>. Let <var>origin</var> be the origin of the
    1.39                  <a>IDBEnvironmentSync</a> used to access this <a>IDBFactorySync</a>, <var>name</var>, <var>version</var>
    1.40                  and <var>upgrade callback</var> be the <var>name</var>, <var>version</var> and <var>upgradeCallback</var>
    1.41 -                arguments passed to this function.
    1.42 +                arguments passed to this function. If the <var>version</var> parameter is not specified,
    1.43 +                let <var>version</var> be <code>undefined</code>.
    1.44                </p>
    1.45                <p>
    1.46 -              	If no version is specified and a database exists,
    1.47 -              	use the current database version and follow the <a>steps for opening a database</a>.
    1.48 -              	If no version is specified and no database exists, set database version to 1,
    1.49 -              	follow the <a>steps for opening a database</a>, and return a <a>database</a> without <a title="object store">object stores</a>.
    1.50 +                If the value of <var>version</var> is <code>0</code> (zero) or a negative number, this method MUST throw a JavaScript <code>TypeError</code> exception.
    1.51 +              </p>
    1.52 +              <p class="note">
    1.53 +                If <var>version</var> is not specified and a <a>database</a> with that name already exists,
    1.54 +                a connection will be opened without changing the <a>version</a>. If <var>version</var>
    1.55 +                is not specified and no <a>database</a> with that name exists, a new <a>database</a>
    1.56 +                will be created with <a>version</a> equal to <code>1</code>.
    1.57                </p>
    1.58                <p>
    1.59                  If a <var>timeout</var> parameter was supplied, then this limits the total waiting time allowed in
    1.60 @@ -2907,9 +2911,6 @@
    1.61                  If the steps above are successful, the implementation MUST create an <a>IDBDatabaseSync</a>
    1.62                  object representing the created <a>connection</a> and return it.
    1.63                </p>
    1.64 -              <p>
    1.65 -              	If the value of <code>version</code> is <code>0</code> (zero) or a negative number, this method MUST throw a JavaScript <code>TypeError</code> exception.
    1.66 -              </p>
    1.67                <p class="note">
    1.68                  Processing a <code>open</code> call may take a long time as it could require running a
    1.69                  <code>"versionchange"</code> transaction which requires all other connections to the database to be closed, which
    1.70 @@ -4341,6 +4342,10 @@
    1.71                be the new database.
    1.72              </li>
    1.73              <li>
    1.74 +                If <var>version</var> is <code>undefined</code>, then let <var>version</var> be <code>1</code>
    1.75 +                if <var>db</var> was created in the previous step, or the current <a>version</a> of <var>db</var> otherwise.
    1.76 +            </li>
    1.77 +            <li>
    1.78                If the <a>version</a> of <var>db</var> is higher than <var>version</var>, abort these steps and return
    1.79                a <code>DOMError</code> of type <a>VersionError</a>.
    1.80              </li>
     2.1 --- a/Speclet_021_IDB_API_Algorithms.html	Fri Mar 01 11:16:20 2013 -0800
     2.2 +++ b/Speclet_021_IDB_API_Algorithms.html	Fri Mar 01 11:47:21 2013 -0800
     2.3 @@ -182,6 +182,10 @@
     2.4                be the new database.
     2.5              </li>
     2.6              <li>
     2.7 +                If <var>version</var> is <code>undefined</code>, then let <var>version</var> be <code>1</code>
     2.8 +                if <var>db</var> was created in the previous step, or the current <a>version</a> of <var>db</var> otherwise.
     2.9 +            </li>
    2.10 +            <li>
    2.11                If the <a>version</a> of <var>db</var> is higher than <var>version</var>, abort these steps and return
    2.12                a <code>DOMError</code> of type <a>VersionError</a>.
    2.13              </li>
     3.1 --- a/Speclet_022_IDB_API_Synchronous_APIs.html	Fri Mar 01 11:16:20 2013 -0800
     3.2 +++ b/Speclet_022_IDB_API_Synchronous_APIs.html	Fri Mar 01 11:47:21 2013 -0800
     3.3 @@ -130,13 +130,17 @@
     3.4                  synchronously runs the <a>steps for opening a database</a>. Let <var>origin</var> be the origin of the
     3.5                  <a>IDBEnvironmentSync</a> used to access this <a>IDBFactorySync</a>, <var>name</var>, <var>version</var>
     3.6                  and <var>upgrade callback</var> be the <var>name</var>, <var>version</var> and <var>upgradeCallback</var>
     3.7 -                arguments passed to this function.
     3.8 +                arguments passed to this function. If the <var>version</var> parameter is not specified,
     3.9 +                let <var>version</var> be <code>undefined</code>.
    3.10                </p>
    3.11                <p>
    3.12 -              	If no version is specified and a database exists,
    3.13 -              	use the current database version and follow the <a>steps for opening a database</a>.
    3.14 -              	If no version is specified and no database exists, set database version to 1,
    3.15 -              	follow the <a>steps for opening a database</a>, and return a <a>database</a> without <a title="object store">object stores</a>.
    3.16 +                If the value of <var>version</var> is <code>0</code> (zero) or a negative number, this method MUST throw a JavaScript <code>TypeError</code> exception.
    3.17 +              </p>
    3.18 +              <p class="note">
    3.19 +                If <var>version</var> is not specified and a <a>database</a> with that name already exists,
    3.20 +                a connection will be opened without changing the <a>version</a>. If <var>version</var>
    3.21 +                is not specified and no <a>database</a> with that name exists, a new <a>database</a>
    3.22 +                will be created with <a>version</a> equal to <code>1</code>.
    3.23                </p>
    3.24                <p>
    3.25                  If a <var>timeout</var> parameter was supplied, then this limits the total waiting time allowed in
    3.26 @@ -155,9 +159,6 @@
    3.27                  If the steps above are successful, the implementation MUST create an <a>IDBDatabaseSync</a>
    3.28                  object representing the created <a>connection</a> and return it.
    3.29                </p>
    3.30 -              <p>
    3.31 -              	If the value of <code>version</code> is <code>0</code> (zero) or a negative number, this method MUST throw a JavaScript <code>TypeError</code> exception.
    3.32 -              </p>
    3.33                <p class="note">
    3.34                  Processing a <code>open</code> call may take a long time as it could require running a
    3.35                  <code>"versionchange"</code> transaction which requires all other connections to the database to be closed, which
     4.1 --- a/Speclet_023_IDB_API_Asynchronous_APIs.html	Fri Mar 01 11:16:20 2013 -0800
     4.2 +++ b/Speclet_023_IDB_API_Asynchronous_APIs.html	Fri Mar 01 11:47:21 2013 -0800
     4.3 @@ -258,14 +258,17 @@
     4.4                  Let <var>origin</var> be the origin of the <a>IDBEnvironment</a> used to access
     4.5                  this <a>IDBFactory</a>, <var>name</var> and <var>version</var> be the <var>name</var>
     4.6                  and <var>version</var> parameters passed to this function, and <var>request</var> be
     4.7 -                the newly created request.
     4.8 +                the newly created request. If the <var>version</var> parameter is not specified,
     4.9 +                let <var>version</var> be <code>undefined</code>.
    4.10                </p>
    4.11                <p>
    4.12 -              	If no version is specified and a database exists,
    4.13 -              	use the current database version and follow the <a>steps for opening a database</a>.
    4.14 -              	If no version is specified and no database exists,
    4.15 -              	set database version to 1, follow the <a>steps for opening a database</a>,
    4.16 -              	and return a database without <a title="object store">object stores</a>.
    4.17 +                If the value of <var>version</var> is <code>0</code> (zero) or a negative number, this method MUST throw a JavaScript <code>TypeError</code> exception.
    4.18 +              </p>
    4.19 +              <p class="note">
    4.20 +                If <var>version</var> is not specified and a <a>database</a> with that name already exists,
    4.21 +                a connection will be opened without changing the <a>version</a>. If <var>version</var>
    4.22 +                is not specified and no <a>database</a> with that name exists, a new <a>database</a>
    4.23 +                will be created with <a>version</a> equal to <code>1</code>.
    4.24                </p>
    4.25                <p>
    4.26                  If an error is returned from the steps above, the implementation MUST set the
    4.27 @@ -284,9 +287,6 @@
    4.28                  path</a> of the event is just the request. If the steps above resulted in a <code>"versionchange"</code> transaction being
    4.29                  run, then firing the <code>"success"</code> event MUST be done after the <code>“versionchange”</code> <a>transaction</a> completes.
    4.30                </p>
    4.31 -              <p>
    4.32 -              	If the value of <code>version</code> is <code>0</code> (zero) or a negative number, this method MUST throw a JavaScript <code>TypeError</code> exception.
    4.33 -              </p>
    4.34                <p class="note">
    4.35                  The last requirement is to ensure that in case another version upgrade is about to happen,
    4.36                  the success event is fired on the connection first so that the page gets a chance to register