- From: Ian Hickson via cvs-syncmail <cvsmail@w3.org>
- Date: Wed, 02 Sep 2009 22:09:20 +0000
- To: public-html-commits@w3.org
Update of /sources/public/html5/webdatabase In directory hutz:/tmp/cvs-serv26577 Modified Files: Overview.html Log Message: Make changeVersion()'s callbacks optional. Make null callbacks just be no-ops. (whatwg r3730) Index: Overview.html =================================================================== RCS file: /sources/public/html5/webdatabase/Overview.html,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- Overview.html 31 Aug 2009 02:26:50 -0000 1.24 +++ Overview.html 2 Sep 2009 22:09:18 -0000 1.25 @@ -173,7 +173,7 @@ <h1>Web Database</h1> <!--ZZZ:--> <!--<h2 class="no-num no-toc">W3C Working Draft 23 April 2009</h2>--> - <h2 class="no-num no-toc" id="editor-s-draft-31-august-2009">Editor's Draft 31 August 2009</h2> + <h2 class="no-num no-toc" id="editor-s-draft-2-september-2009">Editor's Draft 2 September 2009</h2> <!--:ZZZ--> <dl><!-- ZZZ: update the month/day (twice), (un)comment out <dt>This Version:</dt> @@ -240,7 +240,7 @@ specification's progress along the W3C Recommendation track. <!--ZZZ:--> <!--This specification is the 23 April 2009 Working Draft.--> - This specification is the 31 August 2009 Editor's Draft. + This specification is the 2 September 2009 Editor's Draft. <!--:ZZZ--> </p><!-- required patent boilerplate --><p>This document was produced by a group operating under the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>. W3C maintains a <a href="http://www.w3.org/2004/01/pp-impl/42538/status" rel="disclosure">public list of @@ -596,7 +596,7 @@ void <a href="#dom-database-readtransaction" title="dom-database-readTransaction">readTransaction</a>(in <a href="#sqltransactioncallback">SQLTransactionCallback</a> callback, optional in <a href="#sqltransactionerrorcallback">SQLTransactionErrorCallback</a> errorCallback, optional in <a href="#sqlvoidcallback">SQLVoidCallback</a> successCallback); readonly attribute DOMString <a href="#dom-database-version" title="dom-database-version">version</a>; - void <a href="#dom-database-changeversion" title="dom-database-changeVersion">changeVersion</a>(in DOMString oldVersion, in DOMString newVersion, in <a href="#sqltransactioncallback">SQLTransactionCallback</a> callback, in <a href="#sqltransactionerrorcallback">SQLTransactionErrorCallback</a> errorCallback, in optional <a href="#sqlvoidcallback">SQLVoidCallback</a> successCallback); + void <a href="#dom-database-changeversion" title="dom-database-changeVersion">changeVersion</a>(in DOMString oldVersion, in DOMString newVersion, in optional <a href="#sqltransactioncallback">SQLTransactionCallback</a> callback, in optional <a href="#sqltransactionerrorcallback">SQLTransactionErrorCallback</a> errorCallback, in optional <a href="#sqlvoidcallback">SQLVoidCallback</a> successCallback); }; [Callback=FunctionOnly, NoInterfaceObject] @@ -645,7 +645,8 @@ the value of the second argument to the <code title="dom-database-changeVersion"><a href="#dom-database-changeversion">changeVersion()</a></code> method.</li> - </ol><p>...and the <i>mode</i> being read/write.<h4 id="executing-sql-statements"><span class="secno">4.3.1 </span>Executing SQL statements</h4><p>The <code title="dom-database-transaction"><a href="#dom-database-transaction">transaction()</a></code>, + </ol><p>...and the <i>mode</i> being read/write.<p>If any of the optional arguments are omitted, then they must be + treated as if they were null.<h4 id="executing-sql-statements"><span class="secno">4.3.1 </span>Executing SQL statements</h4><p>The <code title="dom-database-transaction"><a href="#dom-database-transaction">transaction()</a></code>, <code title="dom-database-readTransaction"><a href="#dom-database-readtransaction">readTransaction()</a></code>, and <code title="dom-database-changeVersion"><a href="#dom-database-changeversion">changeVersion()</a></code> methods invoke callbacks with <code><a href="#sqltransaction">SQLTransaction</a></code> @@ -715,19 +716,14 @@ to the last step. (This is basically a hook for the <code title="dom-database-changeVersion"><a href="#dom-database-changeversion">changeVersion()</a></code> method.)</li> - <li><p><span>Queue a task</span> to invoke the <i>transaction - callback</i> with the aforementioned <code><a href="#sqltransaction">SQLTransaction</a></code> - object as its only argument, and wait for that task to be - run.</li> + <li><p>If the <i>transaction callback</i> is not null, <span>queue + a task</span> to invoke the <i>transaction callback</i> with the + aforementioned <code><a href="#sqltransaction">SQLTransaction</a></code> object as its only + argument, and wait for that task to be run.</li> - <li><p>If the callback couldn't be called (e.g. it was null), or if - the callback was invoked and raised an exception, jump to the last + <li><p>If the callback raised an exception, jump to the last step.</li> -<!-- - <li><p>If the callback could be called and returned false, let - <i>callback-canceled</i> be true. Otherwise, let it be - false.</p></li> ---> + <li><p>While there are any statements queued up in the transaction, perform the following steps for each queued up statement in the transaction, oldest first. Each statement has a statement, @@ -746,11 +742,11 @@ <li><p>Create a <code><a href="#sqlresultset">SQLResultSet</a></code> object that represents the result of the statement.</li> - <li><p>If the statement has a result set callback, <span>queue a - task</span> to invoke it with the <code><a href="#sqltransaction">SQLTransaction</a></code> - object as its first argument and the new - <code><a href="#sqlresultset">SQLResultSet</a></code> object as its second argument, and wait - for that task to be run.</li> + <li><p>If the statement has a result set callback that is not + null, <span>queue a task</span> to invoke it with the + <code><a href="#sqltransaction">SQLTransaction</a></code> object as its first argument and the + new <code><a href="#sqlresultset">SQLResultSet</a></code> object as its second argument, and + wait for that task to be run.</li> <li><p>If the callback was invoked and raised an exception, jump to the last step in the overall steps.</li> @@ -762,11 +758,11 @@ say to jump to the "in case of error" steps), run the following substeps:</p> - <ol><li><p>If the statement had an associated error callback, then - <span>queue a task</span> to invoke that error callback with the - <code><a href="#sqltransaction">SQLTransaction</a></code> object and a newly constructed - <code><a href="#sqlerror">SQLError</a></code> object that represents the error that - caused these substeps to be run as the two arguments, + <ol><li><p>If the statement had an associated error callback that is + not null, then <span>queue a task</span> to invoke that error + callback with the <code><a href="#sqltransaction">SQLTransaction</a></code> object and a newly + constructed <code><a href="#sqlerror">SQLError</a></code> object that represents the + error that caused these substeps to be run as the two arguments, respectively, and wait for the task to be run.</li> <li><p>If the error callback returns false, then move on to the @@ -795,16 +791,16 @@ </li> <li><p><span>Queue a task</span> to invoke the <i>success - callback</i>.</li> + callback</i>, if it is not null.</li> <li><p>End these steps. The next step is only used when something goes wrong.</li> <li><p><span>Queue a task</span> to invoke the <i>error - callback</i> with a newly constructed <code><a href="#sqlerror">SQLError</a></code> object - that represents the last error to have occurred in this - transaction. Rollback the transaction. Any still-pending statements - in the transaction are discarded.</li> + callback</i>, if it is not null, with a newly constructed + <code><a href="#sqlerror">SQLError</a></code> object that represents the last error to have + occurred in this transaction. Rollback the transaction. Any + still-pending statements in the transaction are discarded.</li> </ol><p>The <span>task source</span> for these tasks is the <dfn id="database-access-task-source">database access task source</dfn>.<h3 id="synchronous-database-api"><span class="secno">4.4 </span>Synchronous database API</h3><pre class="idl">interface <dfn id="databasesync">DatabaseSync</dfn> { @@ -812,7 +808,7 @@ void <a href="#dom-database-sync-readtransaction" title="dom-database-sync-readTransaction">readTransaction</a>(in <a href="#sqltransactionsynccallback">SQLTransactionSyncCallback</a> callback); readonly attribute DOMString <a href="#dom-database-sync-version" title="dom-database-sync-version">version</a>; - void <a href="#dom-database-sync-changeversion" title="dom-database-sync-changeVersion">changeVersion</a>(in DOMString oldVersion, in DOMString newVersion, in <a href="#sqltransactionsynccallback">SQLTransactionSyncCallback</a> callback); + void <a href="#dom-database-sync-changeversion" title="dom-database-sync-changeVersion">changeVersion</a>(in DOMString oldVersion, in DOMString newVersion, optional in <a href="#sqltransactionsynccallback">SQLTransactionSyncCallback</a> callback); }; [Callback=FunctionOnly, NoInterfaceObject] @@ -866,14 +862,8 @@ these steps. (<a href="#dom-sqlerror-code-2" title="dom-sqlerror-code-2">Error code 2</a>.)</li> - <li><p>If the third argument is null, rollback the transaction, - throw a <code><a href="#sqlexception">SQLException</a></code> exception, and abort these steps. - (<a href="#dom-sqlerror-code-0" title="dom-sqlerror-code-0">Error code - 0</a>.)</li> - - <li><p>Invoke the callback given by the third argument, passing it - the <var title="">transaction</var> object as its only - argument.</li> + <li><p>If the third argument is not null, invoke the callback given + by the third argument, passing it the <var title="">transaction</var> object as its only argument.</li> <li><p>Mark the <code><a href="#sqltransactionsync">SQLTransactionSync</a></code> object as <i title="">stale</i>.</p> @@ -916,7 +906,8 @@ </ol><h4 id="executing-sql-statements-0"><span class="secno">4.4.1 </span>Executing SQL statements</h4><p>The <code title="dom-database-sync-transaction"><a href="#dom-database-sync-transaction">transaction()</a></code>, <code title="dom-database-sync-readTransaction"><a href="#dom-database-sync-readtransaction">readTransaction()</a></code>, and <code title="dom-database-sync-changeVersion"><a href="#dom-database-sync-changeversion">changeVersion()</a></code> - methods return <code><a href="#sqltransactionsync">SQLTransactionSync</a></code> objects.<pre class="idl">// typedef sequence<any> <a href="#objectarray">ObjectArray</a>; + methods invoke callbacks that are passed + <code><a href="#sqltransactionsync">SQLTransactionSync</a></code> objects.<pre class="idl">// typedef sequence<any> <a href="#objectarray">ObjectArray</a>; interface <dfn id="sqltransactionsync">SQLTransactionSync</dfn> { <a href="#sqlresultset">SQLResultSet</a> <a href="#dom-sqltransaction-sync-executesql" title="dom-sqltransaction-sync-executeSql">executeSql</a>(in DOMString sqlStatement, optional in <a href="#objectarray">ObjectArray</a> arguments);
Received on Wednesday, 2 September 2009 22:09:31 UTC