- From: Eric Uhrhane via cvs-syncmail <cvsmail@w3.org>
- Date: Thu, 22 Sep 2011 00:04:48 +0000
- To: public-dap-commits@w3.org
Update of /sources/public/2009/dap/file-system In directory hutz:/tmp/cvs-serv6217/file-system Modified Files: file-writer.html Log Message: Adjust event sequences for truncate, write, and abort on the async API; they should match FileReader much better now. Index: file-writer.html =================================================================== RCS file: /sources/public/2009/dap/file-system/file-writer.html,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- file-writer.html 27 May 2011 18:20:30 -0000 1.31 +++ file-writer.html 22 Sep 2011 00:04:46 -0000 1.32 @@ -311,28 +311,18 @@ MUST run the steps below: <ol> <li>If <code>readyState</code> is <code>DONE</code> or - <code>INIT</code>, throw a <code>FileException</code> with error - code <code>INVALID_STATE_ERR</code> and terminate this overall - series of steps.</li> + <code>INIT</code>, terminate this overall series of steps without + doing anything else..</li> <li>Terminate any steps having to do with writing a file.</li> - <li>Queue a task that will: - <ol> - <li>Set the <code>error</code> attribute to a FileError object - with the code <a>ABORT_ERR</a>.</li> - <li>Set <code>readyState</code> to <code>DONE</code>.</li> - <li>Dispatch a progress event called error.</li> - <li>Dispatch a progress event called abort</li> - <li>Dispatch a progress event called writeend</li> - </ol></li> + <li>Set the <code>error</code> attribute to a FileError object + with the code <a>ABORT_ERR</a>.</li> + <li>Set <code>readyState</code> to <code>DONE</code>.</li> + <li>Dispatch a progress event called abort</li> + <li>Dispatch a progress event called writeend</li> <li>Stop dispatching any further progress events.</li> <li>Terminate this overall set of steps.</li> </ol> </p> - <dl class='exception' title='FileException'> - <dt>INVALID_STATE_ERR</dt> - <dd>A user called <code>abort</code> while <code>readyState</code> - was <code>DONE</code>.</dd> - </dl> </dd> <dt>const unsigned short INIT = 0</dt> <dd> @@ -587,45 +577,41 @@ <li>If an error occurs during file write, proceed to the error steps below. <ol> - <li>Queue a task that will: - <ol> - <li>Set the <code>error</code> attribute; on getting the - <code>error</code> attribute MUST be a - <code>FileError</code> object with a valid error code that - indicates the kind of file error that has occurred.</li> - <li>Set readyState to <code>DONE</code>.</li> - <li>Dispatch a progress event called - <code>error</code>.</li> - <li>Dispatch a progress event called - <code>writeend</code></li> - </ol></li> + <li>Set the <code>error</code> attribute; on getting the + <code>error</code> attribute MUST be a + <code>FileError</code> object with a valid error code that + indicates the kind of file error that has occurred.</li> + <li>Set readyState to <code>DONE</code>.</li> + <li>Dispatch a progress event called + <code>error</code>.</li> + <li>Dispatch a progress event called + <code>writeend</code></li> <li>On getting, the <code>length</code> and <code>position</code> attributes SHOULD indicate any fractional data successfully written to the file.</li> <li>Terminate this overall set of steps.</li> </ol> </li> - <li>Queue a task to dispatch a progress event called - <code>writestart</code>.</li> + <li>Dispatch a progress event called <code>writestart</code>.</li> + <li>Return from the write method, but continue processing the + other steps in this algorithm.</li> <li>Make progress notifications. On getting, while processing the <code>write</code> method, the <code>length</code> and <code>position</code> attributes SHOULD indicate the progress made in writing the file as of the last progress notification. </li> - <li>Upon successful completion: + <li>Upon successful completion of a write: <ol> - <li><code>position</code> and <code>length</code> MUST - indicate an increase of <code>data.size</code> over their - pre-write states, indicating the change to the underlying - file.</li> - <li>Queue a task that will: - <ol> - <li>Set readyState to <code>DONE</code>.</li> - <li>Dispatch a progress event called - <code>write</code></li> - <li>Dispatch a progress event called - <code>writeend</code></li> - </ol></li> + <li><code>position</code> MUST indicate an increase of + <code>data.size</code> over its pre-write state, and + <code>length</code> must be the greater of (the pre-write + <code>length</code>) and (the pre-write <code>position</code> + plus <code>data.size</code>). </li> + <li>Set readyState to <code>DONE</code>.</li> + <li>Dispatch a progress event called + <code>write</code></li> + <li>Dispatch a progress event called + <code>writeend</code></li> <li>Terminate this overall set of steps.</li> </ol> </ol> @@ -691,26 +677,24 @@ <li>If an error occurs during truncate, proceed to the error steps below. <ol> - <li>Queue a task that will: - <ol> - <li>Set the <code>error</code> attribute; on getting the - <code>error</code> attribute MUST be a - <code>FileError</code> object with a valid error code that - indicates the kind of file error that has occurred.</li> - <li>Set readyState to <code>DONE</code>.</li> - <li>Dispatch a progress event called - <code>error</code>.</li> - <li>Dispatch a progress event called - <code>writeend</code></li> - </ol></li> + <li>Set the <code>error</code> attribute; on getting the + <code>error</code> attribute MUST be a + <code>FileError</code> object with a valid error code that + indicates the kind of file error that has occurred.</li> + <li>Set readyState to <code>DONE</code>.</li> + <li>Dispatch a progress event called + <code>error</code>.</li> + <li>Dispatch a progress event called + <code>writeend</code></li> <li>On getting, the <code>length</code> and <code>position</code> attributes SHOULD indicate any modification to the file.</li> <li>Terminate this overall set of steps.</li> </ol> </li> - <li>Queue a task to dispatch a progress event called - <code>writestart</code>.</li> + <li>Dispatch a progress event called <code>writestart</code>.</li> + <li>Return from the truncate method, but continue processing the + other steps in this algorithm.</li> <li>Upon successful completion: <ul> <li><code>length</code> MUST be equal to <code>size</code>.</li> @@ -720,13 +704,10 @@ <li><code>size</code>.</li> </ul> </li> - <li>Queue a task that will: - <ol> - <li>Set readyState to <code>DONE</code>.</li> - <li>Dispatch a progress event called <code>write</code></li> - <li>Dispatch a progress event called - <code>writeend</code></li> - </ol></li> + <li>Set readyState to <code>DONE</code>.</li> + <li>Dispatch a progress event called <code>write</code></li> + <li>Dispatch a progress event called + <code>writeend</code></li> <li>Terminate this overall set of steps.</li> </ul> </li>
Received on Thursday, 22 September 2011 00:04:49 UTC