Streams-API-pubready.html
author Art Barstow <art.barstow@gmail.com>
Tue, 21 Oct 2014 10:27:36 -0400
changeset 167 279185b12a8b
parent 14 b311630ca063
permissions -rw-r--r--
WD snapshot for 2014 Oct 23
11
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
     1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
     2
<!-- saved from url=(0040) -->
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
     3
<html lang="en" dir="ltr"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
     4
	<title>Streams API</title>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
     5
	
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
     6
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
     7
<!--	<script class=remove src="http://dev.w3.org/2009/dap/ReSpec.js/js/respec.js"></script> -->
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
     8
	
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
     9
	<style type="text/css"></style>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    10
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    11
	
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    12
	
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    13
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    14
	<meta name="GENERATOR" content="MSHTML 8.00.7600.16588">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    15
	
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    16
	<!-- Styles to mimic File API spec -->
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    17
	<style type="text/css">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    18
		table.error { border-collapse:collapse; border-style:hidden hidden none hidden }
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    19
		table.error thead { border-bottom:solid }
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    20
		table.error tbody th:first-child { border-left:solid }
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    21
		table.error td, table th { border-left:solid; border-right:solid; border-bottom:solid thin; vertical-align:top; padding:0.2em }
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    22
	</style>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    23
	
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    24
<style>/*****************************************************************
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    25
 * ReSpec 3 CSS
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    26
 * Robin Berjon - http://berjon.com/
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    27
 *****************************************************************/
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    28
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    29
/* --- INLINES --- */
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    30
em.rfc2119 { 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    31
    text-transform:     lowercase;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    32
    font-variant:       small-caps;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    33
    font-style:         normal;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    34
    color:              #900;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    35
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    36
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    37
h1 acronym, h2 acronym, h3 acronym, h4 acronym, h5 acronym, h6 acronym, a acronym,
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    38
h1 abbr, h2 abbr, h3 abbr, h4 abbr, h5 abbr, h6 abbr, a abbr {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    39
    border: none;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    40
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    41
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    42
dfn {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    43
    font-weight:    bold;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    44
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    45
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    46
a.internalDFN {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    47
    color:  inherit;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    48
    border-bottom:  1px solid #99c;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    49
    text-decoration:    none;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    50
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    51
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    52
a.externalDFN {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    53
    color:  inherit;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    54
    border-bottom:  1px dotted #ccc;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    55
    text-decoration:    none;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    56
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    57
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    58
a.bibref {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    59
    text-decoration:    none;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    60
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    61
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    62
cite .bibref {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    63
    font-style: normal;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    64
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    65
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    66
code {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    67
    color:  #ff4500;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    68
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    69
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    70
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    71
/* --- --- */
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    72
ol.algorithm { counter-reset:numsection; list-style-type: none; }
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    73
ol.algorithm li { margin: 0.5em 0; }
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    74
ol.algorithm li:before { font-weight: bold; counter-increment: numsection; content: counters(numsection, ".") ") "; }
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    75
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    76
/* --- TOC --- */
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    77
.toc a, .tof a {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    78
    text-decoration:    none;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    79
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    80
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    81
a .secno, a .figno {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    82
    color:  #000;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    83
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    84
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    85
ul.tof, ol.tof {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    86
    list-style: none outside none;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    87
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    88
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    89
.caption {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    90
    margin-top: 0.5em;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    91
    font-style:   italic;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    92
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    93
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    94
/* --- TABLE --- */
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    95
table.simple {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    96
    border-spacing: 0;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    97
    border-collapse:    collapse;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    98
    border-bottom:  3px solid #005a9c;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
    99
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   100
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   101
.simple th {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   102
    background: #005a9c;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   103
    color:  #fff;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   104
    padding:    3px 5px;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   105
    text-align: left;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   106
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   107
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   108
.simple th[scope="row"] {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   109
    background: inherit;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   110
    color:  inherit;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   111
    border-top: 1px solid #ddd;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   112
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   113
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   114
.simple td {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   115
    padding:    3px 10px;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   116
    border-top: 1px solid #ddd;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   117
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   118
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   119
.simple tr:nth-child(even) {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   120
    background: #f0f6ff;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   121
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   122
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   123
/* --- DL --- */
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   124
.section dd > p:first-child {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   125
    margin-top: 0;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   126
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   127
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   128
.section dd > p:last-child {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   129
    margin-bottom: 0;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   130
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   131
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   132
.section dd {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   133
    margin-bottom:  1em;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   134
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   135
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   136
.section dl.attrs dd, .section dl.eldef dd {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   137
    margin-bottom:  0;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   138
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   139
</style><style>/* --- EXAMPLES --- */
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   140
div.example-title {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   141
    min-width: 7.5em;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   142
    color: #b9ab2d;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   143
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   144
div.example-title span {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   145
    text-transform: uppercase;   
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   146
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   147
aside.example, div.example, div.illegal-example {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   148
    padding: 0.5em;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   149
    margin: 1em 0;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   150
    position: relative;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   151
    clear: both;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   152
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   153
div.illegal-example { color: red }
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   154
div.illegal-example p { color: black }
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   155
aside.example, div.example {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   156
    padding: .5em;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   157
    border-left-width: .5em;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   158
    border-left-style: solid;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   159
    border-color: #e0cb52;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   160
    background: #fcfaee;    
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   161
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   162
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   163
aside.example div.example {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   164
    border-left-width: .1em;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   165
    border-color: #999;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   166
    background: #fff;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   167
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   168
aside.example div.example div.example-title {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   169
    color: #999;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   170
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   171
</style><style>/* --- WEB IDL --- */
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   172
pre.idl {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   173
    border-top: 1px solid #90b8de;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   174
    border-bottom: 1px solid #90b8de;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   175
    padding:    1em;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   176
    line-height:    120%;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   177
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   178
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   179
pre.idl::before {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   180
    content:    "WebIDL";
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   181
    display:    block;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   182
    width:      150px;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   183
    background: #90b8de;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   184
    color:  #fff;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   185
    font-family:    initial;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   186
    padding:    3px;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   187
    font-weight:    bold;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   188
    margin: -1em 0 1em -1em;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   189
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   190
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   191
.idlType {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   192
    color:  #ff4500;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   193
    font-weight:    bold;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   194
    text-decoration:    none;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   195
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   196
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   197
/*.idlModule*/
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   198
/*.idlModuleID*/
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   199
/*.idlInterface*/
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   200
.idlInterfaceID, .idlDictionaryID, .idlCallbackID, .idlEnumID {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   201
    font-weight:    bold;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   202
    color:  #005a9c;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   203
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   204
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   205
.idlSuperclass {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   206
    font-style: italic;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   207
    color:  #005a9c;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   208
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   209
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   210
/*.idlAttribute*/
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   211
.idlAttrType, .idlFieldType, .idlMemberType {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   212
    color:  #005a9c;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   213
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   214
.idlAttrName, .idlFieldName, .idlMemberName {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   215
    color:  #ff4500;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   216
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   217
.idlAttrName a, .idlFieldName a, .idlMemberName a {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   218
    color:  #ff4500;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   219
    border-bottom:  1px dotted #ff4500;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   220
    text-decoration: none;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   221
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   222
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   223
/*.idlMethod*/
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   224
.idlMethType, .idlCallbackType {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   225
    color:  #005a9c;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   226
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   227
.idlMethName {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   228
    color:  #ff4500;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   229
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   230
.idlMethName a {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   231
    color:  #ff4500;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   232
    border-bottom:  1px dotted #ff4500;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   233
    text-decoration: none;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   234
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   235
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   236
/*.idlParam*/
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   237
.idlParamType {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   238
    color:  #005a9c;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   239
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   240
.idlParamName, .idlDefaultValue {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   241
    font-style: italic;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   242
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   243
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   244
.extAttr {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   245
    color:  #666;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   246
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   247
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   248
/*.idlConst*/
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   249
.idlConstType {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   250
    color:  #005a9c;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   251
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   252
.idlConstName {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   253
    color:  #ff4500;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   254
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   255
.idlConstName a {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   256
    color:  #ff4500;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   257
    border-bottom:  1px dotted #ff4500;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   258
    text-decoration: none;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   259
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   260
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   261
/*.idlException*/
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   262
.idlExceptionID {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   263
    font-weight:    bold;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   264
    color:  #c00;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   265
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   266
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   267
.idlTypedefID, .idlTypedefType {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   268
    color:  #005a9c;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   269
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   270
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   271
.idlRaises, .idlRaises a.idlType, .idlRaises a.idlType code, .excName a, .excName a code {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   272
    color:  #c00;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   273
    font-weight:    normal;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   274
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   275
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   276
.excName a {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   277
    font-family:    monospace;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   278
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   279
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   280
.idlRaises a.idlType, .excName a.idlType {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   281
    border-bottom:  1px dotted #c00;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   282
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   283
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   284
.excGetSetTrue, .excGetSetFalse, .prmNullTrue, .prmNullFalse, .prmOptTrue, .prmOptFalse {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   285
    width:  45px;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   286
    text-align: center;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   287
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   288
.excGetSetTrue, .prmNullTrue, .prmOptTrue { color:  #0c0; }
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   289
.excGetSetFalse, .prmNullFalse, .prmOptFalse { color:  #c00; }
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   290
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   291
.idlImplements a {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   292
    font-weight:    bold;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   293
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   294
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   295
dl.attributes, dl.methods, dl.constants, dl.fields, dl.dictionary-members {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   296
    margin-left:    2em;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   297
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   298
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   299
.attributes dt, .methods dt, .constants dt, .fields dt, .dictionary-members dt {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   300
    font-weight:    normal;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   301
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   302
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   303
.attributes dt code, .methods dt code, .constants dt code, .fields dt code, .dictionary-members dt code {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   304
    font-weight:    bold;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   305
    color:  #000;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   306
    font-family:    monospace;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   307
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   308
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   309
.attributes dt code, .fields dt code, .dictionary-members dt code {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   310
    background:  #ffffd2;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   311
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   312
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   313
.attributes dt .idlAttrType code, .fields dt .idlFieldType code, .dictionary-members dt .idlMemberType code {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   314
    color:  #005a9c;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   315
    background:  transparent;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   316
    font-family:    inherit;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   317
    font-weight:    normal;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   318
    font-style: italic;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   319
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   320
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   321
.methods dt code {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   322
    background:  #d9e6f8;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   323
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   324
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   325
.constants dt code {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   326
    background:  #ddffd2;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   327
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   328
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   329
.attributes dd, .methods dd, .constants dd, .fields dd, .dictionary-members dd {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   330
    margin-bottom:  1em;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   331
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   332
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   333
table.parameters, table.exceptions {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   334
    border-spacing: 0;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   335
    border-collapse:    collapse;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   336
    margin: 0.5em 0;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   337
    width:  100%;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   338
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   339
table.parameters { border-bottom:  1px solid #90b8de; }
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   340
table.exceptions { border-bottom:  1px solid #deb890; }
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   341
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   342
.parameters th, .exceptions th {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   343
    color:  #fff;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   344
    padding:    3px 5px;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   345
    text-align: left;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   346
    font-family:    initial;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   347
    font-weight:    normal;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   348
    text-shadow:    #666 1px 1px 0;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   349
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   350
.parameters th { background: #90b8de; }
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   351
.exceptions th { background: #deb890; }
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   352
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   353
.parameters td, .exceptions td {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   354
    padding:    3px 10px;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   355
    border-top: 1px solid #ddd;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   356
    vertical-align: top;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   357
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   358
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   359
.parameters tr:first-child td, .exceptions tr:first-child td {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   360
    border-top: none;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   361
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   362
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   363
.parameters td.prmName, .exceptions td.excName, .exceptions td.excCodeName {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   364
    width:  100px;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   365
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   366
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   367
.parameters td.prmType {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   368
    width:  120px;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   369
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   370
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   371
table.exceptions table {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   372
    border-spacing: 0;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   373
    border-collapse:    collapse;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   374
    width:  100%;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   375
}
12
c60732bd149c Fixing https css load
fmoussa <feras.moussa@hotmail.com>
parents: 11
diff changeset
   376
</style><link rel="stylesheet" href="https://www.w3.org/StyleSheets/TR/W3C-WD"></head>
11
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   377
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   378
<body><div class="head">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   379
  <p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   380
    
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   381
      <a href="http://www.w3.org/"><img width="72" height="48" src="http://www.w3.org/Icons/w3c_home" alt="W3C"></a>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   382
    
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   383
  </p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   384
  <h1 class="title" id="title">Streams API</h1>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   385
  
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   386
  <h2 id="w3c-working-draft-11-february-2013"><abbr title="World Wide Web Consortium">W3C</abbr> Working Draft 11 February 2013</h2>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   387
  <dl>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   388
    
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   389
      <dt>This version:</dt>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   390
      <dd><a href="http://www.w3.org/TR/2013/WD-streams-api-20130211/">http://www.w3.org/TR/2013/WD-streams-api-20130211/</a></dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   391
      <dt>Latest published version:</dt>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   392
      <dd><a href="http://www.w3.org/TR/streams-api/">http://www.w3.org/TR/streams-api/</a></dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   393
    
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   394
    
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   395
      <dt>Latest editor's draft:</dt>
14
b311630ca063 fixing editors draft link
fmoussa <feras.moussa@hotmail.com>
parents: 13
diff changeset
   396
      <dd><a href="https://dvcs.w3.org/hg/streams-api/raw-file/tip/Overview.htm">https://dvcs.w3.org/hg/streams-api/raw-file/tip/Overview.htm</a></dd>
11
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   397
    
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   398
    
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   399
    
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   400
    
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   401
    
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   402
      <dt>Previous version:</dt>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   403
      <dd><a href=""></a></dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   404
    
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   405
    
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   406
    <dt>Editor:</dt>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   407
    <dd><a href="mailto:feras.moussa@hotmail.com">Feras Moussa</a>, Invited Expert</dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   408
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   409
    
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   410
  </dl>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   411
  
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   412
  
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   413
  
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   414
  
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   415
    
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   416
      <p class="copyright">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   417
        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   418
        2013
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   419
        
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   420
        <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   421
        (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>,
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   422
        <a href="http://www.ercim.eu/"><abbr title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   423
        <a href="http://www.keio.ac.jp/">Keio</a>, <a href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   424
        <abbr title="World Wide Web Consortium">W3C</abbr> <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   425
        <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   426
        <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   427
      </p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   428
    
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   429
  
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   430
  <hr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   431
</div>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   432
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   433
<section id="abstract" class="introductory"><h2>Abstract</h2>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   434
		<!-- TODO: are all of the links and objects in the abstract formatted? -->
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   435
		<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   436
			This specification provides an API for representing binary data in web applications as a <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a> object, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   437
			as well as programmatically building and reading its contents. This includes:
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   438
		</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   439
		<ul>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   440
			<li>A <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a> interface, which represents a sequence of data that can be read over time.</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   441
			<li>A <a href="#idl-def-StreamReader" class="idlType"><code>StreamReader</code></a> interface, which provides methods to read the contents of a <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a> as a 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   442
				<code>Blob</code>, <code>DataURL</code>, <code>ArrayBuffer</code>, or as <code>Text</code>.</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   443
			<li>A <a href="#idl-def-StreamBuilder" class="idlType"><code>StreamBuilder</code></a> interface, which allows for creating a new <a href="#idl-def-Stream" class="idlType"><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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   444
			<li>Extensions to <a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-xmlhttprequest-interface">XmlHttpRequest</a> [<cite><a class="bibref" href="#bib-XMLHTTPREQUEST2">XMLHTTPREQUEST2</a></cite>] to add support for upload and download of a <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a>.</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   445
			<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   446
				Extensions to <a href="http://dev.w3.org/2006/webapi/FileAPI/#FileErrorInterface">FileError</a> and 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   447
				<a href="http://dev.w3.org/2006/webapi/FileAPI/#FileException">FileException</a> to encompass <a href="#streamerror-error">Stream Errors</a>.</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   448
			<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   449
				Extensions to <a href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-createObjectURL">createObjectURL</a> and 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   450
				<a href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-revokeObjectURL">revokeObjectURL</a> to add support for <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a>.</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   451
		</ul>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   452
		<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   453
			Additionally, this specification defines objects to be used within threaded web applications for the synchronous reading of a <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a>.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   454
		</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   455
		<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   456
			This API is designed to be used in conjunction with other APIs and elements on the web platform, notably: 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   457
			<a href="http://dev.w3.org/2006/webapi/FileAPI">File</a> [<cite><a class="bibref" href="#bib-FILE-API">FILE-API</a></cite>], 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   458
			<a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2">XMLHttpRequest</a> 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   459
			(e.g. with an overloaded <a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-send-method"><code>send()</code></a> method 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   460
			and <a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-responsetype-attribute"><code>response</code></a> object for <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a> objects) [<cite><a class="bibref" href="#bib-XMLHTTPREQUEST2">XMLHTTPREQUEST2</a></cite>], 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   461
			<a href="http://dev.w3.org/html5/postmsg/#dom-window-postmessage"><code>postMessage</code></a>, and 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   462
			Web Workers [<cite><a class="bibref" href="#bib-WEBWORKERS">WEBWORKERS</a></cite>].
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   463
		</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   464
<!--End section: Abstract-->
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   465
</section><section id="sotd" class="introductory"><h2>Status of This Document</h2>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   466
  
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   467
    
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   468
      
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   469
        <p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   470
          <em>This section describes the status of this document at the time of its publication. Other
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   471
          documents may supersede this document. A list of current <abbr title="World Wide Web Consortium">W3C</abbr> publications and the latest revision
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   472
          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
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   473
          index</a> at http://www.w3.org/TR/.</em>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   474
        </p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   475
        
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   476
        <p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   477
          This document was published as a <b>First Public Working Draft</b> by the <a href="http://www.w3.org/2008/webapps/"><abbr title="World Wide Web Consortium">W3C</abbr> Web Applications (WebApps)</a> as a Working Draft.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   478
          
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   479
            This document is intended to become a <abbr title="World Wide Web Consortium">W3C</abbr> Recommendation.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   480
          
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   481
          
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   482
          If you wish to make comments regarding this document, please send them to 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   483
          <a href="mailto:public-webapps@w3.org">public-webapps@w3.org</a> 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   484
          (<a href="mailto:public-webapps-request@w3.org?subject=subscribe">subscribe</a>,
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   485
          <a href="http://lists.w3.org/Archives/Public/public-webapps/">archives</a>).
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   486
          
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   487
          
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   488
          
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   489
          
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   490
        All comments are welcome.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   491
        
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   492
        
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   493
          </p><p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   494
            Publication as a Working Draft does not imply endorsement by the <abbr title="World Wide Web Consortium">W3C</abbr> Membership.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   495
            This is a draft document and may be updated, replaced or obsoleted by other documents at 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   496
            any time. It is inappropriate to cite this document as other than work in progress.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   497
          </p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   498
        
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   499
        
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   500
        <p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   501
          
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   502
            This document was produced by a group operating under the 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   503
            <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   504
          
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   505
          
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   506
          
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   507
            
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   508
              <abbr title="World Wide Web Consortium">W3C</abbr> maintains a <a href="http://www.w3.org/2004/01/pp-impl/42538/status" rel="disclosure">public list of any patent disclosures</a> 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   509
            
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   510
            made in connection with the deliverables of the group; that page also includes instructions for 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   511
            disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   512
            <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a> must disclose the
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   513
            information in accordance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   514
            6 of the <abbr title="World Wide Web Consortium">W3C</abbr> Patent Policy</a>.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   515
          
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   516
          
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   517
        </p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   518
        
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   519
      
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   520
    
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   521
  
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   522
</section><section id="toc"><h2 class="introductory">Table of Contents</h2><ul class="toc"><li class="tocline"><a href="#introduction" class="tocxref"><span class="secno">1. </span>Introduction</a></li><li class="tocline"><a href="#stream-interface" class="tocxref"><span class="secno">2. </span>The Stream Interface</a><ul class="toc"><li class="tocline"><a href="#attributes" class="tocxref"><span class="secno">2.1 </span>Attributes</a></li><li class="tocline"><a href="#methods" class="tocxref"><span class="secno">2.2 </span>Methods</a></li></ul></li><li class="tocline"><a href="#streamreader-interface" class="tocxref"><span class="secno">3. </span>The StreamReader Interface</a><ul class="toc"><li class="tocline"><a href="#attributes-1" class="tocxref"><span class="secno">3.1 </span>Attributes</a></li><li class="tocline"><a href="#methods-1" class="tocxref"><span class="secno">3.2 </span>Methods</a></li><li class="tocline"><a href="#constants" class="tocxref"><span class="secno">3.3 </span>Constants</a></li><li class="tocline"><a href="#streamreader-event-handler-types" class="tocxref"><span class="secno">3.4 </span>Event Handler Attributes</a><ul class="toc"><li class="tocline"><a href="#streamreader-event-summary" class="tocxref"><span class="secno">3.4.1 </span>Event Summary</a></li></ul></li></ul></li><li class="tocline"><a href="#streamreadersync-interface" class="tocxref"><span class="secno">4. </span>The StreamReaderSync Interface</a><ul class="toc"><li class="tocline"><a href="#methods-2" class="tocxref"><span class="secno">4.1 </span>Methods</a></li></ul></li><li class="tocline"><a href="#reading-empty-stream" class="tocxref"><span class="secno">5. </span>Determining an empty Stream</a></li><li class="tocline"><a href="#errors-and-exceptions" class="tocxref"><span class="secno">6. </span>Errors and Exceptions</a><ul class="toc"><li class="tocline"><a href="#streamerror-error" class="tocxref"><span class="secno">6.1 </span>StreamError</a></li><li class="tocline"><a href="#streamexception-error" class="tocxref"><span class="secno">6.2 </span>StreamException</a></li></ul></li><li class="tocline"><a href="#streambuilder-interface" class="tocxref"><span class="secno">7. </span>The StreamBuilder Interface</a><ul class="toc"><li class="tocline"><a href="#attributes-2" class="tocxref"><span class="secno">7.1 </span>Attributes</a></li><li class="tocline"><a href="#methods-3" class="tocxref"><span class="secno">7.2 </span>Methods</a></li><li class="tocline"><a href="#reads-on-a-stream-from-streambuilder" class="tocxref"><span class="secno">7.3 </span>Reads on a Stream from StreamBuilder</a></li><li class="tocline"><a href="#streambuilder-event-handler-types" class="tocxref"><span class="secno">7.4 </span>Event Handler Attributes</a><ul class="toc"><li class="tocline"><a href="#streambuilder-event-summary" class="tocxref"><span class="secno">7.4.1 </span>Event Summary</a></li></ul></li></ul></li><li class="tocline"><a href="#error-uris_for_streams" class="tocxref"><span class="secno">8. </span>URIs for Stream</a><ul class="toc"><li class="tocline"><a href="#creating-revoking-streamuri" class="tocxref"><span class="secno">8.1 </span>Creating and Revoking a Stream URI</a><ul class="toc"><li class="tocline"><a href="#methods-4" class="tocxref"><span class="secno">8.1.1 </span>Methods</a></li></ul></li></ul></li><li class="tocline"><a href="#security" class="tocxref"><span class="secno">9. </span>Security Considerations</a></li><li class="tocline"><a href="#XMLHttpRequest" class="tocxref"><span class="secno">10. </span>Extension of XMLHttpRequest</a><ul class="toc"><li class="tocline"><a href="#addition-of-stream-responsetype" class="tocxref"><span class="secno">10.1 </span>Addition of stream responseType</a></li><li class="tocline"><a href="#readystate3-changes" class="tocxref"><span class="secno">10.2 </span>readyState 3 changes</a></li><li class="tocline"><a href="#send0" class="tocxref"><span class="secno">10.3 </span>send()</a></li></ul></li><li class="tocline"><a href="#requirements" class="tocxref"><span class="secno">11. </span>Requirements and Use Cases</a></li><li class="tocline"><a href="#acknowledgements" class="tocxref"><span class="secno">A. </span>Acknowledgements</a></li><li class="tocline"><a href="#references" class="tocxref"><span class="secno">B. </span>References</a><ul class="toc"><li class="tocline"><a href="#normative-references" class="tocxref"><span class="secno">B.1 </span>Normative references</a></li></ul></li></ul></section>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   523
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   524
<section id="introduction" class="section informative">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   525
    	<!--OddPage--><h2><span class="secno">1. </span>Introduction</h2><p><em>This section is non-normative.</em></p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   526
    	
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   527
    	<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   528
    		Web applications should have the ability to acquire and manipulate data in a wide variety of forms, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   529
    		including as a sequence of data made available over time. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   530
    		This specification defines the basic representation for <a href="#idl-def-Stream"><code>Streams</code></a>, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   531
    		errors raised by <a href="#idl-def-Stream"><code>Streams</code></a>, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   532
    		and programmatic ways to read and create <a href="#idl-def-Stream"><code>Streams</code></a>. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   533
    	</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   534
    	<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   535
			The <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a> interface represents binary data which can be obtained over time. A <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a> can come from APIs 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   536
			such as <a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#the-xmlhttprequest-interface"><code>XMLHttpRequest</code></a>, or can
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   537
			be built using <a href="#idl-def-StreamBuilder" class="idlType"><code>StreamBuilder</code></a>. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   538
			The <a href="#idl-def-StreamReader" class="idlType"><code>StreamReader</code></a> interface represents a way to read data 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   539
			from a <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a> as a <code>Blob</code>, <code>DataURL</code>, <code>ArrayBuffer</code>, or as <code>Text</code>, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   540
			and should happen asynchronously on the user agent’s main thread, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   541
			with an optional synchronous API used within threaded web applications. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   542
			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. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   543
			This specification defines an asynchronous API based on an event model to read and access a <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a>, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   544
			which is closely based on the FileReader interface defined in the [<cite><a class="bibref" href="#bib-FILE-API">FILE-API</a></cite>]. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   545
			A <a href="#idl-def-StreamReader" class="idlType"><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 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   546
			<code>Blob</code>, <code>DataURL</code>, <code>ArrayBuffer</code>, or as <code>Text</code> through event handler attributes and the firing of events. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   547
			The use of events and event handlers allows separate code blocks the ability to monitor the progress of the read 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   548
			(which is particularly useful for long <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a> reads or high latency network requests) 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   549
			and error conditions that may arise during reading of a <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a>. An example will be illustrative.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   550
		</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   551
    	<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   552
    		In the example below, different code blocks handle progress, error, and success conditions. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   553
    		The example demonstrates how to read a <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a> using <a href="#idl-def-StreamReader" class="idlType"><code>StreamReader</code></a>.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   554
    	</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   555
    	<div class="example"><div class="example-title"><span>Example 1</span></div><pre class="example">function startRead(stream) {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   556
        
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   557
  var reader = new StreamReader();
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   558
  
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   559
  // Handle progress, success, and errors
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   560
  reader.onprogress = updateProgress;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   561
  reader.onload = loaded;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   562
  reader.onerror = errorHandler;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   563
  
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   564
    // Read the first 1024 bytes of the stream as UTF-8      
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   565
  reader.readAsText(stream, "UTF-8", 1024);
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   566
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   567
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   568
function updateProgress(evt) {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   569
    var bytesLoaded = (evt.loaded / 1024);
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   570
    // Increase bytes loaded counter
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   571
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   572
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   573
function loaded(evt) {  
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   574
  // Obtain the read stream data    
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   575
  var streamRead = evt.target.result;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   576
  
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   577
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   578
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   579
function errorHandler(evt) {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   580
  if(evt.target.error.name == "NOT_READABLE_ERR") {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   581
    // The stream could not be read
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   582
  }
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   583
}</pre></div>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   584
    	
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   585
    	<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   586
    		In the example below, different code blocks handle progress, error, and success conditions. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   587
    		The example below demonstrates how to obtain a <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a> from <code>XMLHttpRequest</code> to begin playing a large video in <code>readystate</code> 3.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   588
    	</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   589
    	<div class="example"><div class="example-title"><span>Example 2</span></div><pre class="example">function handler() {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   590
  if(this.readyState == this.LOADING) {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   591
	var theStream = this.response;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   592
	var streamURL = URL.createObjectURL(theStream);
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   593
	document.getElementById("myVideoTag").src = streamURL;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   594
  }
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   595
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   596
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   597
var client = new XMLHttpRequest();
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   598
client.onreadystatechange = handler;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   599
client.setRequestHeader('customHeader', 'value');
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   600
client.setRequestHeader('customHeader2', 'value2');
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   601
client.open("GET", "myvideo.h264");
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   602
client.responseType = "stream";
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   603
client.send();</pre></div>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   604
    	
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   605
		<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   606
			In addition to reading a Stream, this specification introduces a programatic way to build a Stream with the <a href="#idl-def-StreamBuilder" class="idlType"><code>StreamBuilder</code></a> interface.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   607
			The <a href="#idl-def-StreamBuilder" class="idlType"><code>StreamBuilder</code></a> interface represents a way to provide the data to be read from a Stream by appending the data to an internal buffer.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   608
			<a href="#idl-def-StreamBuilder" class="idlType"><code>StreamBuilder</code></a> supports appending <code>Blob</code>, <code>ArrayBuffer</code>, and <code>Text</code> data to the buffer. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   609
			<a href="#idl-def-StreamBuilder" class="idlType"><code>StreamBuilder</code></a> also provides an event to notify when the data available to be read from the buffer has fallen below a given threshold.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   610
		</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   611
		<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   612
			The example below demonstrates how to use <a href="#idl-def-StreamBuilder" class="idlType"><code>StreamBuilder</code></a> to load a stream into the audio tag, whose data is processed and built dynamically at read time. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   613
			The <code>thresholdReached</code> event is fired when the buffer falls below 1024 bytes.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   614
		</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   615
		
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   616
<div class="example"><div class="example-title"><span>Example 3</span></div><pre class="example">function thresholdReached(){
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   617
  var moreData = //do work to create more data to place into the stream
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   618
  
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   619
  //if we have no more data to process and place in the stream, we close
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   620
  if(moreData == null){
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   621
  	sbuilder.close();
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   622
  } else{
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   623
  	sbuiler.append(moreData);
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   624
  }
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   625
}
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   626
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   627
var sbuilder = new StreamBuilder("audio/mp3", 1024);
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   628
var sbuilder.onthresholdreached = thresholdReached;
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   629
  
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   630
var streamURL = URL.createObjectURL(sbuilder.stream);
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   631
document.getElementById('audioTag').src = streamURL;</pre></div>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   632
<!--End section: Introduction-->
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   633
</section>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   634
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   635
<section class="section" id="stream-interface">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   636
<!--OddPage--><h2><span class="secno">2. </span>The Stream Interface</h2>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   637
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   638
	<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   639
		This interface represents a raw sequence of linear data which can be read over time. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   640
		It provides an attribute representing the type of data represented by the <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a>.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   641
	</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   642
	<p>A <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a> is an object that:</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   643
	<ul>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   644
		<li>Has a content type;</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   645
		<li>Has unspecified length;</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   646
		<li>Can generally be used in the same places <code>Blob</code> can be used, such as <code>URL.createObjectURL()</code></li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   647
	</ul>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   648
	<pre class="idl"><span class="idlInterface" id="idl-def-Stream">interface <span class="idlInterfaceID">Stream</span> {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   649
<span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>DOMString</a></span> <span class="idlAttrName"><a href="#widl-Stream-type">type</a></span>;</span>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   650
<span class="idlMethod">    <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-Stream-close-void">close</a></span> ();</span>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   651
};</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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   652
			The ASCII-encoded string in lower case representing the media type of the <code>Stream</code>, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   653
			expressed as an RFC2046 MIME type [<cite><a class="bibref" href="#bib-RFC2046">RFC2046</a></cite>]. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   654
			Conforming user agents <em class="rfc2119" title="should">should</em> return the MIME type of the <code>Stream</code>, if it is known. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   655
			If conforming user agents cannot determine the media type of the <code>Stream</code>, they <em class="rfc2119" title="must">must</em> return the empty string. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   656
			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 class="bibref" href="#bib-HTTP11">HTTP11</a></cite>].
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   657
		</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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   658
			This method should close the Stream and not allow any 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>.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   659
		<div><em>No parameters.</em></div><div><em>Return type: </em><code><a>void</a></code></div></dd></dl></section>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   660
</section>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   661
<!-- End section: The Stream Interface -->
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   662
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   663
<section class="section" id="streamreader-interface">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   664
<!--OddPage--><h2><span class="secno">3. </span>The StreamReader Interface</h2>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   665
	<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   666
		This interface provides methods to read the data of a <code>Stream</code> using progress events and event handler attributes. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   667
		It is desirable to read data from <a href="#idl-def-Stream">Streams</a> asynchronously in the main thread of user agents. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   668
		This interface provides such an asynchronous API, and is specified to be used with the global object 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   669
		(<a href="http://www.w3.org/TR/2011/WD-html5-20110525/browsers.html#the-window-object">Window</a> [<cite><a class="bibref" href="#bib-HTML5">HTML5</a></cite>]).
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   670
		The <a href="#idl-def-StreamReader" class="idlType"><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 class="bibref" href="#bib-FILE-API">FILE-API</a></cite>], 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   671
		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.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   672
	</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   673
	<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   674
		When the <code>StreamReader()</code> constructor is invoked, the user agent <em class="rfc2119" title="must">must</em> return a new <a href="#idl-def-StreamReader" class="idlType"><code>StreamReader</code></a> object.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   675
	</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   676
	<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   677
		In environments where the global object is represented by a <code>Window</code> or a <code>WorkerGlobalScope</code> object, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   678
		the <a href="#idl-def-StreamReader" class="idlType"><code>StreamReader</code></a> constructor <em class="rfc2119" title="must">must</em> be available.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   679
	</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   680
	<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   681
		For event handler attributes, event handlers for <a href="#idl-def-StreamReader" class="idlType"><code>StreamReader</code></a> should mimic
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   682
		<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 class="bibref" href="#bib-FILE-API">FILE-API</a></cite>]
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   683
	</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   684
	<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   685
		For states, event handlers for <a href="#idl-def-StreamReader" class="idlType"><code>StreamReader</code></a> should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#blobreader-state">6.4.4 FileReader States</a> 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   686
		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 class="bibref" href="#bib-FILE-API">FILE-API</a></cite>]
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   687
	</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   688
	<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   689
		Multiple reads on <a href="#idl-def-StreamReader" class="idlType"><code>StreamReader</code></a> should mimic 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   690
		<a href="http://dev.w3.org/2006/webapi/FileAPI/#MultipleReads">6.4.5.1 Multiple Reads</a> of the File API specification. [<cite><a class="bibref" href="#bib-FILE-API">FILE-API</a></cite>]
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   691
	</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   692
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   693
	
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   694
	<pre class="idl"><span class="idlInterface" id="idl-def-StreamReader">interface <span class="idlInterfaceID">StreamReader</span> : <span class="idlSuperclass"><a>EventTarget</a></span> {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   695
<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 href="#idl-def-Stream" class="idlType"><code>Stream</code></a></span> <span class="idlParamName">stream</span></span>, <span class="idlParam"><span class="idlParamType"><a>unsigned long long</a></span> <span class="idlParamName">maxSize</span></span>);</span>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   696
<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 href="#idl-def-Stream" class="idlType"><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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   697
<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 href="#idl-def-Stream" class="idlType"><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>);</span>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   698
<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 href="#idl-def-Stream" class="idlType"><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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   699
<span class="idlMethod">    <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-StreamReader-abort-void">abort</a></span> ();</span>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   700
<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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   701
<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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   702
<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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   703
<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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   704
<span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>any</a></span>            <span class="idlAttrName"><a href="#widl-StreamReader-result">result</a></span>;</span>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   705
<span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a>StreamError</a></span>    <span class="idlAttrName"><a href="#widl-StreamReader-error">error</a></span>;</span>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   706
<span class="idlAttribute">             attribute <span class="idlAttrType"><a>Function</a></span>       <span class="idlAttrName"><a href="#widl-StreamReader-onloadstart">onloadstart</a></span>;</span>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   707
<span class="idlAttribute">             attribute <span class="idlAttrType"><a>Function</a></span>       <span class="idlAttrName"><a href="#widl-StreamReader-onprogress">onprogress</a></span>;</span>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   708
<span class="idlAttribute">             attribute <span class="idlAttrType"><a>Function</a></span>       <span class="idlAttrName"><a href="#widl-StreamReader-onload">onload</a></span>;</span>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   709
<span class="idlAttribute">             attribute <span class="idlAttrType"><a>Function</a></span>       <span class="idlAttrName"><a href="#widl-StreamReader-onabort">onabort</a></span>;</span>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   710
<span class="idlAttribute">             attribute <span class="idlAttrType"><a>Function</a></span>       <span class="idlAttrName"><a href="#widl-StreamReader-onerror">onerror</a></span>;</span>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   711
<span class="idlAttribute">             attribute <span class="idlAttrType"><a>Function</a></span>       <span class="idlAttrName"><a href="#widl-StreamReader-onloadend">onloadend</a></span>;</span>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   712
};</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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   713
			This event handler should mimic the 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   714
        	<a href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-onabort"><code>FileReader.onabort</code></a> 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   715
        	event handler.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   716
		</dd><dt id="widl-StreamReader-onerror"><code>onerror</code> of type <span class="idlAttrType"><a>Function</a></span></dt><dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   717
			This event handler should mimic the 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   718
        	<a href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-onerror"><code>FileReader.onerror</code></a> 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   719
        	event handler.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   720
		</dd><dt id="widl-StreamReader-onload"><code>onload</code> of type <span class="idlAttrType"><a>Function</a></span></dt><dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   721
			This event handler should mimic the 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   722
        	<a href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-onload"><code>FileReader.onload</code></a> 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   723
        	event handler.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   724
		</dd><dt id="widl-StreamReader-onloadend"><code>onloadend</code> of type <span class="idlAttrType"><a>Function</a></span></dt><dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   725
			This event handler should mimic the 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   726
        	<a href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-onloadend"><code>FileReader.onloadend</code></a> 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   727
        	event handler.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   728
		</dd><dt id="widl-StreamReader-onloadstart"><code>onloadstart</code> of type <span class="idlAttrType"><a>Function</a></span></dt><dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   729
			This event handler should mimic the 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   730
        	<a href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-onloadstart"><code>FileReader.onloadstart</code></a> 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   731
        	event handler.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   732
		</dd><dt id="widl-StreamReader-onprogress"><code>onprogress</code> of type <span class="idlAttrType"><a>Function</a></span></dt><dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   733
			This event handler should mimic the 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   734
        	<a href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-onprogress"><code>FileReader.onprogress</code></a> 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   735
        	event handler.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   736
		</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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   737
        	This attribute should mimic the <a href="http://dev.w3.org/2006/webapi/FileAPI/#dfn-result">FileReader.result</a> attribute, with the following addition:
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   738
        		<ul>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   739
        			<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   740
        				On getting, if the 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   741
        				<a href="#widl-StreamReader-readAsBlob-void-Stream-stream-int-maxSize">readAsBlob</a> read method is used, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   742
        				this attribute <em class="rfc2119" title="must">must</em> return a <code>Blob</code> of the data read from the <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a> 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   743
        				with the type property set as the type of the <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a>. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   744
        			</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   745
        		</ul>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   746
        </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 class="bibref" href="#bib-FILE-API">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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   747
			<p></p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   748
			<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   749
				This method should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#readAsArrayBuffer"><code>FileReader.readAsArrayBuffer()</code></a>. [<cite><a class="bibref" href="#bib-FILE-API">FILE-API</a></cite>]
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   750
				The only addition is the addition of a <code>maxSize</code> parameter, which has the following adjustment:
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   751
			</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   752
				<ul>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   753
					<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   754
						If <code>maxSize</code> is less than one, throw an Invalid Argument exception. Terminate these overall steps.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   755
					</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   756
					<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   757
						When the stream has been fully read, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   758
						or the number of bytes specified by <code>maxSize</code> has been reached, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   759
						set <a class="idlType" href="#widl-StreamReader-readyState"><code>readyState</code></a> to <code>DONE</code>.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   760
					</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   761
				</ul>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   762
			<p></p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   763
			
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   764
			<dl class="exception" title="StreamException">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   765
				<dt></dt>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   766
				<dd></dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   767
			</dl>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   768
			<dl class="exception" title="OperationNotAllowedException">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   769
				<dt></dt>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   770
				<dd></dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   771
			</dl>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   772
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   773
		<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 href="#idl-def-Stream" class="idlType"><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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   774
			<p></p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   775
			<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   776
				When this method is called, the user agent <em class="rfc2119" title="must">must</em> run the steps below (unless otherwise indicated).
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   777
			</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   778
			<ol>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   779
				<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   780
						If <code>maxSize</code> is less than one, through an Invalid Argument exception. Terminate these overall steps.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   781
					</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   782
				<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   783
					If <code>readyState</code> is <code>LOADING</code>, raise a <code>NOT_ALLOWED_ERR</code> exception and terminate these steps.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   784
				</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   785
				<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   786
					If an error occurs during reading the <code>stream</code> parameter, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   787
					set <a class="idlType" href="#widl-StreamReader-readyState"><code>readyState</code></a> to <code>DONE</code> and set 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   788
					<a class="idlType" href="#widl-StreamReader-result"><code>result</code></a> to <code>null</code>. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   789
					Proceed to the error steps below.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   790
						<ol>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   791
							<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   792
								Dispatch a progress event called <code>error</code>. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   793
								Set the <a class="idlType" href="#widl-StreamReader-error"><code>error</code></a> attribute; 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   794
								on getting, the <a class="idlType" href="#widl-StreamReader-error"><code>error</code></a> 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   795
								attribute <em class="rfc2119" title="must">must</em> be a <a href="#streamerror-error"><code>StreamError</code></a> object with a valid error code 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   796
								that indicates the kind of file error that has occurred.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   797
							</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   798
							<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   799
								Dispatch a progress event called <code>loadend</code>.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   800
							</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   801
							<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   802
								Terminate this overall set of steps.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   803
							</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   804
						</ol>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   805
				</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   806
				<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   807
					If no error has occurred, set <a class="idlType" href="#widl-StreamReader-readyState"><code>readyState</code></a> to <code>LOADING</code>.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   808
				</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   809
				<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   810
					Fire a progress event called <code>loadstart</code>.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   811
				</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   812
				<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   813
					Make progress notifications.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   814
				</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   815
				<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   816
					Continue reading on the <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a>:
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   817
						<ol>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   818
							<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   819
								If the optional <code>maxSize</code> parameter has been set, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   820
								set the <a class="idlType" href="#widl-StreamReader-readyState"><code>readyState</code></a> to <code>DONE</code> 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   821
								when the number of bytes read reaches <code>MAX_SIZE</code> 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   822
								or the stream has been fully read and the number of bytes is less than <code>MAX_SIZE</code>.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   823
							</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   824
							<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   825
								If the optional parameter has not been set, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   826
								set <a class="idlType" href="#widl-StreamReader-readyState"><code>readyState</code></a> 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   827
								to <code>DONE</code> when the stream has been fully read. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   828
							</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   829
						</ol>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   830
				</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   831
				<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   832
					Set the <a class="idlType" href="#widl-StreamReader-result"><code>result</code></a> attribute to be stream’s data content represented as a <code>Blob</code>; 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   833
					on getting, the result <a class="idlType" href="#widl-StreamReader-result"><code>result</code></a> returns the (complete) data of stream as a <code>Blob</code>.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   834
				</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   835
				<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   836
					Terminate this overall set of steps.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   837
				</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   838
			</ol>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   839
			<p></p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   840
			
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   841
		<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 href="#idl-def-Stream" class="idlType"><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="prmOptFalse">✘</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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   842
		<p></p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   843
			<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   844
				This method should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#readAsDataURL"><code>FileReader.readAsDataURL()</code></a>. [<cite><a class="bibref" href="#bib-FILE-API">FILE-API</a></cite>] 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   845
				The only addition is the addition of a <code>maxSize</code> parameter, which has the following adjustment.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   846
			</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   847
				<ul>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   848
					<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   849
						If <code>maxSize</code> is less than one, through an Invalid Argument exception. Terminate these overall steps.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   850
					</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   851
					<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   852
						Queue a task to update the <a class="idlType" href="#widl-StreamReader-result"><code>result</code></a> attribute 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   853
						with the <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a> as a DataURL [<cite><a class="bibref" href="#bib-RFC2397">RFC2397</a></cite>] after the stream has been fully read, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   854
						or the number of bytes specified by <code>maxSize</code> has been reached; 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   855
						on getting, the <a class="idlType" href="#widl-StreamReader-result"><code>result</code></a> attribute 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   856
						returns the (complete) data of stream as a DataURL [<cite><a class="bibref" href="#bib-RFC2397">RFC2397</a></cite>].
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   857
					</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   858
				</ul>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   859
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   860
			
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   861
			<dl class="exception" title="StreamException">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   862
				<dt></dt>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   863
				<dd></dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   864
			</dl>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   865
			<dl class="exception" title="OperationNotAllowedException">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   866
				<dt></dt>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   867
				<dd></dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   868
			</dl>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   869
			
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   870
		<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 href="#idl-def-Stream" class="idlType"><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-unsigned-long-long-maxSize"><code>readAsText</code></dt><dd>	
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   871
		<p></p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   872
			<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   873
				This method should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#readAsDataText"><code>FileReader.readAsText()</code></a>. [<cite><a class="bibref" href="#bib-FILE-API">FILE-API</a></cite>]
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   874
				The only addition is the addition of a <code>maxSize</code> parameter, which has the following adjustment:
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   875
			</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   876
			<ol>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   877
				<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   878
						If <code>maxSize</code> is less than one, through an Invalid Argument exception. Terminate these overall steps.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   879
					</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   880
				<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   881
					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 class="bibref" href="#bib-FILE-API">FILE-API</a></cite>]. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   882
				</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   883
				<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   884
					If no <code>maxSize</code> is specified, continue reading until the stream has been completed.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   885
				</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   886
				<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   887
					When the stream has been fully read, or 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   888
					<strong>the number of bytes specified by <code>maxSize</code> has been reached</strong>, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   889
					set <a class="idlType" href="#widl-StreamReader-readyState"><code>readyState</code></a> to <code>DONE</code>.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   890
				</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   891
			</ol>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   892
		<p></p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   893
			
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   894
			<dl class="exception" title="StreamException">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   895
				<dt></dt>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   896
				<dd></dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   897
			</dl>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   898
			<dl class="exception" title="OperationNotAllowedException">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   899
				<dt></dt>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   900
				<dd></dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   901
			</dl>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   902
		<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 href="#idl-def-Stream" class="idlType"><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><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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   903
        	The current read request has been completed, or an error occurred during read, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   904
        	or the read was aborted using <a href="#widl-StreamReader-abort-void"><code>abort()</code></a>. The <a href="#idl-def-StreamReader" class="idlType"><code>StreamReader</code></a> is no longer reading a <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a>.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   905
        </dd><dt id="widl-StreamReader-EMPTY"><code>EMPTY</code> of type <span class="idlConstType"><a>unsigned short</a></span></dt><dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   906
			This state should mimic the 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   907
			<code>EMPTY</code> state of the 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   908
			<a href="http://dev.w3.org/2006/webapi/FileAPI/#blobreader-state">FileReader States</a>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   909
		</dd><dt id="widl-StreamReader-LOADING"><code>LOADING</code> of type <span class="idlConstType"><a>unsigned short</a></span></dt><dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   910
			This state should mimic the 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   911
			<code>LOADING</code> state of the 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   912
			<a href="http://dev.w3.org/2006/webapi/FileAPI/#blobreader-state">FileReader States</a>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   913
        </dd></dl></section>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   914
 <pre class="idl"><span class="idlImplements"><a href="#idl-def-StreamReader" class="idlType"><code>StreamReader</code></a> implements <a>EventTarget</a>;</span></pre><div class="idlImplementsDesc"><p>All instances of the <code><a href="#idl-def-StreamReader" class="idlType"><code>StreamReader</code></a></code> type are defined to also implement the <a>EventTarget</a> interface.</p></div>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   915
	
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   916
	<section class="section" id="streamreader-event-handler-types">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   917
	<h3><span class="secno">3.4 </span>Event Handler Attributes</h3>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   918
		<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   919
			The following are the event handler attributes (and their corresponding event handler event types) that user agents <em class="rfc2119" title="must">must</em> support on StreamReader as DOM attributes:
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   920
		</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   921
		<table class="error">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   922
		   <thead>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   923
				<tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   924
					<th><a href="#event-handler-attributes" title="event handler attributes">event handler attribute</a></th>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   925
					<th><a href="#event-handler-event-type">event handler event type</a></th>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   926
				</tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   927
			</thead>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   928
			<tbody>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   929
				<tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   930
					<td><dfn id="dfn-onloadstart"><code>onloadstart</code></dfn></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   931
					<td><code><a href="#dfn-loadstart-event">loadstart</a></code></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   932
				</tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   933
				<tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   934
					<td><dfn id="dfn-onprogress"><code>onprogress</code></dfn></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   935
					<td><code><a href="#dfn-progress-event">progress</a></code></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   936
				</tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   937
				<tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   938
					<td><dfn id="dfn-onload"><code>onload</code></dfn></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   939
					<td><code><a href="#dfn-load-event">load</a></code></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   940
				</tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   941
				<tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   942
					<td><dfn id="dfn-onabort"><code>onabort</code></dfn></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   943
					<td><code title="abort-event"><a href="#dfn-abort-event">abort</a></code></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   944
				</tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   945
				<tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   946
					<td><dfn id="dfn-onerror"><code>onerror</code></dfn></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   947
					<td><code><a href="#dfn-error-event">error</a></code></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   948
				</tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   949
				<tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   950
					<td><dfn id="dfn-onloadend"><code>onloadend</code></dfn></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   951
					<td><code><a href="#dfn-loadend-event">loadend</a></code></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   952
				</tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   953
			</tbody>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   954
		</table>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   955
		
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   956
		<section class="section" id="streamreader-event-summary">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   957
		<h4><span class="secno">3.4.1 </span>Event Summary</h4>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   958
			<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   959
				The following are the events that are fired at <code><a href="#idl-def-StreamReader" class="idlType"><code>StreamReader</code></a></code> objects; 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   960
				<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 class="bibref" href="#bib-DOM-LEVEL-3-EVENTS">DOM-LEVEL-3-EVENTS</a></cite>], 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   961
				and the table below is normative for the events in this specification. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   962
			</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   963
				<table class="error" id="streamreader-event-summary-table">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   964
					<thead>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   965
						<tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   966
							<th>Event name</th>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   967
							<th>Interface</th>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   968
							<th>Fired when…</th>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   969
						</tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   970
					</thead>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   971
					<tbody>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   972
						<tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   973
							<td><dfn id="dfn-loadstart-event"><code>loadstart</code></dfn></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   974
							<td><code>ProgressEvent</code></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   975
							<td>When the read starts.</td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   976
						</tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   977
						<tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   978
							<td><dfn id="dfn-progress-event"><code>progress</code></dfn></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   979
							<td><code>ProgressEvent</code></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   980
							<td>While reading (and decoding) a <code>stream</code>, and reporting progress.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   981
							</td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   982
						</tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   983
						<tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   984
							<td><dfn id="dfn-abort-event" title="abort-event"><code>abort</code></dfn></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   985
							<td><code>ProgressEvent</code></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   986
							<td>When the read has been aborted. For instance, by invoking the <code><a href="#widl-StreamReader-abort-void">abort()</a></code> method.</td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   987
						</tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   988
						<tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   989
							<td><dfn id="dfn-error-event"><code>error</code></dfn></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   990
							<td><code>ProgressEvent</code></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   991
							<td>When the read has failed (see <a href="http://dev.w3.org/2006/webapi/FileAPI/#file-error-read">errors</a>).</td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   992
						</tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   993
						<tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   994
							<td><dfn id="dfn-load-event"><code>load</code></dfn></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   995
							<td><code>ProgressEvent</code></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   996
							<td>When the read has successfully completed.</td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   997
						</tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   998
						<tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
   999
							<td><dfn id="dfn-loadend-event"><code>loadend</code></dfn></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1000
							<td><code>ProgressEvent</code></td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1001
							<td>When the request has completed (either in success or failure).</td>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1002
						</tr>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1003
					</tbody>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1004
				</table>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1005
		</section>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1006
	</section>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1007
</section>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1008
<!-- End section: The StreamReader Interface -->
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1009
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1010
<section class="section" id="streamreadersync-interface">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1011
<!--OddPage--><h2><span class="secno">4. </span>The StreamReaderSync Interface</h2>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1012
	<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1013
		This interface provides methods to read the data of a <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a>.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1014
	</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1015
	<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1016
		When the <code>StreamReaderSync()</code> constructor is invoked, the user agent <em class="rfc2119" title="must">must</em> return a new <code>StreamReaderSync</code> object.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1017
	</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1018
	<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1019
		In environments where the global object is represented by a <a href="http://dev.w3.org/html5/workers/#workerglobalscope"><code>WorkerGlobalScope</code></a> object, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1020
		the <code>StreamReaderSync</code> constructor <em class="rfc2119" title="must">must</em> be available.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1021
	</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1022
	<pre class="idl"><span class="idlInterface" id="idl-def-StreamReaderSync">interface <span class="idlInterfaceID">StreamReaderSync</span> {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1023
<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 href="#idl-def-Stream" class="idlType"><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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1024
<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 href="#idl-def-Stream" class="idlType"><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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1025
<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 href="#idl-def-Stream" class="idlType"><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>);</span>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1026
<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 href="#idl-def-Stream" class="idlType"><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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1027
};</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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1028
			<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1029
				This method should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#readAsArrayBufferSyncSection"><code>FileReader.readAsArrayBuffer()</code></a>. [<cite><a class="bibref" href="#bib-FILE-API">FILE-API</a></cite>]
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1030
				The only addition is the addition of a <code>maxSize</code> parameter that affects the amount of bytes to read from the <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a>.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1031
			</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1032
			
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1033
			<dl class="exception" title="StreamException">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1034
				<dt></dt>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1035
				<dd></dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1036
			</dl>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1037
		<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 href="#idl-def-Stream" class="idlType"><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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1038
			<p></p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1039
			<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1040
				When this method is called, the following steps <em class="rfc2119" title="must">must</em> be followed:
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1041
			</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1042
				<ol>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1043
					<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1044
						If an error occurs during reading the <code>stream</code> parameter, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1045
						throw a <code>StreamException</code> with the appropriate error code. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1046
						Terminate these overall steps.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1047
					</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1048
					<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1049
						If no error has occurred, read <code>stream</code> until the end is reached, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1050
						or the number of bytes specified by <code>maxSize</code> have been read. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1051
						Return the data contents of <code>stream</code> as a blob 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1052
						with the <code>type</code> property set as the type of the <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a>.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1053
					</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1054
				</ol>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1055
			<p></p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1056
			
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1057
			<dl class="exception" title="StreamException">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1058
				<dt></dt>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1059
				<dd></dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1060
			</dl>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1061
		<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 href="#idl-def-Stream" class="idlType"><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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1062
			<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1063
				This method should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#readAsDataURLSync-section"><code>FileReader.readAsDataURL()</code></a>. [<cite><a class="bibref" href="#bib-FILE-API">FILE-API</a></cite>]
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1064
				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 href="#idl-def-Stream" class="idlType"><code>Stream</code></a>.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1065
			</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1066
			
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1067
			<dl class="exception" title="StreamException">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1068
				<dt></dt>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1069
				<dd></dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1070
			</dl>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1071
		<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 href="#idl-def-Stream" class="idlType"><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-unsigned-long-long-maxSize"><code>readAsText</code></dt><dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1072
			<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1073
				This method should mimic <a href="http://dev.w3.org/2006/webapi/FileAPI/#readAsTextSync"><code>FileReader.readAsText()</code></a>. [<cite><a class="bibref" href="#bib-FILE-API">FILE-API</a></cite>]
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1074
				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 href="#idl-def-Stream" class="idlType"><code>Stream</code></a>.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1075
			</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1076
			
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1077
			<dl class="exception" title="StreamException">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1078
				<dt></dt>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1079
				<dd></dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1080
			</dl>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1081
		<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 href="#idl-def-Stream" class="idlType"><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><div><em>Return type: </em><code><a>DOMString</a></code></div></dd></dl></section>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1082
</section>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1083
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1084
<section class="section" id="reading-empty-stream">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1085
<!--OddPage--><h2><span class="secno">5. </span>Determining an empty Stream</h2>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1086
	<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1087
		StreamReader will read a Stream until maxSize has been reached or the Stream has no further data to return. If a Stream has been read until the end, then there is no further data to return. Subsequent read calls will return the following:
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1088
	</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1089
		<dl class="switch">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1090
								<dt>If read is <a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#dom-xmlhttprequest-responsetype"><code>readAsBlob</code></a></dt>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1091
								<dd>Return an empty <code>Blob</code> with size zero</dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1092
								
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1093
								<dt>If read is <a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#dom-xmlhttprequest-responsetype"><code>readAsArrayBuffer</code></a></dt>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1094
								<dd>Return an <code>ArrayBuffer</code> with length zero</dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1095
								
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1096
								<dt>If read is <a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#dom-xmlhttprequest-responsetype"><code>readAsText</code></a></dt>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1097
								<dd>Return an empty string</dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1098
								
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1099
								<dt>If read is <a href="http://dev.w3.org/2006/webapi/XMLHttpRequest-2/#dom-xmlhttprequest-responsetype"><code>readAsDataURL</code></a></dt>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1100
								<dd>Return an empty string</dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1101
								
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1102
							</dl>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1103
	
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1104
</section>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1105
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1106
<section class="section" id="errors-and-exceptions">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1107
<!--OddPage--><h2><span class="secno">6. </span>Errors and Exceptions</h2>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1108
	<section class="section" id="streamerror-error">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1109
	<h3><span class="secno">6.1 </span>StreamError</h3>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1110
		<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1111
			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.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1112
		</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1113
	</section>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1114
	
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1115
	<section class="section" id="streamexception-error">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1116
	<h3><span class="secno">6.2 </span>StreamException</h3>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1117
		<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1118
			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.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1119
		</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1120
	</section>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1121
</section>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1122
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1123
<section class="section" id="streambuilder-interface">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1124
<!--OddPage--><h2><span class="secno">7. </span>The StreamBuilder Interface</h2>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1125
	<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1126
		The <a href="#idl-def-StreamBuilder" class="idlType"><code>StreamBuilder</code></a> interface provides a way for developers to create a <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a> by appending data. During a read on the <code>stream</code> from a <a href="#idl-def-StreamBuilder" class="idlType"><code>StreamBuilder</code></a>, the data is read 'First in, First out', 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1127
		in the order it was appended. <a href="#idl-def-StreamBuilder" class="idlType"><code>StreamBuilder</code></a> provides methods for appending different data, as well as a <a href="#dfn-thresholdreached-event"><code>thresholdreached</code></a> event to be notified when the amount of data available for read has fallen below a specified threshold.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1128
	</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1129
	<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1130
		When the <code>StreamBuilder(in contentType)</code> constructor is invoked, the user agent <em class="rfc2119" title="must">must</em> return a new <a href="#idl-def-StreamBuilder" class="idlType"><code>StreamBuilder</code></a> object. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1131
		If the <code>StreamBuilder(in contentType)</code> constructor is invoked with the optional <code>thresholdLimit</code> overload, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1132
		then this limit will be used to fire the <a href="#dfn-thresholdreached-event"><code>thresholdreached</code></a> event.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1133
	</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1134
	<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1135
		In environments where the global object is represented by a <a href="http://dev.w3.org/html5/workers/#workerglobalscope"><code>WorkerGlobalScope</code></a> object, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1136
		the <code>StreamBuilder()</code> constructor <em class="rfc2119" title="must">must</em> be available.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1137
	</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1138
	<pre class="idl"><span class="idlInterface" id="idl-def-StreamBuilder">[<span class="extAttr">Constructor, Constructor(DOMString contentType, optional int thresholdLimit)</span>]
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1139
interface <span class="idlInterfaceID">StreamBuilder</span> : <span class="idlSuperclass"><a>EventTarget</a></span> {
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1140
<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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1141
<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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1142
<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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1143
<span class="idlMethod">    <span class="idlMethType"><a>void</a></span> <span class="idlMethName"><a href="#widl-StreamBuilder-close-void">close</a></span> ();</span>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1144
<span class="idlAttribute">    readonly attribute <span class="idlAttrType"><a href="#idl-def-Stream" class="idlType"><code>Stream</code></a></span>             <span class="idlAttrName"><a href="#widl-StreamBuilder-stream">stream</a></span>;</span>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1145
<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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1146
<span class="idlAttribute">             attribute <span class="idlAttrType"><a>Function</a></span>           <span class="idlAttrName"><a href="#widl-StreamBuilder-onthresholdreached">onthresholdreached</a></span>;</span>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1147
};</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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1148
			Handler for <a href="#dfn-thresholdreached-event"><code>thresholdreached</code></a> events.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1149
		</dd><dt id="widl-StreamBuilder-stream"><code>stream</code> of type <span class="idlAttrType"><a href="#idl-def-Stream" class="idlType"><code>Stream</code></a></span>, readonly</dt><dd>Returns the underlying <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a> represented by the <a href="#idl-def-StreamBuilder" class="idlType"><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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1150
			<p></p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1151
			<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1152
				Appends the supplied text to the data available for the <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a>, writing it as UTF-8.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1153
			</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1154
			<p></p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1155
			
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1156
			<dl class="exception" title="OperationNotAllowedException">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1157
				<dt></dt>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1158
				<dd>Thrown if append is called on a closed StreamBuilder</dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1159
			</dl>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1160
		<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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1161
			<p></p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1162
			<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1163
				Appends the supplied <code>Blob</code> to the data available for the <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a>.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1164
			</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1165
			<p></p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1166
			
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1167
			<dl class="exception" title="OperationNotAllowedException">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1168
				<dt></dt>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1169
				<dd>Thrown if append is called on a closed StreamBuilder</dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1170
			</dl>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1171
		<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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1172
			<p></p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1173
			<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1174
				Appends the supplied <code>ArrayBuffer</code> to the data available for the <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a>.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1175
			</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1176
			<p></p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1177
			
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1178
			<dl class="exception" title="OperationNotAllowedException">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1179
				<dt></dt>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1180
				<dd>Thrown if append is called on a closed StreamBuilder</dd>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1181
			</dl>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1182
		<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 href="#idl-def-Stream" class="idlType"><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>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1183
	
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1184
	<section class="section" id="reads-on-a-stream-from-streambuilder">
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1185
			<h3><span class="secno">7.3 </span>Reads on a Stream from StreamBuilder</h3>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1186
			<p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1187
				When a read on a stream from <a href="#idl-def-StreamBuilder" class="idlType"><code>StreamBuilder</code></a> is made, the following steps <em class="rfc2119" title="must">must</em> be followed:
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1188
			</p>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1189
				<ol>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1190
					<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1191
						If there is enough data available to satisfy the amount requested in the read, return the amount specified.	The data should be returned in the order the data was appended.
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1192
						<ul>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1193
							<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1194
								Update the value of <a href="#widl-StreamBuilder-availableDataSize"><code>availableDataSize</code></a>. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1195
							</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1196
						</ul>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1197
					</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1198
					<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1199
						If there is not enough data available to satisfy the amount requested in the read:
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1200
						<ul>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1201
							<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1202
								If the <a href="#idl-def-Stream" class="idlType"><code>Stream</code></a> has been closed, return all the data available, 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1203
								and set <a href="#widl-StreamBuilder-availableDataSize"><code>availableDataSize</code></a> to zero.</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1204
							<li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1205
								Else, keep the request pending and do not return until there is enough data available to satisfy the requset. 
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1206
								
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmail.com>
parents:
diff changeset
  1207
							</li>
f99aafc91a32 First complete update to prep for FPWD
fmoussa <feras.moussa@hotmai