--- a/Overview.htm Tue Nov 29 13:07:10 2011 -0800
+++ b/Overview.htm Fri Oct 26 08:33:25 2012 -0700
@@ -3,6 +3,15 @@
<title>Streams API</title>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
+<!-- <script class=remove src="http://dev.w3.org/2009/dap/ReSpec.js/js/respec.js"></script> -->
+
+
+
+
+
+
+ <meta name="GENERATOR" content="MSHTML 8.00.7600.16588">
+
<!-- Styles to mimic File API spec -->
<style type="text/css">
table.error { border-collapse:collapse; border-style:hidden hidden none hidden }
@@ -11,207 +20,502 @@
table.error td, table th { border-left:solid; border-right:solid; border-bottom:solid thin; vertical-align:top; padding:0.2em }
</style>
- <link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-ED.css"/>
- <link rel="stylesheet" type="text/css" href="http://dev.w3.org/2009/dap/ReSpec.js/css/respec.css"/>
-</head>
+<style>/*****************************************************************
+ * ReSpec 3 CSS
+ * Robin Berjon - http://berjon.com/
+ *****************************************************************/
-<body style="display: inherit;">
- <div class="head">
- <p><a href="http://www.w3.org/"><img height="48" width="72" alt="W3C" src="http://www.w3.org/Icons/w3c_home"/></a></p>
-
- <h1 class="title" id="title">Streams API</h1>
- <h2 id="w3c-editor-s-draft-28-november-2011"><acronym title="World Wide Web Consortium">W3C</acronym> Editor's Draft 28 November 2011</h2>
- <dl>
- <dt>This version:</dt>
- <dd><a href="http://dvcs.w3.org/hg/streams-api/raw-file/tip/Overview.htm">http://dvcs.w3.org/hg/streams-api/raw-file/tip/Overview.htm</a></dd>
-
- <dt>Latest published version:</dt>
- <dd><a href="http://dvcs.w3.org/hg/streams-api/raw-file/tip/Overview.htm">http://dvcs.w3.org/hg/streams-api/raw-file/tip/Overview.htm</a></dd>
-
- <dt>Latest editor's draft:</dt>
- <dd><a href="http://dvcs.w3.org/hg/streams-api/raw-file/tip/Overview.htm">http://dvcs.w3.org/hg/streams-api/raw-file/tip/Overview.htm</a></dd>
-
- <dt>Previous version:</dt>
- <dd>none</dd>
-
- <dt>Editor:</dt>
- <dd><a href="mailto:ferasm@microsoft.com">Feras Moussa</a>, Microsoft Corporation</dd>
- </dl>
- <p class="copyright">
- <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2011
- <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>®</sup>
- (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>,
- <a href="http://www.ercim.eu/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>,
- <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. <acronym title="World Wide Web Consortium">W3C</acronym>
- <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
- <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and
- <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
- </p>
-
- <hr>
- </div>
+/* --- INLINES --- */
+em.rfc2119 {
+ text-transform: lowercase;
+ font-variant: small-caps;
+ font-style: normal;
+ color: #900;
+}
- <div class="introductory section" id="abstract">
- <h2>Abstract</h2>
+h1 acronym, h2 acronym, h3 acronym, h4 acronym, h5 acronym, h6 acronym, a acronym,
+h1 abbr, h2 abbr, h3 abbr, h4 abbr, h5 abbr, h6 abbr, a abbr {
+ border: none;
+}
+
+dfn {
+ font-weight: bold;
+}
+
+a.internalDFN {
+ color: inherit;
+ border-bottom: 1px solid #99c;
+ text-decoration: none;
+}
+
+a.externalDFN {
+ color: inherit;
+ border-bottom: 1px dotted #ccc;
+ text-decoration: none;
+}
+
+a.bibref {
+ text-decoration: none;
+}
+
+cite .bibref {
+ font-style: normal;
+}
+
+code {
+ color: #ff4500;
+}
+
+
+/* --- --- */
+ol.algorithm { counter-reset:numsection; list-style-type: none; }
+ol.algorithm li { margin: 0.5em 0; }
+ol.algorithm li:before { font-weight: bold; counter-increment: numsection; content: counters(numsection, ".") ") "; }
+
+/* --- TOC --- */
+.toc a, .tof a {
+ text-decoration: none;
+}
+
+a .secno, a .figno {
+ color: #000;
+}
+
+ul.tof, ol.tof {
+ list-style: none outside none;
+}
+
+.caption {
+ margin-top: 0.5em;
+ font-style: italic;
+}
+
+/* --- TABLE --- */
+table.simple {
+ border-spacing: 0;
+ border-collapse: collapse;
+ border-bottom: 3px solid #005a9c;
+}
+
+.simple th {
+ background: #005a9c;
+ color: #fff;
+ padding: 3px 5px;
+ text-align: left;
+}
+
+.simple th[scope="row"] {
+ background: inherit;
+ color: inherit;
+ border-top: 1px solid #ddd;
+}
+
+.simple td {
+ padding: 3px 10px;
+ border-top: 1px solid #ddd;
+}
+
+.simple tr:nth-child(even) {
+ background: #f0f6ff;
+}
+
+/* --- DL --- */
+.section dd > p:first-child {
+ margin-top: 0;
+}
+
+.section dd > p:last-child {
+ margin-bottom: 0;
+}
+
+.section dd {
+ margin-bottom: 1em;
+}
+
+.section dl.attrs dd, .section dl.eldef dd {
+ margin-bottom: 0;
+}
+</style><style>/* --- EXAMPLES --- */
+div.example-title {
+ min-width: 7.5em;
+ color: #b9ab2d;
+}
+div.example-title span {
+ text-transform: uppercase;
+}
+aside.example, div.example, div.illegal-example {
+ padding: 0.5em;
+ margin: 1em 0;
+ position: relative;
+ clear: both;
+}
+div.illegal-example { color: red }
+div.illegal-example p { color: black }
+aside.example, div.example {
+ padding: .5em;
+ border-left-width: .5em;
+ border-left-style: solid;
+ border-color: #e0cb52;
+ background: #fcfaee;
+}
+
+aside.example div.example {
+ border-left-width: .1em;
+ border-color: #999;
+ background: #fff;
+}
+aside.example div.example div.example-title {
+ color: #999;
+}
+</style><style>/* --- WEB IDL --- */
+pre.idl {
+ border-top: 1px solid #90b8de;
+ border-bottom: 1px solid #90b8de;
+ padding: 1em;
+ line-height: 120%;
+}
+
+pre.idl::before {
+ content: "WebIDL";
+ display: block;
+ width: 150px;
+ background: #90b8de;
+ color: #fff;
+ font-family: initial;
+ padding: 3px;
+ font-weight: bold;
+ margin: -1em 0 1em -1em;
+}
+
+.idlType {
+ color: #ff4500;
+ font-weight: bold;
+ text-decoration: none;
+}
+
+/*.idlModule*/
+/*.idlModuleID*/
+/*.idlInterface*/
+.idlInterfaceID, .idlDictionaryID, .idlCallbackID, .idlEnumID {
+ font-weight: bold;
+ color: #005a9c;
+}
+
+.idlSuperclass {
+ font-style: italic;
+ color: #005a9c;
+}
+
+/*.idlAttribute*/
+.idlAttrType, .idlFieldType, .idlMemberType {
+ color: #005a9c;
+}
+.idlAttrName, .idlFieldName, .idlMemberName {
+ color: #ff4500;
+}
+.idlAttrName a, .idlFieldName a, .idlMemberName a {
+ color: #ff4500;
+ border-bottom: 1px dotted #ff4500;
+ text-decoration: none;
+}
+
+/*.idlMethod*/
+.idlMethType, .idlCallbackType {
+ color: #005a9c;
+}
+.idlMethName {
+ color: #ff4500;
+}
+.idlMethName a {
+ color: #ff4500;
+ border-bottom: 1px dotted #ff4500;
+ text-decoration: none;
+}
+
+/*.idlParam*/
+.idlParamType {
+ color: #005a9c;
+}
+.idlParamName {
+ font-style: italic;
+}
+
+.extAttr {
+ color: #666;
+}
+
+/*.idlConst*/
+.idlConstType {
+ color: #005a9c;
+}
+.idlConstName {
+ color: #ff4500;
+}
+.idlConstName a {
+ color: #ff4500;
+ border-bottom: 1px dotted #ff4500;
+ text-decoration: none;
+}
+
+/*.idlException*/
+.idlExceptionID {
+ font-weight: bold;
+ color: #c00;
+}
+
+.idlTypedefID, .idlTypedefType {
+ color: #005a9c;
+}
+
+.idlRaises, .idlRaises a.idlType, .idlRaises a.idlType code, .excName a, .excName a code {
+ color: #c00;
+ font-weight: normal;
+}
+
+.excName a {
+ font-family: monospace;
+}
+
+.idlRaises a.idlType, .excName a.idlType {
+ border-bottom: 1px dotted #c00;
+}
+
+.excGetSetTrue, .excGetSetFalse, .prmNullTrue, .prmNullFalse, .prmOptTrue, .prmOptFalse {
+ width: 45px;
+ text-align: center;
+}
+.excGetSetTrue, .prmNullTrue, .prmOptTrue { color: #0c0; }
+.excGetSetFalse, .prmNullFalse, .prmOptFalse { color: #c00; }
+
+.idlImplements a {
+ font-weight: bold;
+}
+
+dl.attributes, dl.methods, dl.constants, dl.fields, dl.dictionary-members {
+ margin-left: 2em;
+}
+
+.attributes dt, .methods dt, .constants dt, .fields dt, .dictionary-members dt {
+ font-weight: normal;
+}
+
+.attributes dt code, .methods dt code, .constants dt code, .fields dt code, .dictionary-members dt code {
+ font-weight: bold;
+ color: #000;
+ font-family: monospace;
+}
+
+.attributes dt code, .fields dt code, .dictionary-members dt code {
+ background: #ffffd2;
+}
+
+.attributes dt .idlAttrType code, .fields dt .idlFieldType code, .dictionary-members dt .idlMemberType code {
+ color: #005a9c;
+ background: transparent;
+ font-family: inherit;
+ font-weight: normal;
+ font-style: italic;
+}
+
+.methods dt code {
+ background: #d9e6f8;
+}
+
+.constants dt code {
+ background: #ddffd2;
+}
+
+.attributes dd, .methods dd, .constants dd, .fields dd, .dictionary-members dd {
+ margin-bottom: 1em;
+}
+
+table.parameters, table.exceptions {
+ border-spacing: 0;
+ border-collapse: collapse;
+ margin: 0.5em 0;
+ width: 100%;
+}
+table.parameters { border-bottom: 1px solid #90b8de; }
+table.exceptions { border-bottom: 1px solid #deb890; }
+
+.parameters th, .exceptions th {
+ color: #fff;
+ padding: 3px 5px;
+ text-align: left;
+ font-family: initial;
+ font-weight: normal;
+ text-shadow: #666 1px 1px 0;
+}
+.parameters th { background: #90b8de; }
+.exceptions th { background: #deb890; }
+
+.parameters td, .exceptions td {
+ padding: 3px 10px;
+ border-top: 1px solid #ddd;
+ vertical-align: top;
+}
+
+.parameters tr:first-child td, .exceptions tr:first-child td {
+ border-top: none;
+}
+
+.parameters td.prmName, .exceptions td.excName, .exceptions td.excCodeName {
+ width: 100px;
+}
+
+.parameters td.prmType {
+ width: 120px;
+}
+
+table.exceptions table {
+ border-spacing: 0;
+ border-collapse: collapse;
+ width: 100%;
+}
+</style><link href="Overview_files/W3C-ED.css" rel="stylesheet"></head>
+
+<body><div class="head">
+ <p>
+
+ <a href="http://www.w3.org/"><img src="Overview_files/w3c_home.png" alt="W3C" height="48" width="72"></a>
+
+ </p>
+ <h1 class="title" id="title">Streams API</h1>
+
+ <h2 id="w3c-editor-s-draft-25-october-2012"><abbr title="World Wide Web Consortium">W3C</abbr> Editor's Draft 25 October 2012</h2>
+ <dl>
+
+ <dt>This version:</dt>
+ <dd><a href="http://dvcs.w3.org/hg/streams-api/Overview.html">http://dvcs.w3.org/hg/streams-api/Overview.html</a></dd>
+ <dt>Latest published version:</dt>
+ <dd><a href="http://www.w3.org/TR/streams-api/">http://www.w3.org/TR/streams-api/</a></dd>
+
+
+ <dt>Latest editor's draft:</dt>
+ <dd><a href="http://dvcs.w3.org/hg/streams-api/Overview.html">http://dvcs.w3.org/hg/streams-api/Overview.html</a></dd>
+
+
+
+
+
+
+
+
+ <dt>Editor:</dt>
+ <dd><a href="mailto:ferasm@microsoft.com">Feras Moussa</a>, Microsoft Corporation</dd>
+
+
+ </dl>
+
+
+
+
+
+ <p class="copyright">
+ <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> ©
+ 2012
+
+ <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup>
+ (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>,
+ <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
+ <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved.
+ <abbr title="World Wide Web Consortium">W3C</abbr> <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
+ <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and
+ <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
+ </p>
+
+
+ <hr>
+</div>
+
+<section class="introductory" id="abstract"><h2>Abstract</h2>
<!-- TODO: are all of the links and objects in the abstract formatted? -->
<p>
This specification provides an API for representing binary data in web applications as a <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> object,
as well as programmatically building and reading its contents. This includes:
</p>
<ul>
- <li>
- A <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> interface, which represents a sequence of data that can be read over time.
- </li>
- <li>
- A <a class="idlType" href="#idl-def-StreamReader"><code>StreamReader</code></a> interface, which provides methods to read the contents of a
- <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> as a <code>Blob</code>, <code>DataURL</code>, <code>ArrayBuffer</code>, or as <code>Text</code>.
- </li>
- <li>
- A <a class="idlType" href="#idl-def-StreamBuilder"><code>StreamBuilder</code></a> interface, which allows for creating a new
- <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> whose contents is read from an internal buffer that was made by appending
- <code>Text</code>, <code>Blobs</code>, or <code>ArrayBuffers</code>.
- </li>
- <li>
- Extensions to <a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-xmlhttprequest-interface">XmlHttpRequest</a>
- [<cite><a href="#bib-XMLHTTPREQUEST2" rel="biblioentry" class="bibref">XMLHTTPREQUEST2</a></cite>] to add support for upload and download of a
- <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>.
- </li>
+ <li>A <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> interface, which represents a sequence of data that can be read over time.</li>
+ <li>A <a class="idlType" href="#idl-def-StreamReader"><code>StreamReader</code></a> interface, which provides methods to read the contents of a <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> as a
+ <code>Blob</code>, <code>DataURL</code>, <code>ArrayBuffer</code>, or as <code>Text</code>.</li>
+ <li>A <a class="idlType" href="#idl-def-StreamBuilder"><code>StreamBuilder</code></a> interface, which allows for creating a new <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> whose contents is read from an internal buffer that was made by appending <code>Text</code>, <code>Blobs</code>, or <code>ArrayBuffers</code>.</li>
+ <li>Extensions to <a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-xmlhttprequest-interface">XmlHttpRequest</a> [<cite><a href="#bib-XMLHTTPREQUEST2" class="bibref">XMLHTTPREQUEST2</a></cite>] to add support for upload and download of a <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>.</li>
<li>
Extensions to <a href="http://dev.w3.org/2006/webapi/FileAPI/#FileErrorInterface">FileError</a> and
- <a href="http://dev.w3.org/2006/webapi/FileAPI/#FileException">FileException</a> to encompass <a href="#streamerror-error">Stream Errors</a>.
- </li>
+ <a href="http://dev.w3.org/2006/webapi/FileAPI/#FileException">FileException</a> to encompass <a href="#streamerror-error">Stream Errors</a>.</li>
<li>
Extensions to <a href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-createObjectURL">createObjectURL</a> and
- <a href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-revokeObjectURL">revokeObjectURL</a> to add support for <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>.
- </li>
+ <a href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-revokeObjectURL">revokeObjectURL</a> to add support for <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>.</li>
</ul>
<p>
- Additionally, this specification defines objects to be used within threaded web applications for the synchronous reading of a
- <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>.
+ Additionally, this specification defines objects to be used within
+threaded web applications for the synchronous reading of a <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>.
</p>
<p>
This API is designed to be used in conjunction with other APIs and elements on the web platform, notably:
- <a href="http://dev.w3.org/2006/webapi/FileAPI">File</a> [<cite><a href="#bib-FILE-API" rel="biblioentry" class="bibref">FILE-API</a></cite>],
+ <a href="http://dev.w3.org/2006/webapi/FileAPI">File</a> [<cite><a href="#bib-FILE-API" class="bibref">FILE-API</a></cite>],
<a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2">XMLHttpRequest</a>
(e.g. with an overloaded <a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-send-method"><code>send()</code></a> method
- and <a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-responsetype-attribute"><code>response</code></a> object for
- <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> objects) [<cite><a href="#bib-XMLHTTPREQUEST2" rel="biblioentry" class="bibref">XMLHTTPREQUEST2</a></cite>],
+ and <a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-responsetype-attribute"><code>response</code></a> object for <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> objects) [<cite><a href="#bib-XMLHTTPREQUEST2" class="bibref">XMLHTTPREQUEST2</a></cite>],
<a href="http://dev.w3.org/html5/postmsg/#dom-window-postmessage"><code>postMessage</code></a>, and
- Web Workers [<cite><a href="#bib-WEBWORKERS" rel="biblioentry" class="bibref">WEBWORKERS</a></cite>].
- </p>
- <!--End section: Abstract-->
- </div>
-
- <div id="sotd" class="introductory section">
- <h2>Status of This Document</h2>
- <p>
- <em>This section describes the status of this document at the time of its publication.
- Other documents may supersede this document.
- A list of current <acronym title="World Wide Web Consortium">W3C</acronym> publications and the latest revision of this technical report can be found in the
- <a href="http://www.w3.org/TR/"><acronym title="World Wide Web Consortium">W3C</acronym> technical reports index</a> at http://www.w3.org/TR/.</em>
- </p>
- <p>
- This document was published by the <a href="http://www.w3.org/2008/webapps/"><acronym title="World Wide Web Consortium">W3C</acronym>
- Web Applications (WebApps)</a> as an Editor's Draft.
- If you wish to make comments regarding this document, please send them to <a href="mailto:public-webapps@w3.org">public-webapps@w3.org</a>
- (<a href="mailto:public-webapps-request@w3.org?subject=subscribe">subscribe</a>,
- <a href="http://lists.w3.org/Archives/Public/public-webapps/">archives</a>).
- All feedback is welcome.
- </p>
- <p>
- Publication as a Editor's Draft does not imply endorsement by the <acronym title="World Wide Web Consortium">W3C</acronym> Membership.
- This is a draft document and may be updated, replaced or obsoleted by other documents at any time.
- It is inappropriate to cite this document as other than work in progress.
- </p>
- <p>
- This document was produced by a group operating under the
- <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004
- <acronym title="World Wide Web Consortium">W3C</acronym> Patent Policy</a>.
- <acronym title="World Wide Web Consortium">W3C</acronym> maintains a <a href="" rel="disclosure">public list of any patent disclosures</a>
- made in connection with the deliverables of the group;
- that page also includes instructions for disclosing a patent.
- An individual who has actual knowledge of a patent which the individual believes contains
- <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a>
- must disclose the information in accordance with
- <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the
- <acronym title="World Wide Web Consortium">W3C</acronym> Patent Policy</a>.
+ Web Workers [<cite><a href="#bib-WEBWORKERS" class="bibref">WEBWORKERS</a></cite>].
</p>
- </div>
-
- <div class="section" id="toc">
- <h2 class="introductory">Table of Contents</h2>
- <ul class="toc">
- <li class="tocline"><a class="tocxref" href="#introduction"><span class="secno">1. </span>Introduction</a></li>
- <li class="tocline"><a class="tocxref" href="#stream%20interface"><span class="secno">2. </span>The Stream Interface</a>
- <ul class="toc">
- <li class="tocline"><a class="tocxref" href="#attributes"><span class="secno">2.1 </span>Attributes</a></li>
- </ul>
- </li>
- <li class="tocline"><a class="tocxref" href="#streamreader-interface"><span class="secno">3. </span>The StreamReader Interface</a>
- <ul class="toc">
- <li class="tocline"><a class="tocxref" href="#attributes-1"><span class="secno">3.1 </span>Attributes</a></li>
- <li class="tocline"><a class="tocxref" href="#methods"><span class="secno">3.2 </span>Methods</a></li>
- <li class="tocline"><a class="tocxref" href="#constants"><span class="secno">3.3 </span>Constants</a></li>
- <li class="tocline"><a class="tocxref" href="#streamreader-event-handler-types"><span class="secno">3.4 </span>Event Handler Attributes</a>
- <ul class="toc">
- <li class="tocline"><a class="tocxref" href="#streamreader-event-summary"><span class="secno">3.4.1 </span>Event Summary</a></li>
- </ul>
- </li>
- </ul>
- </li>
- <li class="tocline"><a class="tocxref" href="#streamreadersync-interface"><span class="secno">4. </span>The StreamReaderSync Interface</a>
- <ul class="toc">
- <li class="tocline"><a class="tocxref" href="#methods-1"><span class="secno">4.1 </span>Methods</a></li>
- </ul>
- </li>
- <li class="tocline"><a class="tocxref" href="#reading-empty-stream"><span class="secno">5. </span>Determining an empty Stream</a></li>
- <li class="tocline"><a class="tocxref" href="#errors-and-exceptions"><span class="secno">6. </span>Errors and Exceptions</a>
- <ul class="toc">
- <li class="tocline"><a class="tocxref" href="#streamerror-error"><span class="secno">6.1 </span>StreamError</a></li>
- <li class="tocline"><a class="tocxref" href="#streamexception-error"><span class="secno">6.2 </span>StreamException</a></li>
- </ul>
- </li>
- <li class="tocline"><a class="tocxref" href="#streambuilder-interface"><span class="secno">7. </span>The StreamBuilder Interface</a>
- <ul class="toc">
- <li class="tocline"><a class="tocxref" href="#attributes-2"><span class="secno">7.1 </span>Attributes</a></li>
- <li class="tocline"><a class="tocxref" href="#methods-2"><span class="secno">7.2 </span>Methods</a></li>
- <li class="tocline"><a class="tocxref" href="#reads-on-a-stream-from-streambuilder"><span class="secno">7.3 </span>Reads on a Stream from StreamBuilder</a></li>
- <li class="tocline"><a class="tocxref" href="#streambuilder-event-handler-types"><span class="secno">7.4 </span>Event Handler Attributes</a>
- <ul class="toc">
- <li class="tocline"><a class="tocxref" href="#streambuilder-event-summary"><span class="secno">7.4.1 </span>Event Summary</a></li>
- </ul>
- </li>
- </ul>
- </li>
- <li class="tocline"><a class="tocxref" href="#error-uris_for_streams"><span class="secno">8. </span>URIs for Stream</a>
- <ul class="toc">
- <li class="tocline"><a class="tocxref" href="#creating-revoking-streamuri"><span class="secno">8.1 </span>Creating and Revoking a Stream URI</a>
- <ul class="toc">
- <li class="tocline"><a class="tocxref" href="#methods-3"><span class="secno">8.1.1 </span>Methods</a></li>
- </ul>
- </li>
- </ul>
- </li>
- <li class="tocline"><a class="tocxref" href="#security"><span class="secno">9. </span>Security Considerations</a></li>
- <li class="tocline"><a class="tocxref" href="#XMLHttpRequest"><span class="secno">10. </span>Extension of XMLHttpRequest</a>
- <ul class="toc">
- <li class="tocline"><a class="tocxref" href="#addition-of-stream-responsetype"><span class="secno">10.1 </span>Addition of stream responseType</a></li>
- <li class="tocline"><a class="tocxref" href="#readystate3-changes"><span class="secno">10.2 </span>readyState 3 changes</a></li>
- <li class="tocline"><a class="tocxref" href="#send0"><span class="secno">10.3 </span>send()</a></li>
- </ul>
- </li>
- <li class="tocline"><a class="tocxref" href="#requirements"><span class="secno">11. </span>Requirements and Use Cases</a></li>
- <li class="tocline"><a class="tocxref" href="#acknowledgements"><span class="secno">A. </span>Acknowledgements</a></li>
- <li class="tocline"><a class="tocxref" href="#references"><span class="secno">B. </span>References</a>
- <ul class="toc">
- <li class="tocline"><a class="tocxref" href="#normative-references"><span class="secno">B.1 </span>Normative references</a></li>
- <li class="tocline"><a class="tocxref" href="#informative-references"><span class="secno">B.2 </span>Informative references</a></li>
- </ul>
- </li>
- </ul>
- </div>
+<!--End section: Abstract-->
+</section><section id="sotd" class="introductory"><h2>Status of This Document</h2>
+
+
+
+ <p>
+ <em>This section describes the status of this document at the time of its publication. Other
+ documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the latest revision
+ of this technical report can be found in the <a href="http://www.w3.org/TR/"><abbr title="World Wide Web Consortium">W3C</abbr> technical reports
+ index</a> at http://www.w3.org/TR/.</em>
+ </p>
+
+ <p>
+ This document was published by the <a href="http://www.w3.org/2008/webapps/"><abbr title="World Wide Web Consortium">W3C</abbr> Web Applications (WebApps)</a> as an Editor's Draft.
+
+ If you wish to make comments regarding this document, please send them to
+ <a href="mailto:public-webapps@w3.org">public-webapps@w3.org</a>
+ (<a href="mailto:public-webapps-request@w3.org?subject=subscribe">subscribe</a>,
+ <a href="http://lists.w3.org/Archives/Public/public-webapps/">archives</a>).
+
+
+ All feedback is welcome.
+ </p>
+
+ <p>
+ Publication as an Editor's Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr> Membership.
+ This is a draft document and may be updated, replaced or obsoleted by other documents at
+ any time. It is inappropriate to cite this document as other than work in progress.
+ </p>
+
+
+ <p>
+
+ This document was produced by a group operating under the
+ <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
+
+
+
+
+ <abbr title="World Wide Web Consortium">W3C</abbr> maintains a <a href="" rel="disclosure">public list of any patent disclosures</a>
+
+ made in connection with the deliverables of the group; that page also includes instructions for
+ disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains
+ <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the
+ information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
+ 6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
+
+
+ </p>
+
+
+
+
+</section><section id="toc"><h2 class="introductory">Table of Contents</h2><ul class="toc"><li class="tocline"><a class="tocxref" href="#introduction"><span class="secno">1. </span>Introduction</a></li><li class="tocline"><a class="tocxref" href="#stream%20interface"><span class="secno">2. </span>The Stream Interface</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#attributes"><span class="secno">2.1 </span>Attributes</a></li><li class="tocline"><a class="tocxref" href="#methods"><span class="secno">2.2 </span>Methods</a></li></ul></li><li class="tocline"><a class="tocxref" href="#streamreader-interface"><span class="secno">3. </span>The StreamReader Interface</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#attributes-1"><span class="secno">3.1 </span>Attributes</a></li><li class="tocline"><a class="tocxref" href="#methods-1"><span class="secno">3.2 </span>Methods</a></li><li class="tocline"><a class="tocxref" href="#constants"><span class="secno">3.3 </span>Constants</a></li><li class="tocline"><a class="tocxref" href="#streamreader-event-handler-types"><span class="secno">3.4 </span>Event Handler Attributes</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#streamreader-event-summary"><span class="secno">3.4.1 </span>Event Summary</a></li></ul></li></ul></li><li class="tocline"><a class="tocxref" href="#streamreadersync-interface"><span class="secno">4. </span>The StreamReaderSync Interface</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#methods-2"><span class="secno">4.1 </span>Methods</a></li></ul></li><li class="tocline"><a class="tocxref" href="#reading-empty-stream"><span class="secno">5. </span>Determining an empty Stream</a></li><li class="tocline"><a class="tocxref" href="#errors-and-exceptions"><span class="secno">6. </span>Errors and Exceptions</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#streamerror-error"><span class="secno">6.1 </span>StreamError</a></li><li class="tocline"><a class="tocxref" href="#streamexception-error"><span class="secno">6.2 </span>StreamException</a></li></ul></li><li class="tocline"><a class="tocxref" href="#streambuilder-interface"><span class="secno">7. </span>The StreamBuilder Interface</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#attributes-2"><span class="secno">7.1 </span>Attributes</a></li><li class="tocline"><a class="tocxref" href="#methods-3"><span class="secno">7.2 </span>Methods</a></li><li class="tocline"><a class="tocxref" href="#reads-on-a-stream-from-streambuilder"><span class="secno">7.3 </span>Reads on a Stream from StreamBuilder</a></li><li class="tocline"><a class="tocxref" href="#streambuilder-event-handler-types"><span class="secno">7.4 </span>Event Handler Attributes</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#streambuilder-event-summary"><span class="secno">7.4.1 </span>Event Summary</a></li></ul></li></ul></li><li class="tocline"><a class="tocxref" href="#error-uris_for_streams"><span class="secno">8. </span>URIs for Stream</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#creating-revoking-streamuri"><span class="secno">8.1 </span>Creating and Revoking a Stream URI</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#methods-4"><span class="secno">8.1.1 </span>Methods</a></li></ul></li></ul></li><li class="tocline"><a class="tocxref" href="#security"><span class="secno">9. </span>Security Considerations</a></li><li class="tocline"><a class="tocxref" href="#XMLHttpRequest"><span class="secno">10. </span>Extension of XMLHttpRequest</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#addition-of-stream-responsetype"><span class="secno">10.1 </span>Addition of stream responseType</a></li><li class="tocline"><a class="tocxref" href="#readystate3-changes"><span class="secno">10.2 </span>readyState 3 changes</a></li><li class="tocline"><a class="tocxref" href="#send0"><span class="secno">10.3 </span>send()</a></li></ul></li><li class="tocline"><a class="tocxref" href="#requirements"><span class="secno">11. </span>Requirements and Use Cases</a></li><li class="tocline"><a class="tocxref" href="#acknowledgements"><span class="secno">A. </span>Acknowledgements</a></li><li class="tocline"><a class="tocxref" href="#references"><span class="secno">B. </span>References</a><ul class="toc"><li class="tocline"><a class="tocxref" href="#normative-references"><span class="secno">B.1 </span>Normative references</a></li></ul></li></ul></section>
-<div id="introduction" class="section informative">
+<section id="introduction" class="section informative">
<!--OddPage--><h2><span class="secno">1. </span>Introduction</h2><p><em>This section is non-normative.</em></p>
<p>
@@ -231,7 +535,7 @@
with an optional synchronous API used within threaded web applications.
An asynchronous API for reading <a href="#idl-def-Stream"><code>Streams</code></a> prevents blocking and UI “freezing” on a user agent’s main thread.
This specification defines an asynchronous API based on an event model to read and access a <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>,
- which is closely based on the FileReader interface defined in the [<cite><a href="#bib-FILE-API" rel="biblioentry" class="bibref">FILE-API</a></cite>].
+ which is closely based on the FileReader interface defined in the [<cite><a href="#bib-FILE-API" class="bibref">FILE-API</a></cite>].
A <a class="idlType" href="#idl-def-StreamReader"><code>StreamReader</code></a> object provides asynchronous read methods to access the <a href="#idl-def-Stream"><code>Stream's</code></a> data as a
<code>Blob</code>, <code>DataURL</code>, <code>ArrayBuffer</code>, or as <code>Text</code> through event handler attributes and the firing of events.
The use of events and event handlers allows separate code blocks the ability to monitor the progress of the read
@@ -242,7 +546,7 @@
In the example below, different code blocks handle progress, error, and success conditions.
The example demonstrates how to read a <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> using <a class="idlType" href="#idl-def-StreamReader"><code>StreamReader</code></a>.
</p>
- <pre class="example">function startRead(stream) {
+ <div class="example"><div class="example-title"><span>Example 1</span></div><pre class="example">function startRead(stream) {
var reader = new StreamReader();
@@ -270,13 +574,13 @@
if(evt.target.error.name == "NOT_READABLE_ERR") {
// The stream could not be read
}
-}</pre>
+}</pre></div>
<p>
In the example below, different code blocks handle progress, error, and success conditions.
The example below demonstrates how to obtain a <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> from <code>XMLHttpRequest</code> to begin playing a large video in <code>readystate</code> 3.
</p>
- <pre class="example">function handler() {
+ <div class="example"><div class="example-title"><span>Example 2</span></div><pre class="example">function handler() {
if(this.readyState == this.LOADING) {
var theStream = this.response;
var streamURL = URL.createObjectURL(theStream);
@@ -290,7 +594,7 @@
client.setRequestHeader('customHeader2', 'value2');
client.open("GET", "myvideo.h264");
client.responseType = "stream";
-client.send();</pre>
+client.send();</pre></div>
<p>
In addition to reading a Stream, this specification introduces a programatic way to build a Stream with the <a class="idlType" href="#idl-def-StreamBuilder"><code>StreamBuilder</code></a> interface.
@@ -303,7 +607,7 @@
The <code>thresholdReached</code> event is fired when the buffer falls below 1024 bytes.
</p>
-<pre class="example">function thresholdReached(){
+<div class="example"><div class="example-title"><span>Example 3</span></div><pre class="example">function thresholdReached(){
var moreData = //do work to create more data to place into the stream
//if we have no more data to process and place in the stream, we close
@@ -318,11 +622,11 @@
var sbuilder.onthresholdreached = thresholdReached;
var streamURL = URL.createObjectURL(sbuilder.stream);
-document.getElementById('audioTag').src = streamURL;</pre>
+document.getElementById('audioTag').src = streamURL;</pre></div>
<!--End section: Introduction-->
-</div>
+</section>
-<div class="section" id="stream interface">
+<section class="section" id="stream interface">
<!--OddPage--><h2><span class="secno">2. </span>The Stream Interface</h2>
<p>
@@ -337,25 +641,31 @@
</ul>
<pre class="idl"><span class="idlInterface" id="idl-def-Stream">interface <span class="idlInterfaceID">Stream</span> {
<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a>DOMString</a></span> <span class="idlAttrName"><a href="#widl-Stream-type">type</a></span>;</span>
-};</span>
-</pre><div class="section" id="attributes"><h3><span class="secno">2.1 </span>Attributes</h3><dl class="attributes"><dt id="widl-Stream-type"><code>type</code> of type <span class="idlAttrType"><a>DOMString</a></span>, readonly</dt><dd>
+<span class="idlMethod"> <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-Stream-close-void">close</a></span> ();</span>
+};</span></pre><section id="attributes"><h3><span class="secno">2.1 </span>Attributes</h3><dl class="attributes"><dt id="widl-Stream-type"><code>type</code> of type <span class="idlAttrType"><a>DOMString</a></span>, readonly</dt><dd>
The ASCII-encoded string in lower case representing the media type of the <code>Stream</code>,
- expressed as an RFC2046 MIME type [<cite><a href="#bib-RFC2046" rel="biblioentry" class="bibref">RFC2046</a></cite>].
+ expressed as an RFC2046 MIME type [<cite><a href="#bib-RFC2046" class="bibref">RFC2046</a></cite>].
Conforming user agents <em title="should" class="rfc2119">should</em> return the MIME type of the <code>Stream</code>, if it is known.
If conforming user agents cannot determine the media type of the <code>Stream</code>, they <em title="must" class="rfc2119">must</em> return the empty string.
- A string is a valid MIME type if it matches the media-type token defined in section 3.7 "Media Types" of RFC 2616 [<cite><a href="#bib-HTTP11" rel="biblioentry" class="bibref">HTTP11</a></cite>].
- <div><em>No exceptions.</em></div></dd></dl></div>
-</div>
+ A string is a valid MIME type if it matches the media-type token defined in section 3.7 "Media Types" of RFC 2616 [<cite><a href="#bib-HTTP11" class="bibref">HTTP11</a></cite>].
+ </dd></dl></section><section id="methods"><h3><span class="secno">2.2 </span>Methods</h3><dl class="methods"><dt id="widl-Stream-close-void"><code>close</code></dt><dd>
+ This method should close the Stream and not allow and future reads.
+This is done by returning on the next and subsequent reads with no data.
+ This is an irreversible and non-idempotent operation; once a <code>Stream</code>
+ has been closed, it cannot be used again; dereferencing a Stream URI
+bound to a Stream object on which close has been called results in a <a href="http://www.w3.org/TR/FileAPI/#FiveHundredInternalServerError">500 Error</a>.
+ <div><em>No parameters.</em></div><div><em>Return type: </em><code><a>void</a></code></div></dd></dl></section>
+</section>
<!-- End section: The Stream Interface -->
-<div class="section" id="streamreader-interface">
+<section class="section" id="streamreader-interface">
<!--OddPage--><h2><span class="secno">3. </span>The StreamReader Interface</h2>
<p>
This interface provides methods to read the data of a <code>Stream</code> using progress events and event handler attributes.
It is desirable to read data from <a href="file:///C:/Streams/idl-def-Stream">Streams</a> asynchronously in the main thread of user agents.
This interface provides such an asynchronous API, and is specified to be used with the global object
- (<a href="http://www.w3.org/TR/2011/WD-html5-20110525/browsers.html#the-window-object">Window</a> [<cite><a href="#bib-HTML5" rel="biblioentry" class="bibref">HTML5</a></cite>]).
- The <a class="idlType" href="#idl-def-StreamReader"><code>StreamReader</code></a> is designed in a way to closely follow the <acronym title="World Wide Web Consortium">W3C</acronym> <a href="http://dev.w3.org/2006/webapi/FileAPI/#FileReader-interface">FileReader</a> [<cite><a href="#bib-FILE-API" rel="biblioentry" class="bibref">FILE-API</a></cite>],
+ (<a href="http://www.w3.org/TR/2011/WD-html5-20110525/browsers.html#the-window-object">Window</a> [<cite><a href="#bib-HTML5" class="bibref">HTML5</a></cite>]).
+ The <a class="idlType" href="#idl-def-StreamReader"><code>StreamReader</code></a> is designed in a way to closely follow the <abbr title="World Wide Web Consortium">W3C</abbr> <a href="http://dev.w3.org/2006/webapi/FileAPI/#FileReader-interface">FileReader</a> [<cite><a href="#bib-FILE-API" class="bibref">FILE-API</a></cite>],
and thus only identifies changes or additions to the way <a href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-filereader">FileReader methods</a> behave.
</p>
<p>
@@ -367,70 +677,61 @@
</p>
<p>
For event handler attributes, event handlers for <a class="idlType" href="#idl-def-StreamReader"><code>StreamReader</code></a> should mimic
- <a href="http://dev.w3.org/2006/webapi/FileAPI/#event-handler-attributes-section">6.4.3 Event Handler Attributes</a> of the File API specification. [<cite><a href="#bib-FILE-API" rel="biblioentry" class="bibref">FILE-API</a></cite>]
+ <a href="http://dev.w3.org/2006/webapi/FileAPI/#event-handler-attributes-section">6.4.3 Event Handler Attributes</a> of the File API specification. [<cite><a href="#bib-FILE-API" class="bibref">FILE-API</a></cite>]
</p>
<p>
For states, event handlers for <a class="idlType" href="#idl-def-StreamReader"><code>StreamReader</code></a> should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#blobreader-state">6.4.4 FileReader States</a>
- of the File API specification, except as defined below for <a href="#widl-StreamReader-DONE"><code>DONE</code></a> (numeric value of 2). [<cite><a href="#bib-FILE-API" rel="biblioentry" class="bibref">FILE-API</a></cite>]
+ of the File API specification, except as defined below for <a href="#widl-StreamReader-DONE"><code>DONE</code></a> (numeric value of 2). [<cite><a href="#bib-FILE-API" class="bibref">FILE-API</a></cite>]
</p>
<p>
Multiple reads on <a class="idlType" href="#idl-def-StreamReader"><code>StreamReader</code></a> should mimic
- <a href="http://dev.w3.org/2006/webapi/FileAPI/#MultipleReads">6.4.5.1 Multiple Reads</a> of the File API specification. [<cite><a href="#bib-FILE-API" rel="biblioentry" class="bibref">FILE-API</a></cite>]
+ <a href="http://dev.w3.org/2006/webapi/FileAPI/#MultipleReads">6.4.5.1 Multiple Reads</a> of the File API specification. [<cite><a href="#bib-FILE-API" class="bibref">FILE-API</a></cite>]
</p>
<pre class="idl"><span class="idlInterface" id="idl-def-StreamReader">interface <span class="idlInterfaceID">StreamReader</span> : <span class="idlSuperclass"><a>EventTarget</a></span> {
-<span class="idlMethod"> <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-StreamReader-readAsBlob-void-Stream-stream-unsigned-long-long-maxSize">readAsBlob</a></span> (<span class="idlParam"><span class="idlParamType"><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></span> <span class="idlParamName">stream</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>unsigned long long</a></span> <span class="idlParamName">maxSize</span></span>) raises (<span class="idlRaises"><a>StreamException</a></span>, <span class="idlRaises"><a>OperationNotAllowedException</a></span>);</span>
-<span class="idlMethod"> <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-StreamReader-readAsArrayBuffer-void-Stream-stream-unsigned-long-long-maxSize">readAsArrayBuffer</a></span> (<span class="idlParam"><span class="idlParamType"><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></span> <span class="idlParamName">stream</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>unsigned long long</a></span> <span class="idlParamName">maxSize</span></span>) raises (<span class="idlRaises"><a>StreamException</a></span>, <span class="idlRaises"><a>OperationNotAllowedException</a></span>);</span>
-<span class="idlMethod"> <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-StreamReader-readAsText-void-Stream-stream-DOMString-encoding-unsigned-long-long-maxSize">readAsText</a></span> (<span class="idlParam"><span class="idlParamType"><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></span> <span class="idlParamName">stream</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">encoding</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>unsigned long long</a></span> <span class="idlParamName">maxSize</span></span>) raises (<span class="idlRaises"><a>StreamException</a></span>, <span class="idlRaises"><a>OperationNotAllowedException</a></span>);</span>
-<span class="idlMethod"> <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-StreamReader-readAsDataURL-void-Stream-Stream-unsigned-long-long-maxSize">readAsDataURL</a></span> (<span class="idlParam"><span class="idlParamType"><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></span> <span class="idlParamName">Stream</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>unsigned long long</a></span> <span class="idlParamName">maxSize</span></span>) raises (<span class="idlRaises"><a>StreamException</a></span>, <span class="idlRaises"><a>OperationNotAllowedException</a></span>);</span>
+<span class="idlMethod"> <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-StreamReader-readAsBlob-void-Stream-stream-unsigned-long-long-maxSize">readAsBlob</a></span> (<span class="idlParam"><span class="idlParamType"><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></span> <span class="idlParamName">stream</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>unsigned long long</a></span> <span class="idlParamName">maxSize</span></span>);</span>
+<span class="idlMethod"> <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-StreamReader-readAsArrayBuffer-void-Stream-stream-unsigned-long-long-maxSize">readAsArrayBuffer</a></span> (<span class="idlParam"><span class="idlParamType"><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></span> <span class="idlParamName">stream</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>unsigned long long</a></span> <span class="idlParamName">maxSize</span></span>);</span>
+<span class="idlMethod"> <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-StreamReader-readAsText-void-Stream-stream-DOMString-encoding-optional-unsigned-long-long-maxSize">readAsText</a></span> (<span class="idlParam"><span class="idlParamType"><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></span> <span class="idlParamName">stream</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">encoding</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>optional unsigned long long</a></span> <span class="idlParamName">maxSize</span></span>);</span>
+<span class="idlMethod"> <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-StreamReader-readAsDataURL-void-Stream-Stream-unsigned-long-long-maxSize">readAsDataURL</a></span> (<span class="idlParam"><span class="idlParamType"><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></span> <span class="idlParamName">Stream</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>unsigned long long</a></span> <span class="idlParamName">maxSize</span></span>);</span>
<span class="idlMethod"> <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-StreamReader-abort-void">abort</a></span> ();</span>
-
-//states
-<span class="idlConst"> const <span class="idlConstType"><a>unsigned short</a></span> <span class="idlConstName"><a href="#widl-StreamReader-EMPTY">EMPTY</a></span> = <span class="idlConstValue">0</span>;</span>
-<span class="idlConst"> const <span class="idlConstType"><a>unsigned short</a></span> <span class="idlConstName"><a href="#widl-StreamReader-LOADING">LOADING</a></span> = <span class="idlConstValue">1</span>;</span>
-<span class="idlConst"> const <span class="idlConstType"><a>unsigned short</a></span> <span class="idlConstName"><a href="#widl-StreamReader-DONE">DONE</a></span> = <span class="idlConstValue">2</span>;</span>
-
+<span class="idlConst"> const <span class="idlConstType"><a>unsigned short</a></span> <span class="idlConstName"><a href="#EMPTY">EMPTY</a></span> = <span class="idlConstValue">0</span>;</span>
+<span class="idlConst"> const <span class="idlConstType"><a>unsigned short</a></span> <span class="idlConstName"><a href="#LOADING">LOADING</a></span> = <span class="idlConstValue">1</span>;</span>
+<span class="idlConst"> const <span class="idlConstType"><a>unsigned short</a></span> <span class="idlConstName"><a href="#DONE">DONE</a></span> = <span class="idlConstValue">2</span>;</span>
<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a>unsigned short</a></span> <span class="idlAttrName"><a href="#widl-StreamReader-readyState">readyState</a></span>;</span>
-
-//Blob data
<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a>any</a></span> <span class="idlAttrName"><a href="#widl-StreamReader-result">result</a></span>;</span>
-
<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a>StreamError</a></span> <span class="idlAttrName"><a href="#widl-StreamReader-error">error</a></span>;</span>
-
-//event handler attributes
<span class="idlAttribute"> attribute <span class="idlAttrType"><a>Function</a></span> <span class="idlAttrName"><a href="#widl-StreamReader-onloadstart">onloadstart</a></span>;</span>
<span class="idlAttribute"> attribute <span class="idlAttrType"><a>Function</a></span> <span class="idlAttrName"><a href="#widl-StreamReader-onprogress">onprogress</a></span>;</span>
<span class="idlAttribute"> attribute <span class="idlAttrType"><a>Function</a></span> <span class="idlAttrName"><a href="#widl-StreamReader-onload">onload</a></span>;</span>
<span class="idlAttribute"> attribute <span class="idlAttrType"><a>Function</a></span> <span class="idlAttrName"><a href="#widl-StreamReader-onabort">onabort</a></span>;</span>
<span class="idlAttribute"> attribute <span class="idlAttrType"><a>Function</a></span> <span class="idlAttrName"><a href="#widl-StreamReader-onerror">onerror</a></span>;</span>
<span class="idlAttribute"> attribute <span class="idlAttrType"><a>Function</a></span> <span class="idlAttrName"><a href="#widl-StreamReader-onloadend">onloadend</a></span>;</span>
-};</span>
-</pre><div class="section" id="attributes-1"><h3><span class="secno">3.1 </span>Attributes</h3><dl class="attributes"><dt id="widl-StreamReader-error"><code>error</code> of type <span class="idlAttrType"><a>StreamError</a></span>, readonly</dt><dd><div><em>No exceptions.</em></div></dd><dt id="widl-StreamReader-onabort"><code>onabort</code> of type <span class="idlAttrType"><a>Function</a></span></dt><dd>
+};</span></pre><section id="attributes-1"><h3><span class="secno">3.1 </span>Attributes</h3><dl class="attributes"><dt id="widl-StreamReader-error"><code>error</code> of type <span class="idlAttrType"><a>StreamError</a></span>, readonly</dt><dd></dd><dt id="widl-StreamReader-onabort"><code>onabort</code> of type <span class="idlAttrType"><a>Function</a></span></dt><dd>
This event handler should mimic the
<a href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-onabort"><code>FileReader.onabort</code></a>
event handler.
- <div><em>No exceptions.</em></div></dd><dt id="widl-StreamReader-onerror"><code>onerror</code> of type <span class="idlAttrType"><a>Function</a></span></dt><dd>
+ </dd><dt id="widl-StreamReader-onerror"><code>onerror</code> of type <span class="idlAttrType"><a>Function</a></span></dt><dd>
This event handler should mimic the
<a href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-onerror"><code>FileReader.onerror</code></a>
event handler.
- <div><em>No exceptions.</em></div></dd><dt id="widl-StreamReader-onload"><code>onload</code> of type <span class="idlAttrType"><a>Function</a></span></dt><dd>
+ </dd><dt id="widl-StreamReader-onload"><code>onload</code> of type <span class="idlAttrType"><a>Function</a></span></dt><dd>
This event handler should mimic the
<a href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-onload"><code>FileReader.onload</code></a>
event handler.
- <div><em>No exceptions.</em></div></dd><dt id="widl-StreamReader-onloadend"><code>onloadend</code> of type <span class="idlAttrType"><a>Function</a></span></dt><dd>
+ </dd><dt id="widl-StreamReader-onloadend"><code>onloadend</code> of type <span class="idlAttrType"><a>Function</a></span></dt><dd>
This event handler should mimic the
<a href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-onloadend"><code>FileReader.onloadend</code></a>
event handler.
- <div><em>No exceptions.</em></div></dd><dt id="widl-StreamReader-onloadstart"><code>onloadstart</code> of type <span class="idlAttrType"><a>Function</a></span></dt><dd>
+ </dd><dt id="widl-StreamReader-onloadstart"><code>onloadstart</code> of type <span class="idlAttrType"><a>Function</a></span></dt><dd>
This event handler should mimic the
<a href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-onloadstart"><code>FileReader.onloadstart</code></a>
event handler.
- <div><em>No exceptions.</em></div></dd><dt id="widl-StreamReader-onprogress"><code>onprogress</code> of type <span class="idlAttrType"><a>Function</a></span></dt><dd>
+ </dd><dt id="widl-StreamReader-onprogress"><code>onprogress</code> of type <span class="idlAttrType"><a>Function</a></span></dt><dd>
This event handler should mimic the
<a href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-onprogress"><code>FileReader.onprogress</code></a>
event handler.
- <div><em>No exceptions.</em></div></dd><dt id="widl-StreamReader-readyState"><code>readyState</code> of type <span class="idlAttrType"><a>unsigned short</a></span>, readonly</dt><dd><div><em>No exceptions.</em></div></dd><dt id="widl-StreamReader-result"><code>result</code> of type <span class="idlAttrType"><a>any</a></span>, readonly</dt><dd>
+ </dd><dt id="widl-StreamReader-readyState"><code>readyState</code> of type <span class="idlAttrType"><a>unsigned short</a></span>, readonly</dt><dd></dd><dt id="widl-StreamReader-result"><code>result</code> of type <span class="idlAttrType"><a>any</a></span>, readonly</dt><dd>
This attribute should mimic the <a href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-result">FileReader.result</a> attribute, with the following addition:
<ul>
<li>
@@ -440,14 +741,17 @@
with the type property set as the type of the <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>.
</li>
</ul>
- <div><em>No exceptions.</em></div></dd></dl></div><div class="section" id="methods"><h3><span class="secno">3.2 </span>Methods</h3><dl class="methods"><dt id="widl-StreamReader-abort-void"><code>abort</code></dt><dd>This method should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#abort"><code>FileReader.abort()</code></a>. [<cite><a href="#bib-FILE-API" rel="biblioentry" class="bibref">FILE-API</a></cite>]<div><em>No parameters.</em></div><div><em>No exceptions.</em></div><div><em>Return type: </em><code><a>void</a></code></div></dd><dt id="widl-StreamReader-readAsArrayBuffer-void-Stream-stream-unsigned-long-long-maxSize"><code>readAsArrayBuffer</code></dt><dd>
+ </dd></dl></section><section id="methods-1"><h3><span class="secno">3.2 </span>Methods</h3><dl class="methods"><dt id="widl-StreamReader-abort-void"><code>abort</code></dt><dd>This method should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#abort"><code>FileReader.abort()</code></a>. [<cite><a href="#bib-FILE-API" class="bibref">FILE-API</a></cite>]<div><em>No parameters.</em></div><div><em>Return type: </em><code><a>void</a></code></div></dd><dt id="widl-StreamReader-readAsArrayBuffer-void-Stream-stream-unsigned-long-long-maxSize"><code>readAsArrayBuffer</code></dt><dd>
<p></p>
<p>
- This method should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#readAsArrayBuffer"><code>FileReader.readAsArrayBuffer()</code></a>. [<cite><a href="#bib-FILE-API" rel="biblioentry" class="bibref">FILE-API</a></cite>]
+ This method should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#readAsArrayBuffer"><code>FileReader.readAsArrayBuffer()</code></a>. [<cite><a href="#bib-FILE-API" class="bibref">FILE-API</a></cite>]
The only addition is the addition of a <code>maxSize</code> parameter, which has the following adjustment:
</p>
<ul>
<li>
+ If <code>maxSize</code> is less than one, through an Invalid Argument exception. Terminate these overall steps.
+ </li>
+ <li>
When the stream has been fully read,
or the number of bytes specified by <code>maxSize</code> has been reached,
set <a class="idlType" href="#widl-StreamReader-readyState"><code>readyState</code></a> to <code>DONE</code>.
@@ -455,16 +759,25 @@
</ul>
<p></p>
-
-
+ <dl class="exception" title="StreamException">
+ <dt></dt>
+ <dd></dd>
+ </dl>
+ <dl class="exception" title="OperationNotAllowedException">
+ <dt></dt>
+ <dd></dd>
+ </dl>
- <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">stream</td><td class="prmType"><code><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The Stream to be read</td></tr><tr><td class="prmName">maxSize</td><td class="prmType"><code><a>unsigned long long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptTrue">✔</td><td class="prmDesc">The maximum number of bytes to be read before completion</td></tr></table><table class="exceptions"><tr><th>Exception</th><th>Description</th></tr><tr><td class="excName"><a>StreamException</a></td><td class="excDesc"><table class="exceptionCodes"><tr><td class="excCodeName"><code></code></td><td class="excCodeDesc"></td></tr></table></td></tr><tr><td class="excName"><a>OperationNotAllowedException</a></td><td class="excDesc"><table class="exceptionCodes"><tr><td class="excCodeName"><code></code></td><td class="excCodeDesc"></td></tr></table></td></tr></table><div><em>Return type: </em><code><a>void</a></code></div></dd><dt id="widl-StreamReader-readAsBlob-void-Stream-stream-unsigned-long-long-maxSize"><code>readAsBlob</code></dt><dd>
+ <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">stream</td><td class="prmType"><code><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The Stream to be read</td></tr><tr><td class="prmName">maxSize</td><td class="prmType"><code><a>unsigned long long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptTrue">✔</td><td class="prmDesc">The maximum number of bytes to be read before completion</td></tr></table><div><em>Return type: </em><code><a>void</a></code></div></dd><dt id="widl-StreamReader-readAsBlob-void-Stream-stream-unsigned-long-long-maxSize"><code>readAsBlob</code></dt><dd>
<p></p>
<p>
When this method is called, the user agent <em title="must" class="rfc2119">must</em> run the steps below (unless otherwise indicated).
</p>
<ol>
<li>
+ If <code>maxSize</code> is less than one, through an Invalid Argument exception. Terminate these overall steps.
+ </li>
+ <li>
If <code>readyState</code> is <code>LOADING</code>, raise a <code>NOT_ALLOWED_ERR</code> exception and terminate these steps.
</li>
<li>
@@ -523,37 +836,56 @@
</ol>
<p></p>
-
-
- <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">stream</td><td class="prmType"><code><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The Stream to be read</td></tr><tr><td class="prmName">maxSize</td><td class="prmType"><code><a>unsigned long long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptTrue">✔</td><td class="prmDesc">The maximum number of bytes to be read before completion</td></tr></table><table class="exceptions"><tr><th>Exception</th><th>Description</th></tr><tr><td class="excName"><a>StreamException</a></td><td class="excDesc"><table class="exceptionCodes"><tr><td class="excCodeName"><code></code></td><td class="excCodeDesc"></td></tr></table></td></tr><tr><td class="excName"><a>OperationNotAllowedException</a></td><td class="excDesc"><table class="exceptionCodes"><tr><td class="excCodeName"><code></code></td><td class="excCodeDesc"></td></tr></table></td></tr></table><div><em>Return type: </em><code><a>void</a></code></div></dd><dt id="widl-StreamReader-readAsDataURL-void-Stream-Stream-unsigned-long-long-maxSize"><code>readAsDataURL</code></dt><dd>
+ <dl class="exception" title="StreamException">
+ <dt></dt>
+ <dd></dd>
+ </dl>
+ <dl class="exception" title="OperationNotAllowedException">
+ <dt></dt>
+ <dd></dd>
+ </dl>
+
+ <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">stream</td><td class="prmType"><code><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The Stream to be read</td></tr><tr><td class="prmName">maxSize</td><td class="prmType"><code><a>unsigned long long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptTrue">✔</td><td class="prmDesc">The maximum number of bytes to be read before completion</td></tr></table><div><em>Return type: </em><code><a>void</a></code></div></dd><dt id="widl-StreamReader-readAsDataURL-void-Stream-Stream-unsigned-long-long-maxSize"><code>readAsDataURL</code></dt><dd>
<p></p>
<p>
- This method should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#readAsDataURL"><code>FileReader.readAsDataURL()</code></a>. [<cite><a href="#bib-FILE-API" rel="biblioentry" class="bibref">FILE-API</a></cite>]
+ This method should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#readAsDataURL"><code>FileReader.readAsDataURL()</code></a>. [<cite><a href="#bib-FILE-API" class="bibref">FILE-API</a></cite>]
The only addition is the addition of a <code>maxSize</code> parameter, which has the following adjustment.
</p>
<ul>
<li>
+ If <code>maxSize</code> is less than one, through an Invalid Argument exception. Terminate these overall steps.
+ </li>
+ <li>
Queue a task to update the <a class="idlType" href="#widl-StreamReader-result"><code>result</code></a> attribute
- with the <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> as a DataURL [<cite><a href="#bib-RFC2397" rel="biblioentry" class="bibref">RFC2397</a></cite>] after the stream has been fully read,
+ with the <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> as a DataURL [<cite><a href="#bib-RFC2397" class="bibref">RFC2397</a></cite>] after the stream has been fully read,
or the number of bytes specified by <code>maxSize</code> has been reached;
on getting, the <a class="idlType" href="#widl-StreamReader-result"><code>result</code></a> attribute
- returns the (complete) data of stream as a DataURL [<cite><a href="#bib-RFC2397" rel="biblioentry" class="bibref">RFC2397</a></cite>].
+ returns the (complete) data of stream as a DataURL [<cite><a href="#bib-RFC2397" class="bibref">RFC2397</a></cite>].
</li>
</ul>
-
+ <dl class="exception" title="StreamException">
+ <dt></dt>
+ <dd></dd>
+ </dl>
+ <dl class="exception" title="OperationNotAllowedException">
+ <dt></dt>
+ <dd></dd>
+ </dl>
-
- <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">Stream</td><td class="prmType"><code><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The Stream to be read</td></tr><tr><td class="prmName">maxSize</td><td class="prmType"><code><a>unsigned long long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptTrue">✔</td><td class="prmDesc">The maximum number of bytes to be read before completionk</td></tr></table><table class="exceptions"><tr><th>Exception</th><th>Description</th></tr><tr><td class="excName"><a>StreamException</a></td><td class="excDesc"><table class="exceptionCodes"><tr><td class="excCodeName"><code></code></td><td class="excCodeDesc"></td></tr></table></td></tr><tr><td class="excName"><a>OperationNotAllowedException</a></td><td class="excDesc"><table class="exceptionCodes"><tr><td class="excCodeName"><code></code></td><td class="excCodeDesc"></td></tr></table></td></tr></table><div><em>Return type: </em><code><a>void</a></code></div></dd><dt id="widl-StreamReader-readAsText-void-Stream-stream-DOMString-encoding-unsigned-long-long-maxSize"><code>readAsText</code></dt><dd>
+ <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">Stream</td><td class="prmType"><code><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The Stream to be read</td></tr><tr><td class="prmName">maxSize</td><td class="prmType"><code><a>unsigned long long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptTrue">✔</td><td class="prmDesc">The maximum number of bytes to be read before completionk</td></tr></table><div><em>Return type: </em><code><a>void</a></code></div></dd><dt id="widl-StreamReader-readAsText-void-Stream-stream-DOMString-encoding-optional-unsigned-long-long-maxSize"><code>readAsText</code></dt><dd>
<p></p>
<p>
- This method should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#readAsDataText"><code>FileReader.readAsText()</code></a>. [<cite><a href="#bib-FILE-API" rel="biblioentry" class="bibref">FILE-API</a></cite>]
+ This method should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#readAsDataText"><code>FileReader.readAsText()</code></a>. [<cite><a href="#bib-FILE-API" class="bibref">FILE-API</a></cite>]
The only addition is the addition of a <code>maxSize</code> parameter, which has the following adjustment:
</p>
<ol>
<li>
- If no encoding is specified, use the <a href="http://dev.w3.org/2006/webapi/FileAPI/#encoding-determination">encoding determination</a> algorithm specified in the [<cite><a href="#bib-FILE-API" rel="biblioentry" class="bibref">FILE-API</a></cite>].
+ If <code>maxSize</code> is less than one, through an Invalid Argument exception. Terminate these overall steps.
+ </li>
+ <li>
+ If no encoding is specified, use the <a href="http://dev.w3.org/2006/webapi/FileAPI/#encoding-determination">encoding determination</a> algorithm specified in the [<cite><a href="#bib-FILE-API" class="bibref">FILE-API</a></cite>].
</li>
<li>
If no <code>maxSize</code> is specified, continue reading until the stream has been completed.
@@ -566,9 +898,15 @@
</ol>
<p></p>
-
-
- <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">stream</td><td class="prmType"><code><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The Stream to be read</td></tr><tr><td class="prmName">encoding</td><td class="prmType"><code><a>DOMString</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptTrue">✔</td><td class="prmDesc">The encoding format</td></tr><tr><td class="prmName">maxSize</td><td class="prmType"><code><a>unsigned long long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptTrue">✔</td><td class="prmDesc">The maximum number of bytes to be read before completion</td></tr></table><table class="exceptions"><tr><th>Exception</th><th>Description</th></tr><tr><td class="excName"><a>StreamException</a></td><td class="excDesc"><table class="exceptionCodes"><tr><td class="excCodeName"><code></code></td><td class="excCodeDesc"></td></tr></table></td></tr><tr><td class="excName"><a>OperationNotAllowedException</a></td><td class="excDesc"><table class="exceptionCodes"><tr><td class="excCodeName"><code></code></td><td class="excCodeDesc"></td></tr></table></td></tr></table><div><em>Return type: </em><code><a>void</a></code></div></dd></dl></div><div class="section" id="constants"><h3><span class="secno">3.3 </span>Constants</h3><dl class="constants"><dt id="widl-StreamReader-DONE"><code>DONE</code> of type <span class="idlConstType"><a>unsigned short</a></span></dt><dd>
+ <dl class="exception" title="StreamException">
+ <dt></dt>
+ <dd></dd>
+ </dl>
+ <dl class="exception" title="OperationNotAllowedException">
+ <dt></dt>
+ <dd></dd>
+ </dl>
+ <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">stream</td><td class="prmType"><code><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The Stream to be read</td></tr><tr><td class="prmName">encoding</td><td class="prmType"><code><a>DOMString</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptTrue">✔</td><td class="prmDesc">The encoding format</td></tr><tr><td class="prmName">maxSize</td><td class="prmType"><code><a>optional unsigned long long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptTrue">✔</td><td class="prmDesc">The maximum number of bytes to be read before completion</td></tr></table><div><em>Return type: </em><code><a>void</a></code></div></dd></dl></section><section id="constants"><h3><span class="secno">3.3 </span>Constants</h3><dl class="constants"><dt id="widl-StreamReader-DONE"><code>DONE</code> of type <span class="idlConstType"><a>unsigned short</a></span></dt><dd>
The current read request has been completed, or an error occurred during read,
or the read was aborted using <a href="#widl-StreamReader-abort-void"><code>abort()</code></a>. The <a class="idlType" href="#idl-def-StreamReader"><code>StreamReader</code></a> is no longer reading a <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>.
</dd><dt id="widl-StreamReader-EMPTY"><code>EMPTY</code> of type <span class="idlConstType"><a>unsigned short</a></span></dt><dd>
@@ -579,10 +917,10 @@
This state should mimic the
<code>LOADING</code> state of the
<a href="http://dev.w3.org/2006/webapi/FileAPI/#blobreader-state">FileReader States</a>
- </dd></dl></div>
+ </dd></dl></section>
<pre class="idl"><span class="idlImplements"><a class="idlType" href="#idl-def-StreamReader"><code>StreamReader</code></a> implements <a>EventTarget</a>;</span></pre><div class="idlImplementsDesc"><p>All instances of the <code><a class="idlType" href="#idl-def-StreamReader"><code>StreamReader</code></a></code> type are defined to also implement the <a>EventTarget</a> interface.</p></div>
- <div class="section" id="streamreader-event-handler-types">
+ <section class="section" id="streamreader-event-handler-types">
<h3><span class="secno">3.4 </span>Event Handler Attributes</h3>
<p>
The following are the event handler attributes (and their corresponding event handler event types) that user agents <em title="must" class="rfc2119">must</em> support on StreamReader as DOM attributes:
@@ -622,11 +960,11 @@
</tbody>
</table>
- <div class="section" id="streamreader-event-summary">
+ <section class="section" id="streamreader-event-summary">
<h4><span class="secno">3.4.1 </span>Event Summary</h4>
<p>
The following are the events that are fired at <code><a class="idlType" href="#idl-def-StreamReader"><code>StreamReader</code></a></code> objects;
- <a href="http://dev.w3.org/2006/webapi/FileAPI/#fire-a-progress-event">firing events</a> is defined in DOM Level 3 Events [<cite><a href="#bib-DOM-LEVEL-3-EVENTS" rel="biblioentry" class="bibref">DOM-LEVEL-3-EVENTS</a></cite>],
+ <a href="http://dev.w3.org/2006/webapi/FileAPI/#fire-a-progress-event">firing events</a> is defined in DOM Level 3 Events [<cite><a href="#bib-DOM-LEVEL-3-EVENTS" class="bibref">DOM-LEVEL-3-EVENTS</a></cite>],
and the table below is normative for the events in this specification.
</p>
<table class="error" id="event-summary-table">
@@ -671,14 +1009,14 @@
</tr>
</tbody>
</table>
- </div>
+ </section>
- </div>
+ </section>
-</div>
+</section>
<!-- End section: The StreamReader Interface -->
-<div class="section" id="streamreadersync-interface">
+<section class="section" id="streamreadersync-interface">
<!--OddPage--><h2><span class="secno">4. </span>The StreamReaderSync Interface</h2>
<p>
This interface provides methods to read the data of a <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>.
@@ -691,19 +1029,21 @@
the <code>StreamReaderSync</code> constructor <em title="must" class="rfc2119">must</em> be available.
</p>
<pre class="idl"><span class="idlInterface" id="idl-def-StreamReaderSync">interface <span class="idlInterfaceID">StreamReaderSync</span> {
-<span class="idlMethod"> <span class="idlMethType"><a>Blob</a></span> <span class="idlMethName"><a href="#widl-StreamReaderSync-readAsBlob-Blob-Stream-stream-unsigned-long-long-maxSize">readAsBlob</a></span> (<span class="idlParam"><span class="idlParamType"><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></span> <span class="idlParamName">stream</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>unsigned long long</a></span> <span class="idlParamName">maxSize</span></span>) raises (<span class="idlRaises"><a>StreamException</a></span>);</span>
-<span class="idlMethod"> <span class="idlMethType"><a>ArrayBuffer</a></span> <span class="idlMethName"><a href="#widl-StreamReaderSync-readAsArrayBuffer-ArrayBuffer-Stream-stream-unsigned-long-long-maxSize">readAsArrayBuffer</a></span> (<span class="idlParam"><span class="idlParamType"><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></span> <span class="idlParamName">stream</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>unsigned long long</a></span> <span class="idlParamName">maxSize</span></span>) raises (<span class="idlRaises"><a>StreamException</a></span>);</span>
-<span class="idlMethod"> <span class="idlMethType"><a>DOMString</a></span> <span class="idlMethName"><a href="#widl-StreamReaderSync-readAsText-DOMString-Stream-stream-DOMString-encoding-unsigned-long-long-maxSize">readAsText</a></span> (<span class="idlParam"><span class="idlParamType"><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></span> <span class="idlParamName">stream</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">encoding</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>unsigned long long</a></span> <span class="idlParamName">maxSize</span></span>) raises (<span class="idlRaises"><a>StreamException</a></span>);</span>
-<span class="idlMethod"> <span class="idlMethType"><a>DOMString</a></span> <span class="idlMethName"><a href="#widl-StreamReaderSync-readAsDataURL-DOMString-Stream-stream-unsigned-long-long-maxSize">readAsDataURL</a></span> (<span class="idlParam"><span class="idlParamType"><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></span> <span class="idlParamName">stream</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>unsigned long long</a></span> <span class="idlParamName">maxSize</span></span>) raises (<span class="idlRaises"><a>StreamException</a></span>);</span>
-};</span>
-</pre><div class="section" id="methods-1"><h3><span class="secno">4.1 </span>Methods</h3><dl class="methods"><dt id="widl-StreamReaderSync-readAsArrayBuffer-ArrayBuffer-Stream-stream-unsigned-long-long-maxSize"><code>readAsArrayBuffer</code></dt><dd>
+<span class="idlMethod"> <span class="idlMethType"><a>Blob</a></span> <span class="idlMethName"><a href="#widl-StreamReaderSync-readAsBlob-Blob-Stream-stream-unsigned-long-long-maxSize">readAsBlob</a></span> (<span class="idlParam"><span class="idlParamType"><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></span> <span class="idlParamName">stream</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>unsigned long long</a></span> <span class="idlParamName">maxSize</span></span>);</span>
+<span class="idlMethod"> <span class="idlMethType"><a>ArrayBuffer</a></span> <span class="idlMethName"><a href="#widl-StreamReaderSync-readAsArrayBuffer-ArrayBuffer-Stream-stream-unsigned-long-long-maxSize">readAsArrayBuffer</a></span> (<span class="idlParam"><span class="idlParamType"><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></span> <span class="idlParamName">stream</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>unsigned long long</a></span> <span class="idlParamName">maxSize</span></span>);</span>
+<span class="idlMethod"> <span class="idlMethType"><a>DOMString</a></span> <span class="idlMethName"><a href="#widl-StreamReaderSync-readAsText-DOMString-Stream-stream-DOMString-encoding-optional-unsigned-long-long-maxSize">readAsText</a></span> (<span class="idlParam"><span class="idlParamType"><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></span> <span class="idlParamName">stream</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">encoding</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>optional unsigned long long</a></span> <span class="idlParamName">maxSize</span></span>);</span>
+<span class="idlMethod"> <span class="idlMethType"><a>DOMString</a></span> <span class="idlMethName"><a href="#widl-StreamReaderSync-readAsDataURL-DOMString-Stream-stream-unsigned-long-long-maxSize">readAsDataURL</a></span> (<span class="idlParam"><span class="idlParamType"><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></span> <span class="idlParamName">stream</span></span>, <span class="idlParam">optional <span class="idlParamType"><a>unsigned long long</a></span> <span class="idlParamName">maxSize</span></span>);</span>
+};</span></pre><section id="methods-2"><h3><span class="secno">4.1 </span>Methods</h3><dl class="methods"><dt id="widl-StreamReaderSync-readAsArrayBuffer-ArrayBuffer-Stream-stream-unsigned-long-long-maxSize"><code>readAsArrayBuffer</code></dt><dd>
<p>
- This method should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#readAsArrayBufferSyncSection"><code>FileReader.readAsArrayBuffer()</code></a>. [<cite><a href="#bib-FILE-API" rel="biblioentry" class="bibref">FILE-API</a></cite>]
+ This method should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#readAsArrayBufferSyncSection"><code>FileReader.readAsArrayBuffer()</code></a>. [<cite><a href="#bib-FILE-API" class="bibref">FILE-API</a></cite>]
The only addition is the addition of a <code>maxSize</code> parameter that affects the amount of bytes to read from the <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>.
</p>
-
- <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">stream</td><td class="prmType"><code><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The Stream to be read</td></tr><tr><td class="prmName">maxSize</td><td class="prmType"><code><a>unsigned long long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptTrue">✔</td><td class="prmDesc">The maximum number of bytes to be read before completion</td></tr></table><table class="exceptions"><tr><th>Exception</th><th>Description</th></tr><tr><td class="excName"><a>StreamException</a></td><td class="excDesc"><table class="exceptionCodes"><tr><td class="excCodeName"><code></code></td><td class="excCodeDesc"></td></tr></table></td></tr></table><div><em>Return type: </em><code><a>ArrayBuffer</a></code></div></dd><dt id="widl-StreamReaderSync-readAsBlob-Blob-Stream-stream-unsigned-long-long-maxSize"><code>readAsBlob</code></dt><dd>
+ <dl class="exception" title="StreamException">
+ <dt></dt>
+ <dd></dd>
+ </dl>
+ <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">stream</td><td class="prmType"><code><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The Stream to be read</td></tr><tr><td class="prmName">maxSize</td><td class="prmType"><code><a>unsigned long long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptTrue">✔</td><td class="prmDesc">The maximum number of bytes to be read before completion</td></tr></table><div><em>Return type: </em><code><a>ArrayBuffer</a></code></div></dd><dt id="widl-StreamReaderSync-readAsBlob-Blob-Stream-stream-unsigned-long-long-maxSize"><code>readAsBlob</code></dt><dd>
<p></p>
<p>
When this method is called, the following steps <em title="must" class="rfc2119">must</em> be followed:
@@ -723,25 +1063,34 @@
</ol>
<p></p>
-
- <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">stream</td><td class="prmType"><code><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The Stream to be read</td></tr><tr><td class="prmName">maxSize</td><td class="prmType"><code><a>unsigned long long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptTrue">✔</td><td class="prmDesc">The maximum number of bytes to be read before completion</td></tr></table><table class="exceptions"><tr><th>Exception</th><th>Description</th></tr><tr><td class="excName"><a>StreamException</a></td><td class="excDesc"><table class="exceptionCodes"><tr><td class="excCodeName"><code></code></td><td class="excCodeDesc"></td></tr></table></td></tr></table><div><em>Return type: </em><code><a>Blob</a></code></div></dd><dt id="widl-StreamReaderSync-readAsDataURL-DOMString-Stream-stream-unsigned-long-long-maxSize"><code>readAsDataURL</code></dt><dd>
+ <dl class="exception" title="StreamException">
+ <dt></dt>
+ <dd></dd>
+ </dl>
+ <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">stream</td><td class="prmType"><code><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The Stream to be read</td></tr><tr><td class="prmName">maxSize</td><td class="prmType"><code><a>unsigned long long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptTrue">✔</td><td class="prmDesc">The maximum number of bytes to be read before completion</td></tr></table><div><em>Return type: </em><code><a>Blob</a></code></div></dd><dt id="widl-StreamReaderSync-readAsDataURL-DOMString-Stream-stream-unsigned-long-long-maxSize"><code>readAsDataURL</code></dt><dd>
<p>
- This method should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#readAsDataURLSync-section"><code>FileReader.readAsDataURL()</code></a>. [<cite><a href="#bib-FILE-API" rel="biblioentry" class="bibref">FILE-API</a></cite>]
+ This method should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#readAsDataURLSync-section"><code>FileReader.readAsDataURL()</code></a>. [<cite><a href="#bib-FILE-API" class="bibref">FILE-API</a></cite>]
The only addition is the addition of a <code>maxSize</code> parameter that affects the amount of the amount of bytes to read from the <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>.
</p>
-
- <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">stream</td><td class="prmType"><code><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The Stream to be read</td></tr><tr><td class="prmName">maxSize</td><td class="prmType"><code><a>unsigned long long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptTrue">✔</td><td class="prmDesc">The maximum number of bytes to be read before completion</td></tr></table><table class="exceptions"><tr><th>Exception</th><th>Description</th></tr><tr><td class="excName"><a>StreamException</a></td><td class="excDesc"><table class="exceptionCodes"><tr><td class="excCodeName"><code></code></td><td class="excCodeDesc"></td></tr></table></td></tr></table><div><em>Return type: </em><code><a>DOMString</a></code></div></dd><dt id="widl-StreamReaderSync-readAsText-DOMString-Stream-stream-DOMString-encoding-unsigned-long-long-maxSize"><code>readAsText</code></dt><dd>
+ <dl class="exception" title="StreamException">
+ <dt></dt>
+ <dd></dd>
+ </dl>
+ <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">stream</td><td class="prmType"><code><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The Stream to be read</td></tr><tr><td class="prmName">maxSize</td><td class="prmType"><code><a>unsigned long long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptTrue">✔</td><td class="prmDesc">The maximum number of bytes to be read before completion</td></tr></table><div><em>Return type: </em><code><a>DOMString</a></code></div></dd><dt id="widl-StreamReaderSync-readAsText-DOMString-Stream-stream-DOMString-encoding-optional-unsigned-long-long-maxSize"><code>readAsText</code></dt><dd>
<p>
- This method should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#readAsTextSync"><code>FileReader.readAsText()</code></a>. [<cite><a href="#bib-FILE-API" rel="biblioentry" class="bibref">FILE-API</a></cite>]
+ This method should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#readAsTextSync"><code>FileReader.readAsText()</code></a>. [<cite><a href="#bib-FILE-API" class="bibref">FILE-API</a></cite>]
The only addition is the addition of a <code>maxSize</code> parameter that affects the amount of the amount of bytes to read from the <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>.
</p>
-
- <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">stream</td><td class="prmType"><code><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The Stream to be read</td></tr><tr><td class="prmName">encoding</td><td class="prmType"><code><a>DOMString</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptTrue">✔</td><td class="prmDesc">The encoding format</td></tr><tr><td class="prmName">maxSize</td><td class="prmType"><code><a>unsigned long long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptTrue">✔</td><td class="prmDesc">The maximum number of bytes to be read before completion</td></tr></table><table class="exceptions"><tr><th>Exception</th><th>Description</th></tr><tr><td class="excName"><a>StreamException</a></td><td class="excDesc"><table class="exceptionCodes"><tr><td class="excCodeName"><code></code></td><td class="excCodeDesc"></td></tr></table></td></tr></table><div><em>Return type: </em><code><a>DOMString</a></code></div></dd></dl></div>
-</div>
+ <dl class="exception" title="StreamException">
+ <dt></dt>
+ <dd></dd>
+ </dl>
+ <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">stream</td><td class="prmType"><code><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The Stream to be read</td></tr><tr><td class="prmName">encoding</td><td class="prmType"><code><a>DOMString</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptTrue">✔</td><td class="prmDesc">The encoding format</td></tr><tr><td class="prmName">maxSize</td><td class="prmType"><code><a>optional unsigned long long</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptTrue">✔</td><td class="prmDesc">The maximum number of bytes to be read before completion</td></tr></table><div><em>Return type: </em><code><a>DOMString</a></code></div></dd></dl></section>
+</section>
-<div class="section" id="reading-empty-stream">
+<section class="section" id="reading-empty-stream">
<!--OddPage--><h2><span class="secno">5. </span>Determining an empty Stream</h2>
<p>
StreamReader will read a Stream until maxSize has been reached or the
@@ -763,26 +1112,26 @@
</dl>
<p></p>
-</div>
+</section>
-<div class="section" id="errors-and-exceptions">
+<section class="section" id="errors-and-exceptions">
<!--OddPage--><h2><span class="secno">6. </span>Errors and Exceptions</h2>
- <div class="section" id="streamerror-error">
+ <section class="section" id="streamerror-error">
<h3><span class="secno">6.1 </span>StreamError</h3>
<p>
This interface should mimic the <a href="http://dev.w3.org/2006/webapi/FileAPI/#FileErrorInterface"><code>FileError</code> Interface</a>, and contain the same error codes.
</p>
- </div>
+ </section>
- <div class="section" id="streamexception-error">
+ <section class="section" id="streamexception-error">
<h3><span class="secno">6.2 </span>StreamException</h3>
<p>
This interface should mimic the <a href="http://dev.w3.org/2006/webapi/FileAPI/#FileException"><code>FileException</code> Interface</a>, , and contain the same error codes.
</p>
- </div>
-</div>
+ </section>
+</section>
-<div class="section" id="streambuilder-interface">
+<section class="section" id="streambuilder-interface">
<!--OddPage--><h2><span class="secno">7. </span>The StreamBuilder Interface</h2>
<p>
The <a class="idlType" href="#idl-def-StreamBuilder"><code>StreamBuilder</code></a> interface provides a way for developers to create a <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> by appending data. During a read on the <code>stream</code> from a <a class="idlType" href="#idl-def-StreamBuilder"><code>StreamBuilder</code></a>, the data is read 'First in, First out',
@@ -799,43 +1148,51 @@
</p>
<pre class="idl"><span class="idlInterface" id="idl-def-StreamBuilder">[<span class="extAttr">Constructor, Constructor(DOMString contentType, optional int thresholdLimit)</span>]
interface <span class="idlInterfaceID">StreamBuilder</span> : <span class="idlSuperclass"><a>EventTarget</a></span> {
-<span class="idlMethod"> <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-StreamBuilder-append-void-String-data">append</a></span> (<span class="idlParam"><span class="idlParamType"><a>String</a></span> <span class="idlParamName">data</span></span>) raises (<span class="idlRaises"><a>OperationNotAllowedException</a></span>);</span>
-<span class="idlMethod"> <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-StreamBuilder-append-void-Blob-data">append</a></span> (<span class="idlParam"><span class="idlParamType"><a>Blob</a></span> <span class="idlParamName">data</span></span>) raises (<span class="idlRaises"><a>OperationNotAllowedException</a></span>);</span>
-<span class="idlMethod"> <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-StreamBuilder-append-void-ArrayBuffer-data">append</a></span> (<span class="idlParam"><span class="idlParamType"><a>ArrayBuffer</a></span> <span class="idlParamName">data</span></span>) raises (<span class="idlRaises"><a>OperationNotAllowedException</a></span>);</span>
+<span class="idlMethod"> <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-StreamBuilder-append-void-String-data">append</a></span> (<span class="idlParam"><span class="idlParamType"><a>String</a></span> <span class="idlParamName">data</span></span>);</span>
+<span class="idlMethod"> <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-StreamBuilder-append-void-Blob-data">append</a></span> (<span class="idlParam"><span class="idlParamType"><a>Blob</a></span> <span class="idlParamName">data</span></span>);</span>
+<span class="idlMethod"> <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-StreamBuilder-append-void-ArrayBuffer-data">append</a></span> (<span class="idlParam"><span class="idlParamType"><a>ArrayBuffer</a></span> <span class="idlParamName">data</span></span>);</span>
<span class="idlMethod"> <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-StreamBuilder-close-void">close</a></span> ();</span>
<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></span> <span class="idlAttrName"><a href="#widl-StreamBuilder-stream">stream</a></span>;</span>
<span class="idlAttribute"> readonly attribute <span class="idlAttrType"><a>unsigned long long</a></span> <span class="idlAttrName"><a href="#widl-StreamBuilder-availableDataSize">availableDataSize</a></span>;</span>
<span class="idlAttribute"> attribute <span class="idlAttrType"><a>Function</a></span> <span class="idlAttrName"><a href="#widl-StreamBuilder-onthresholdreached">onthresholdreached</a></span>;</span>
-};</span>
-</pre><div class="section" id="attributes-2"><h3><span class="secno">7.1 </span>Attributes</h3><dl class="attributes"><dt id="widl-StreamBuilder-availableDataSize"><code>availableDataSize</code> of type <span class="idlAttrType"><a>unsigned long long</a></span>, readonly</dt><dd>The number of bytes of data available for read from the <a>stream</a><div><em>No exceptions.</em></div></dd><dt id="widl-StreamBuilder-onthresholdreached"><code>onthresholdreached</code> of type <span class="idlAttrType"><a>Function</a></span></dt><dd>
+};</span></pre><section id="attributes-2"><h3><span class="secno">7.1 </span>Attributes</h3><dl class="attributes"><dt id="widl-StreamBuilder-availableDataSize"><code>availableDataSize</code> of type <span class="idlAttrType"><a>unsigned long long</a></span>, readonly</dt><dd>The number of bytes of data available for read from the <a>stream</a></dd><dt id="widl-StreamBuilder-onthresholdreached"><code>onthresholdreached</code> of type <span class="idlAttrType"><a>Function</a></span></dt><dd>
Handler for <a href="#dfn-thresholdreached-event"><code>thresholdreached</code></a> events.
- <div><em>No exceptions.</em></div></dd><dt id="widl-StreamBuilder-stream"><code>stream</code> of type <span class="idlAttrType"><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></span>, readonly</dt><dd>Returns the underlying <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> represented by the <a class="idlType" href="#idl-def-StreamBuilder"><code>StreamBuilder</code></a>.<div><em>No exceptions.</em></div></dd></dl></div><div class="section" id="methods-2"><h3><span class="secno">7.2 </span>Methods</h3><dl class="methods"><dt id="widl-StreamBuilder-append-void-String-data"><code>append</code></dt><dd>
+ </dd><dt id="widl-StreamBuilder-stream"><code>stream</code> of type <span class="idlAttrType"><a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></span>, readonly</dt><dd>Returns the underlying <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> represented by the <a class="idlType" href="#idl-def-StreamBuilder"><code>StreamBuilder</code></a>.</dd></dl></section><section id="methods-3"><h3><span class="secno">7.2 </span>Methods</h3><dl class="methods"><dt id="widl-StreamBuilder-append-void-String-data"><code>append</code></dt><dd>
<p></p>
<p>
Appends the supplied text to the data available for the <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>, writing it as UTF-8.
</p>
<p></p>
-
- <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">data</td><td class="prmType"><code><a>String</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The data to append</td></tr></table><table class="exceptions"><tr><th>Exception</th><th>Description</th></tr><tr><td class="excName"><a>OperationNotAllowedException</a></td><td class="excDesc"><table class="exceptionCodes"><tr><td class="excCodeName"><code></code></td><td class="excCodeDesc">Thrown if append is called on a closed StreamBuilder</td></tr></table></td></tr></table><div><em>Return type: </em><code><a>void</a></code></div></dd><dt id="widl-StreamBuilder-append-void-Blob-data"><code>append</code></dt><dd>
+ <dl class="exception" title="OperationNotAllowedException">
+ <dt></dt>
+ <dd>Thrown if append is called on a closed StreamBuilder</dd>
+ </dl>
+ <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">data</td><td class="prmType"><code><a>String</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The data to append</td></tr></table><div><em>Return type: </em><code><a>void</a></code></div></dd><dt id="widl-StreamBuilder-append-void-Blob-data"><code>append</code></dt><dd>
<p></p>
<p>
Appends the supplied <code>Blob</code> to the data available for the <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>.
</p>
<p></p>
-
- <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">data</td><td class="prmType"><code><a>Blob</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The data to append</td></tr></table><table class="exceptions"><tr><th>Exception</th><th>Description</th></tr><tr><td class="excName"><a>OperationNotAllowedException</a></td><td class="excDesc"><table class="exceptionCodes"><tr><td class="excCodeName"><code></code></td><td class="excCodeDesc">Thrown if append is called on a closed StreamBuilder</td></tr></table></td></tr></table><div><em>Return type: </em><code><a>void</a></code></div></dd><dt id="widl-StreamBuilder-append-void-ArrayBuffer-data"><code>append</code></dt><dd>
+ <dl class="exception" title="OperationNotAllowedException">
+ <dt></dt>
+ <dd>Thrown if append is called on a closed StreamBuilder</dd>
+ </dl>
+ <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">data</td><td class="prmType"><code><a>Blob</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The data to append</td></tr></table><div><em>Return type: </em><code><a>void</a></code></div></dd><dt id="widl-StreamBuilder-append-void-ArrayBuffer-data"><code>append</code></dt><dd>
<p></p>
<p>
Appends the supplied <code>ArrayBuffer</code> to the data available for the <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>.
</p>
<p></p>
-
- <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">data</td><td class="prmType"><code><a>ArrayBuffer</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The data to append</td></tr></table><table class="exceptions"><tr><th>Exception</th><th>Description</th></tr><tr><td class="excName"><a>OperationNotAllowedException</a></td><td class="excDesc"><table class="exceptionCodes"><tr><td class="excCodeName"><code></code></td><td class="excCodeDesc">Thrown if append is called on a closed StreamBuilder</td></tr></table></td></tr></table><div><em>Return type: </em><code><a>void</a></code></div></dd><dt id="widl-StreamBuilder-close-void"><code>close</code></dt><dd>This method should close the <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>. This is done by returning on the next and subsequent reads with no data.<div><em>No parameters.</em></div><div><em>No exceptions.</em></div><div><em>Return type: </em><code><a>void</a></code></div></dd></dl></div>
+ <dl class="exception" title="OperationNotAllowedException">
+ <dt></dt>
+ <dd>Thrown if append is called on a closed StreamBuilder</dd>
+ </dl>
+ <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">data</td><td class="prmType"><code><a>ArrayBuffer</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc">The data to append</td></tr></table><div><em>Return type: </em><code><a>void</a></code></div></dd><dt id="widl-StreamBuilder-close-void"><code>close</code></dt><dd>This method should close the <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>. This is done by returning on the next and subsequent reads with no data.<div><em>No parameters.</em></div><div><em>Return type: </em><code><a>void</a></code></div></dd></dl></section>
- <div class="section" id="reads-on-a-stream-from-streambuilder">
+ <section class="section" id="reads-on-a-stream-from-streambuilder">
<h3><span class="secno">7.3 </span>Reads on a Stream from StreamBuilder</h3>
<p>
When a read on a stream from <a class="idlType" href="#idl-def-StreamBuilder"><code>StreamBuilder</code></a> is made, the following steps <em title="must" class="rfc2119">must</em> be followed:
@@ -869,9 +1226,9 @@
fire an event called <a href="#dfn-thresholdreached-event"><code>thresholdreached</code></a>.
</li>
</ol>
- </div>
+ </section>
- <div class="section" id="streambuilder-event-handler-types">
+ <section class="section" id="streambuilder-event-handler-types">
<h3><span class="secno">7.4 </span>Event Handler Attributes</h3>
<p>
The following are the event handler attributes (and their corresponding event handler event types) that user agents <em title="must" class="rfc2119">must</em> support on <a class="idlType" href="#idl-def-StreamBuilder"><code>StreamBuilder</code></a> as DOM attributes:
@@ -891,11 +1248,11 @@
</tbody>
</table>
- <div class="section" id="streambuilder-event-summary">
+ <section class="section" id="streambuilder-event-summary">
<h4><span class="secno">7.4.1 </span>Event Summary</h4>
<p>
The following are the events that are fired at <code><a class="idlType" href="#idl-def-StreamBuilder"><code>StreamBuilder</code></a></code> objects;
- <a href="http://dev.w3.org/2006/webapi/FileAPI/#fire-a-progress-event">firing events</a> is defined in DOM Level 3 Events [<cite><a href="#bib-DOM-LEVEL-3-EVENTS" rel="biblioentry" class="bibref">DOM-LEVEL-3-EVENTS</a></cite>],
+ <a href="http://dev.w3.org/2006/webapi/FileAPI/#fire-a-progress-event">firing events</a> is defined in DOM Level 3 Events [<cite><a href="#bib-DOM-LEVEL-3-EVENTS" class="bibref">DOM-LEVEL-3-EVENTS</a></cite>],
and the table below is normative for the events in this specification.
</p>
<table class="error" id="event-summary-table">
@@ -914,30 +1271,30 @@
</tr>
</tbody>
</table>
- </div>
+ </section>
- </div>
+ </section>
-</div>
+</section>
<!-- End section: The StreamBuilder Interface -->
-<div class="section" id="error-uris_for_streams">
+<section class="section" id="error-uris_for_streams">
<!--OddPage--><h2><span class="secno">8. </span>URIs for Stream</h2>
<p>
To reference a <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>, <a href="http://dev.w3.org/2006/webapi/FileAPI/#url">the same URI used</a> for <code>Blobs</code> and <code>Files</code> in
<a href="http://dev.w3.org/2006/webapi/FileAPI/#url">6.7. A URI for Blob and File reference</a> of
- the File API spec should be used. [<cite><a href="#bib-FILE-API" rel="biblioentry" class="bibref">FILE-API</a></cite>]
+ the File API spec should be used. [<cite><a href="#bib-FILE-API" class="bibref">FILE-API</a></cite>]
The definitions of <strong>Origin</strong>, <strong>Lifetime</strong>, <strong>Referencing</strong>, and <strong>Dereferencing</strong> of a <code>Blob</code> should be applied to a <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>.
</p>
- <div class="section" id="creating-revoking-streamuri">
+ <section class="section" id="creating-revoking-streamuri">
<h3><span class="secno">8.1 </span>Creating and Revoking a Stream URI</h3>
<p>
A <dfn id="stream-uri">Stream URI</dfn> is a <code>Blob URI</code> that is referencing a <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>.
These URIs are created and revoked using methods exposed on the URL object,
as defined in <a href="http://dev.w3.org/2006/webapi/FileAPI/#creating-revoking">6.7.5. Creating and Revoking a Blob URI</a>
- of the File API spec. [<cite><a href="#bib-FILE-API" rel="biblioentry" class="bibref">FILE-API</a></cite>]
+ of the File API spec. [<cite><a href="#bib-FILE-API" class="bibref">FILE-API</a></cite>]
</p>
<p>
<a href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-createObjectURL">URL.createObjectURL</a>
@@ -945,10 +1302,9 @@
should both be extended as follows:
</p>
<pre class="idl"><span class="idlInterface" id="idl-def-URL">interface <span class="idlInterfaceID">URL</span> {
-<span class="idlMethod"> <span class="idlMethType"><a>static DOMString</a></span> <span class="idlMethName"><a href="#widl-URL-createObjectURL-static-DOMString-any-object">createObjectURL</a></span> (<span class="idlParam"><span class="idlParamType"><a>any</a></span> <span class="idlParamName">object</span></span>);</span>
-<span class="idlMethod"> <span class="idlMethType"><a>static void</a></span> <span class="idlMethName"><a href="#widl-URL-revokeObjectURL-static-void-DOMString-url">revokeObjectURL</a></span> (<span class="idlParam"><span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">url</span></span>);</span>
-};</span>
-</pre><div class="section" id="methods-3"><h4><span class="secno">8.1.1 </span>Methods</h4><dl class="methods"><dt id="widl-URL-createObjectURL-static-DOMString-any-object"><code>createObjectURL</code></dt><dd>
+<span class="idlMethod"> static <span class="idlMethType"><a>DOMString</a></span> <span class="idlMethName"><a href="#widl-URL-createObjectURL-DOMString-any-object">createObjectURL</a></span> (<span class="idlParam"><span class="idlParamType"><a>any</a></span> <span class="idlParamName">object</span></span>);</span>
+<span class="idlMethod"> static <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-URL-revokeObjectURL-void-DOMString-url">revokeObjectURL</a></span> (<span class="idlParam"><span class="idlParamType"><a>DOMString</a></span> <span class="idlParamName">url</span></span>);</span>
+};</span></pre><section id="methods-4"><h4><span class="secno">8.1.1 </span>Methods</h4><dl class="methods"><dt id="widl-URL-createObjectURL-DOMString-any-object"><code>createObjectURL</code>, static</dt><dd>
<p></p>
<p>The extension onto <code>createObjectURL</code> should have the following steps added.</p>
<ol>
@@ -960,7 +1316,7 @@
user agents <em title="must" class="rfc2119">must</em> return a unique <code>Blob URI</code> that can be used to dereference the <code>blob</code> or <code>stream</code> argument.
</li>
</ol>
- <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">object</td><td class="prmType"><code><a>any</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr></table><div><em>No exceptions.</em></div><div><em>Return type: </em><code><a>static DOMString</a></code></div></dd><dt id="widl-URL-revokeObjectURL-static-void-DOMString-url"><code>revokeObjectURL</code></dt><dd>
+ <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">object</td><td class="prmType"><code><a>any</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr></table><div><em>Return type: </em><code><a>DOMString</a></code></div></dd><dt id="widl-URL-revokeObjectURL-void-DOMString-url"><code>revokeObjectURL</code>, static</dt><dd>
<p></p>
<p>
The extension onto <code>revokeObjectURL</code> should have the following steps added.
@@ -978,37 +1334,37 @@
User agents <em title="may" class="rfc2119">may</em> display a message on their error console.
</li>
</ol>
- <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">url</td><td class="prmType"><code><a>DOMString</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr></table><div><em>No exceptions.</em></div><div><em>Return type: </em><code><a>static void</a></code></div></dd></dl></div>
- </div>
-</div>
+ <table class="parameters"><tr><th>Parameter</th><th>Type</th><th>Nullable</th><th>Optional</th><th>Description</th></tr><tr><td class="prmName">url</td><td class="prmType"><code><a>DOMString</a></code></td><td class="prmNullFalse">✘</td><td class="prmOptFalse">✘</td><td class="prmDesc"></td></tr></table><div><em>Return type: </em><code><a>void</a></code></div></dd></dl></section>
+ </section>
+</section>
-<div class="section" id="security">
+<section class="section" id="security">
<!--OddPage--><h2><span class="secno">9. </span>Security Considerations</h2>
<p>
A <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> should have the same security considerations as a <code>Blob</code>.
This is outlined in <a href="http://dev.w3.org/2006/webapi/FileAPI/#security-discussion">6.8. Security Considerations</a>
- of the File API specification. [<cite><a href="#bib-FILE-API" rel="biblioentry" class="bibref">FILE-API</a></cite>]
+ of the File API specification. [<cite><a href="#bib-FILE-API" class="bibref">FILE-API</a></cite>]
Because a <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> uses a <code>Blob URI</code>, cross origin requests on a <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> will not be supported.
</p>
-</div>
+</section>
-<div class="section" id="XMLHttpRequest">
+<section class="section" id="XMLHttpRequest">
<!--OddPage--><h2><span class="secno">10. </span>Extension of XMLHttpRequest</h2>
<p>
- This specification proposes an extension to <code>XMLHttpRequest</code> [<cite><a href="#bib-XMLHTTPREQUEST2" rel="biblioentry" class="bibref">XMLHTTPREQUEST2</a></cite>] to add support for <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>.
+ This specification proposes an extension to <code>XMLHttpRequest</code> [<cite><a href="#bib-XMLHTTPREQUEST2" class="bibref">XMLHTTPREQUEST2</a></cite>] to add support for <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>. This section is temporary and is meant to provide a recommendation for how <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> should be incorporated into <code>XMLHttpRequest</code>.
This will extend <code>XMLHttpRequest</code> to allow for receiving and uploading of a <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>.
One such scenario is providing access to data during <a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#dom-xmlhttprequest-readystate"><code>readyState</code></a> 3 (loading).
The sections below document in detail what extensions must be done to <code>XMLHttpRequest</code> to support <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a>.
</p>
- <div id="addition-of-stream-responsetype" class="section" title="addition-of-stream">
+ <section id="addition-of-stream-responsetype" class="section" title="addition-of-stream">
<h3><span class="secno">10.1 </span>Addition of stream responseType</h3>
<p>
A responseType of ‘<code>stream</code>’ should be introduced to <code>XMLHttpRequest</code>.
</p>
<p>
<a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-responsetype-attribute">Section 4.7.7 the <code>responseType</code> attribute</a>
- in XMLHttpRequest Level 2 [<cite><a href="#bib-XMLHTTPREQUEST2" rel="biblioentry" class="bibref">XMLHTTPREQUEST2</a></cite>] should now read:
+ in XMLHttpRequest Level 2 [<cite><a href="#bib-XMLHTTPREQUEST2" class="bibref">XMLHTTPREQUEST2</a></cite>] should now read:
</p>
<p>
On setting the <code>responseType</code> attribute these steps must be run:
@@ -1029,7 +1385,7 @@
<p>
<a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-response-attribute">Section 4.7.8 the <code>response</code> attribute</a>
- in XMLHttpRequest Level 2 [<cite><a href="#bib-XMLHTTPREQUEST2" rel="biblioentry" class="bibref">XMLHTTPREQUEST2</a></cite>] should now read:
+ in XMLHttpRequest Level 2 [<cite><a href="#bib-XMLHTTPREQUEST2" class="bibref">XMLHTTPREQUEST2</a></cite>] should now read:
</p>
<p>
The <code>response</code> attribute must return the result of running these steps:
@@ -1065,7 +1421,7 @@
If the error flag is true return null and terminate these steps.
</li>
<li>
- Return the stream response entity body.
+ Return the <a href="#stream-response-entity">stream response entity body</a>.
</li>
</ol>
</dd>
@@ -1095,9 +1451,9 @@
</dd>
</dl>
- </div>
+ </section>
- <div class="section" id="readystate3-changes">
+ <section class="section" id="readystate3-changes">
<h3><span class="secno">10.2 </span>readyState 3 changes</h3>
<p>
A <code>stream</code> is binary data obtained sequentially over time.
@@ -1105,7 +1461,7 @@
</p>
<p>
<a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#response-entity-body0">Section 4.7.5 Response Entity Body</a>
- in XMLHttpRequest Level 2 [<cite><a href="#bib-XMLHTTPREQUEST2" rel="biblioentry" class="bibref">XMLHTTPREQUEST2</a></cite>] should have the following additions:
+ in XMLHttpRequest Level 2 [<cite><a href="#bib-XMLHTTPREQUEST2" class="bibref">XMLHTTPREQUEST2</a></cite>] should have the following additions:
</p>
<p>
The <dfn id="stream-response-entity">stream response entity body</dfn> is a <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> representing the <a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#response-entity-body">response entity body</a>.
@@ -1121,13 +1477,13 @@
<a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#response-entity-body">response entity body</a>.
</li>
</ol>
- </div>
+ </section>
- <div class="section" clas="section" id="send0">
+ <section clas="section" id="send0">
<h3><span class="secno">10.3 </span>send()</h3>
<p>
<a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-send-method">Section 4.6.6 The <code>send()</code> method</a>
- in XMLHttpRequest Level 2 [<cite><a href="#bib-XMLHTTPREQUEST2" rel="biblioentry" class="bibref">XMLHTTPREQUEST2</a></cite>] should have the following additions:
+ in XMLHttpRequest Level 2 [<cite><a href="#bib-XMLHTTPREQUEST2" class="bibref">XMLHTTPREQUEST2</a></cite>] should have the following additions:
</p>
<dl class="switch">
<dt>If data is a <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a></dt>
@@ -1141,11 +1497,11 @@
</dd>
</dl>
- </div>
+ </section>
-</div>
+</section>
-<div class="section" id="requirements">
+<section class="section" id="requirements">
<!--OddPage--><h2><span class="secno">11. </span>Requirements and Use Cases</h2>
<p>
The <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> type allows for completion of several end-to-end experiences. This section covers what the requirements are for this API, and
@@ -1164,7 +1520,7 @@
</p>
</li>
<li>
- Begin processing data with <a class="idlType" href="#idl-def-StreamBuilder"><code>StreamBuilder</code></a> as it is being read via <code>XMLHttpRequest</code>
+ Begin processing data with <a class="idlType" href="#idl-def-StreamReader"><code>StreamReader</code></a> as it is being read via <code>XMLHttpRequest</code>
<p>
If a file format is understood, then an application can make sense
of the data as it being made available. For example, a given
@@ -1185,101 +1541,36 @@
</p>
</li>
+ <li>
+ Media streaming scenarios using <a class="idlType" href="#idl-def-Stream"><code>Stream</code></a> and <code>XMLHttpRequest</code>
+ <p>
+ Media streaming scenarios require the ability to quickly receive
+data over the network and connect it to a media element. An application
+can successfully accomplish this by receiving a Stream in <code>readyState</code>
+ 3 and assign it to a media element. This helps avoid the application
+from having to buffer the data prior to assigning it to a media element.
+ </p>
+ </li>
</ul>
-</div>
+</section>
-<div id="acknowledgements" class="appendix section">
+<section id="acknowledgements" class="appendix">
<!--OddPage--><h2><span class="secno">A. </span>Acknowledgements</h2>
<p>
Thanks to Eliot Graff for editorial assistance.
- Special thanks to the <acronym title="World Wide Web Consortium">W3C</acronym>.
+ Special thanks to the <abbr title="World Wide Web Consortium">W3C</abbr>.
</p>
-</div>
+</section>
- <div class="appendix section" id="references">
- <h2><span class="secno">B. </span>References</h2>
- <div class="section" id="normative-references">
- <h3><span class="secno">B.1 </span>Normative references</h3>
- <dl class="bibliography">
- <dt id="bib-DOM-LEVEL-3-EVENTS">[DOM-LEVEL-3-EVENTS]</dt>
- <dd>
- Björn Höhrmann; Tom Pixley; Philippe Le Hégaret.
- <a href="http://www.w3.org/TR/2011/WD-DOM-Level-3-Events-20110531/"><cite>Document Object Model (DOM) Level 3 Events Specification.</cite></a>
- 31 May 2011. W3C Working Draft. (Work in progress.)
- URL: <a href="http://www.w3.org/TR/2011/WD-DOM-Level-3-Events-20110531/">http://www.w3.org/TR/2011/WD-DOM-Level-3-Events-20110531/</a>
- </dd>
-
- <dt id="bib-FILE-API">[FILE-API]</dt>
- <dd>
- Arun Ranganathan.
- <a href="http://www.w3.org/TR/2009/WD-FileAPI-20091117/"><cite>File API.</cite></a>
- 17 November 2009. W3C Working Draft. (Work in progress.)
- URL: <a href="http://www.w3.org/TR/2009/WD-FileAPI-20091117/">http://www.w3.org/TR/2009/WD-FileAPI-20091117/</a>
- </dd>
-
- <dt id="bib-HTML5">[HTML5]</dt>
- <dd>
- Ian Hickson; David Hyatt.
- <a href="http://www.w3.org/TR/html5"><cite>HTML5.</cite></a>
- 25 May 2011. W3C Working Draft. (Work in progress.)
- URL: <a href="http://www.w3.org/TR/html5">http://www.w3.org/TR/html5</a>
- </dd>
-
- <dt id="bib-HTTP11">[HTTP11]</dt>
- <dd>
- R. Fielding; et al.
- <a href="http://www.ietf.org/rfc/rfc2616.txt"><cite>Hypertext Transfer Protocol - HTTP/1.1.</cite></a>
- June 1999. Internet RFC 2616.
- URL: <a href="http://www.ietf.org/rfc/rfc2616.txt">http://www.ietf.org/rfc/rfc2616.txt</a>
- </dd>
-
- <dt id="bib-RFC2046">[RFC2046]</dt>
- <dd>
- N. Freed; N. Borenstein.
- <a href="http://www.ietf.org/rfc/rfc2046.txt"><cite>Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types.</cite></a>
- November 1996. Internet RFC 2046.
- URL: <a href="http://www.ietf.org/rfc/rfc2046.txt">http://www.ietf.org/rfc/rfc2046.txt</a>
- </dd>
-
- <dt id="bib-RFC2397">[RFC2397]</dt>
- <dd>
- L. Masinter.
- <a href="http://www.ietf.org/rfc/rfc2397.txt"><cite>The "data" URL scheme.</cite></a> August 1998. Internet RFC 2397.
- URL: <a href="http://www.ietf.org/rfc/rfc2397.txt">http://www.ietf.org/rfc/rfc2397.txt</a>
- </dd>
-
- <dt id="bib-WEBWORKERS">[WEBWORKERS]</dt>
- <dd>
- Ian Hickson.
- <a href="http://www.w3.org/TR/2011/WD-workers-20110310/"><cite>Web Workers.</cite></a>
- 10 March 2011. W3C Working Draft. (Work in progress.)
- URL: <a href="http://www.w3.org/TR/2011/WD-workers-20110310/">http://www.w3.org/TR/2011/WD-workers-20110310/</a>
- </dd>
-
- <dt id="bib-XMLHTTPREQUEST2">[XMLHTTPREQUEST2]</dt>
- <dd>
- Anne van Kesteren.
- <a href="http://www.w3.org/TR/2008/WD-XMLHttpRequest2-20080930"><cite>XMLHttpRequest Level 2.</cite></a>
- 30 September 2008. W3C Working Draft. (Work in progress.)
- URL: <a href="http://www.w3.org/TR/2008/WD-XMLHttpRequest2-20080930">http://www.w3.org/TR/2008/WD-XMLHttpRequest2-20080930</a>
- </dd>
- </dl>
- </div>
-
- <div class="section" id="informative-references">
- <h3><span class="secno">B.2 </span>Informative references</h3>
- <p>No informative references.</p>
- </div>
-</div>
-
-</body>
-</html>
-
-
-
-
-
-
+<section class="appendix" id="references"><!--OddPage--><h2><span class="secno">B. </span>References</h2><section id="normative-references"><h3><span class="secno">B.1 </span>Normative references</h3><dl class="bibliography"><dt id="bib-DOM-LEVEL-3-EVENTS">[DOM-LEVEL-3-EVENTS]</dt><dd>Björn Höhrmann; Tom Pixley; Philippe Le Hégaret. <a href="http://www.w3.org/TR/2011/WD-DOM-Level-3-Events-20110531/"><cite>Document Object Model (DOM) Level 3 Events Specification.</cite></a> 31 May 2011. W3C Working Draft. (Work in progress.) URL: <a href="http://www.w3.org/TR/2011/WD-DOM-Level-3-Events-20110531/">http://www.w3.org/TR/2011/WD-DOM-Level-3-Events-20110531/</a>
+</dd><dt id="bib-FILE-API">[FILE-API]</dt><dd>Arun Ranganathan; Jonas Sicking. <a href="http://www.w3.org/TR/2011/WD-FileAPI-20111020/"><cite>File API.</cite></a> 20 October 2011. W3C Working Draft. (Work in progress.) URL: <a href="http://www.w3.org/TR/2011/WD-FileAPI-20111020/">http://www.w3.org/TR/2011/WD-FileAPI-20111020/</a>
+</dd><dt id="bib-HTML5">[HTML5]</dt><dd>Ian Hickson; David Hyatt. <a href="http://www.w3.org/TR/html5"><cite>HTML5.</cite></a> 29 March 2012. W3C Working Draft. (Work in progress.) URL: <a href="http://www.w3.org/TR/html5">http://www.w3.org/TR/html5</a>
+</dd><dt id="bib-HTTP11">[HTTP11]</dt><dd>R. Fielding; et al. <a href="http://www.ietf.org/rfc/rfc2616.txt"><cite>Hypertext Transfer Protocol - HTTP/1.1.</cite></a> June 1999. Internet RFC 2616. URL: <a href="http://www.ietf.org/rfc/rfc2616.txt">http://www.ietf.org/rfc/rfc2616.txt</a>
+</dd><dt id="bib-RFC2046">[RFC2046]</dt><dd>N. Freed; N. Borenstein. <a href="http://www.ietf.org/rfc/rfc2046.txt"><cite>Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types.</cite></a> November 1996. Internet RFC 2046. URL: <a href="http://www.ietf.org/rfc/rfc2046.txt">http://www.ietf.org/rfc/rfc2046.txt</a>
+</dd><dt id="bib-RFC2397">[RFC2397]</dt><dd>L. Masinter. <a href="http://www.ietf.org/rfc/rfc2397.txt"><cite>The "data" URL scheme.</cite></a> August 1998. Internet RFC 2397. URL: <a href="http://www.ietf.org/rfc/rfc2397.txt">http://www.ietf.org/rfc/rfc2397.txt</a>
+</dd><dt id="bib-WEBWORKERS">[WEBWORKERS]</dt><dd>Ian Hickson. <a href="http://www.w3.org/TR/2011/WD-workers-20110901/"><cite>Web Workers.</cite></a> 1 September 2011. W3C Working Draft. (Work in progress.) URL: <a href="http://www.w3.org/TR/2011/WD-workers-20110901/">http://www.w3.org/TR/2011/WD-workers-20110901/</a>
+</dd><dt id="bib-XMLHTTPREQUEST2">[XMLHTTPREQUEST2]</dt><dd>Anne van Kesteren. <a href="http://www.w3.org/TR/2008/WD-XMLHttpRequest2-20080930"><cite>XMLHttpRequest Level 2.</cite></a> 30 September 2008. W3C Working Draft. (Work in progress.) URL: <a href="http://www.w3.org/TR/2008/WD-XMLHttpRequest2-20080930">http://www.w3.org/TR/2008/WD-XMLHttpRequest2-20080930</a>
+</dd></dl></section></section></body></html>
\ No newline at end of file