[html5] r8454 - [e] (0) First hack attempt at converting from referring to the old TypedArray sp [...]
whatwg at whatwg.org
whatwg at whatwg.org
Mon Feb 3 15:16:13 PST 2014
Author: ianh
Date: 2014-02-03 15:16:12 -0800 (Mon, 03 Feb 2014)
New Revision: 8454
Modified:
complete.html
index
source
Log:
[e] (0) First hack attempt at converting from referring to the old TypedArray spec to referring to the JS spec's version. I couldn't work out how to actually do a good job of referring to all the JS algorithms, so please file bugs with proposed replacement text for anything that's poorly done.
Affected topics: Canvas, DOM APIs, HTML
Modified: complete.html
===================================================================
--- complete.html 2014-02-03 21:39:32 UTC (rev 8453)
+++ complete.html 2014-02-03 23:16:12 UTC (rev 8454)
@@ -3665,6 +3665,19 @@
<p>The ECMAScript <dfn id=js-syntaxerror title=js-SyntaxError><code>SyntaxError</code></dfn> exception is also
defined in the ECMAScript specification. <a href=#refsECMA262>[ECMA262]</a></p>
+ <p>The <dfn id=arraybuffer>ArrayBuffer</dfn> and related object types and underlying concepts from the
+ ECMAScript Specification are used for several features in this specification. <a href=#refsECMA262>[ECMA262]</a></p>
+
+ <p>The following helper IDL is used for referring to <code><a href=#arraybuffer>ArrayBuffer</a></code>-related types:</p>
+
+ <pre class=idl>typedef (<dfn id=int8array>Int8Array</dfn> or <dfn id=uint8array>Uint8Array</dfn> or <dfn id=uint8clampedarray>Uint8ClampedArray</dfn> or
+ <dfn id=int16array>Int16Array</dfn> or <dfn id=uint16array>Uint16Array</dfn> or
+ <dfn id=int32array>Int32Array</dfn> or <dfn id=uint32array>Uint32Array</dfn> or
+ <dfn id=float32array>Float32Array</dfn> or <dfn id=float64array>Float64Array</dfn>) <dfn id=arraybufferview>ArrayBufferView</dfn>;</pre>
+
+ <p class=note>In particular, the <code><a href=#uint8clampedarray>Uint8ClampedArray</a></code> type is used by some <a href=#imagedata title=ImageData>2D canvas APIs</a>, and the <a href=#network><code>WebSocket</code>
+ API</a> uses <code><a href=#arraybuffer>ArrayBuffer</a></code> objects for handling binary frames.</p>
+
</dd>
@@ -3826,18 +3839,7 @@
</ul></dd>
- <dt>Typed Arrays</dt>
- <dd>
-
- <p>The <dfn id=arraybuffer>ArrayBuffer</dfn> and <dfn id=arraybufferview>ArrayBufferView</dfn> interfaces and underlying concepts
- from the Typed Array Specification are used for several features in this specification. The
- <dfn id=uint8clampedarray>Uint8ClampedArray</dfn> interface type is specifically used in the definition of the
- <code><a href=#the-canvas-element>canvas</a></code> element's 2D API. <a href=#refsTYPEDARRAY>[TYPEDARRAY]</a></p>
-
- </dd>
-
-
<dt>File API</dt>
<dd>
@@ -8110,6 +8112,7 @@
<h4 id=transferable-objects><span class=secno>2.7.5 </span>Transferable objects</h4>
+<!--CLEANUP-->
<p>Some objects support being copied and closed in one operation.
This is called <i>transferring</i> the object, and is used in
particular to transfer ownership of unsharable or expensive
@@ -8117,19 +8120,16 @@
<p>The following <code><a href=#transferable>Transferable</a></code> types exist:</p>
- <ul class=brief><li><code><a href=#arraybuffer>ArrayBuffer</a></code> <a href=#refsTYPEDARRAY>[TYPEDARRAY]</a>
+ <ul class=brief><li><code><a href=#arraybuffer>ArrayBuffer</a></code> <a href=#refsECMA262>[ECMA262]</a>
<li><code><a href=#canvasproxy>CanvasProxy</a></code> (defined in this specification)
<li><code><a href=#messageport>MessagePort</a></code> (defined in this specification)
</ul><div class=impl>
<p>The following IDL block formalizes this:</p>
- <pre class=idl>[NoInterfaceObject]
-interface <dfn id=transferable>Transferable</dfn> { };
-<a href=#arraybuffer>ArrayBuffer</a> implements <a href=#transferable>Transferable</a>;
-<a href=#canvasproxy>CanvasProxy</a> implements <a href=#transferable>Transferable</a>;
-<a href=#messageport>MessagePort</a> implements <a href=#transferable>Transferable</a>;</pre>
+ <pre class=idl>typedef (<a href=#arraybuffer>ArrayBuffer</a> or <a href=#canvasproxy>CanvasProxy</a> or <a href=#messageport>MessagePort</a>) <dfn id=transferable>Transferable</dfn>;</pre>
+<!--CLEANUP-->
<p>To <dfn id=transfer-a-transferable-object>transfer a <code>Transferable</code> object</dfn> to a
new owner, the user agent must run the steps defined for the type of
object in question. The steps will return a new object of the same
@@ -8142,7 +8142,8 @@
<code><a href=#arraybuffer>ArrayBuffer</a></code> object <var title="">old</var> to a new owner <var title="">owner</var>,
a user agent must create a new <code><a href=#arraybuffer>ArrayBuffer</a></code> object pointing at the same underlying
data as <var title="">old</var>, thus obtaining <var title="">new</var>, must <a href=#concept-transferable-neutered title=concept-Transferable-neutered>neuter</a> the <var title="">old</var> object, and must
- finally return <var title="">new</var>. <a href=#refsTYPEDARRAY>[TYPEDARRAY]</a></p>
+ finally return <var title="">new</var>. <a href=#refsECMA262>[ECMA262]</a></p>
+ <!-- I'm expecting this section to move to the JS spec eventually so I'm leaving it as is for now -->
<p class=note>Rules for how to <a href=#transferCanvasProxy>transfer a
<code>CanvasProxy</code> object</a> and how to <a href=#transferMessagePort>transfer a
@@ -8255,17 +8256,20 @@
exception and abort the overall <a href=#structured-clone>structured clone</a> algorithm. Otherwise, let <var title="">output</var> be a newly constructed <code><a href=#arraybuffer>ArrayBuffer</a></code> object whose contents
are a copy of <var title="">input</var>'s contents, with the same length.</dd>
- <dt>If <var title="">input</var> is an <code><a href=#arraybufferview>ArrayBufferView</a></code> object</dt>
+ <dt>If <var title="">input</var> is an object with a [[DataView]] internal slot</dt>
<dd>
- <p>Let <var title="">output</var> be a newly constructed object of the same class as <var title="">input</var>, with each IDL attribute defined for that class being set to the value
- obtained from invoking the <a href=#internal-structured-cloning-algorithm>internal structured cloning algorithm</a> recursively with
- the value of the attribute on <var title="">input</var> as the new "<var title="">input</var>" argument and <var title="">memory</var> as the new "<var title="">memory</var>" argument.</p>
+ <p>Let <var title="">output</var> be a newly constructed object of the same class as <var title="">input</var>, with its [[DataView]] internal property present, its
+ [[ViewedArrayBuffer]] internal property set to the value obtained from invoking the
+ <a href=#internal-structured-cloning-algorithm>internal structured cloning algorithm</a> recursively with the value of the internal
+ property on <var title="">input</var> as the new "<var title="">input</var>" argument and
+ <var title="">memory</var> as the new "<var title="">memory</var>" argument, and with the
+ [[ByteLength]] and [[ByteOffset]] internal properties set to the same value as their
+ counterparts on <var title="">input</var>.</p>
- <p class=note>Only IDL attributes defined on the class (including the
- <code><a href=#arraybufferview>ArrayBufferView</a></code> attributes) are cloned. Properties added by a script, for
- example, are not cloned.</p>
+ <!-- the above might not make much sense, but it'll become moot when JS takes over defining
+ how to clone ArrayBufferView objects -->
</dd>
@@ -59057,14 +59061,14 @@
<code>ArrayBuffer</code></a> for its storage, and must have a zero start offset and a length
equal to the length of its storage, in bytes. The <a href=#canvas-pixel-arraybuffer>Canvas Pixel
<code>ArrayBuffer</code></a> must contain the image data. At least one pixel's worth of image
- data must be returned. <a href=#refsTYPEDARRAY>[TYPEDARRAY]</a></p>
+ data must be returned. <a href=#refsECMA262>[ECMA262]</a></p>
<p>A <dfn id=canvas-pixel-arraybuffer>Canvas Pixel <code>ArrayBuffer</code></dfn> is an <code><a href=#arraybuffer>ArrayBuffer</a></code> that whose
data is represented in left-to-right order, row by row top to bottom, starting with the top left,
with each pixel's red, green, blue, and alpha components being given in that order for each pixel.
Each component of each pixel represented in this array must be in the range 0..255, representing
the 8 bit value for that component. The components must be assigned consecutive indices starting
- with 0 for the top left pixel's red component. <a href=#refsTYPEDARRAY>[TYPEDARRAY]</a></p>
+ with 0 for the top left pixel's red component. <a href=#refsECMA262>[ECMA262]</a></p>
<p>The <dfn id=dom-context-2d-putimagedata title=dom-context-2d-putImageData><code>putImageData()</code></dfn> method writes
data from <code><a href=#imagedata>ImageData</a></code> structures back to the rendering context's <a href=#scratch-bitmap>scratch
@@ -80490,28 +80494,25 @@
<dd>
+<!--CLEANUP-->
<p>If <i><a href=#the-websocket-connection-is-established>the WebSocket connection is established</a></i>, and <i title="the WebSocket closing
handshake is started"><a href=#the-websocket-closing-handshake-is-started>the WebSocket closing handshake has not yet started</a></i>, then the user
agent must <i>send a WebSocket Message</i> comprised of <var title="">data</var> using a binary
frame opcode; if the data cannot be sent, e.g. because it would need to be buffered but the
buffer is full, the user agent must <a href=#concept-websocket-close-fail title=concept-websocket-close-fail>flag the
WebSocket as full</a> and then <i><a href=#close-the-websocket-connection>close the WebSocket connection</a></i>. The data to be sent is
- the data stored in the buffer described by the <code><a href=#arraybuffer>ArrayBuffer</a></code> object. <!-- that
- sentence is meant to invoke "The ArrayBuffer type describes a buffer used to store data for the
- array buffer views." at the top of the Typed Array spec, and "Optional byteOffset and length can
- be used to limit the section of the buffer referenced" in the definition of the TypedArray
- constructor --> Any invocation of this method with an <code><a href=#arraybuffer>ArrayBuffer</a></code> argument that
+ the data stored in the buffer described by the <code><a href=#arraybuffer>ArrayBuffer</a></code> object. Any invocation of this method with an <code><a href=#arraybuffer>ArrayBuffer</a></code> argument that
does not throw an exception must increase the <code title=dom-WebSocket-bufferedAmount><a href=#dom-websocket-bufferedamount>bufferedAmount</a></code> attribute by the length of the
- <code><a href=#arraybuffer>ArrayBuffer</a></code> in bytes. <!-- that sentence is meant to invoke the same as
- ArrayBuffer.byteLength --> <a href=#refsWSP>[WSP]</a> <a href=#refsTYPEDARRAY>[TYPEDARRAY]</a></p>
+ <code><a href=#arraybuffer>ArrayBuffer</a></code> in bytes. <a href=#refsWSP>[WSP]</a> <a href=#refsECMA262>[ECMA262]</a></p>
</dd>
- <dt>If the argument is an <code><a href=#arraybufferview>ArrayBufferView</a></code> object</dt>
+ <dt>If the argument is an object that matches the <code><a href=#arraybufferview>ArrayBufferView</a></code> type definition</dt>
<dd>
+<!--CLEANUP-->
<p>If <i><a href=#the-websocket-connection-is-established>the WebSocket connection is established</a></i>, and <i title="the WebSocket closing
handshake is started"><a href=#the-websocket-closing-handshake-is-started>the WebSocket closing handshake has not yet started</a></i>, then the user
agent must <i>send a WebSocket Message</i> comprised of <var title="">data</var> using a binary
@@ -80519,14 +80520,10 @@
buffer is full, the user agent must <a href=#concept-websocket-close-fail title=concept-websocket-close-fail>flag the
WebSocket as full</a> and then <i><a href=#close-the-websocket-connection>close the WebSocket connection</a></i>. The data to be sent is
the data stored in the section of the buffer described by the <code><a href=#arraybuffer>ArrayBuffer</a></code> object
- that the <code><a href=#arraybufferview>ArrayBufferView</a></code> object references. <!-- that sentence is meant to invoke
- "The ArrayBuffer type describes a buffer used to store data for the array buffer views." at the
- top of the Typed Array spec, and "Optional byteOffset and length can be used to limit the
- section of the buffer referenced" in the definition of the TypedArray constructor --> Any
- invocation of this method with an <code><a href=#arraybufferview>ArrayBufferView</a></code> argument that does not throw an
+ that <var title="">data</var> references. Any
+ invocation of this method with this kind of argument that does not throw an
exception must increase the <code title=dom-WebSocket-bufferedAmount><a href=#dom-websocket-bufferedamount>bufferedAmount</a></code>
- attribute by the length of the <code><a href=#arraybufferview>ArrayBufferView</a></code> in bytes. <!-- that sentence is
- meant to invoke the same as ArrayBufferView.byteLength --> <a href=#refsWSP>[WSP]</a> <a href=#refsTYPEDARRAY>[TYPEDARRAY]</a></p>
+ attribute by the length of <var title="">data</var>'s buffer in bytes. <a href=#refsWSP>[WSP]</a> <a href=#refsECMA262>[ECMA262]</a></p>
</dd>
@@ -80598,8 +80595,8 @@
initialize <var title="">event</var>'s <code title=dom-MessageEvent-data><a href=#dom-messageevent-data>data</a></code> attribute
to a new <code><a href=#blob>Blob</a></code> object that represents <var title="">data</var> as its raw data. <a href=#refsFILEAPI>[FILEAPI]</a></p>
- <p>If <var title="">type</var> indicates that the data is Binary, and <code title=dom-WebSocket-binaryType><a href=#dom-websocket-binarytype>binaryType</a></code> is set to "<code title="">arraybuffer</code>", then initialize <var title="">event</var>'s <code title=dom-MessageEvent-data><a href=#dom-messageevent-data>data</a></code> attribute to a new read-only <code><a href=#arraybuffer>ArrayBuffer</a></code>
- object whose contents are <var title="">data</var>. <a href=#refsTYPEDARRAY>[TYPEDARRAY]</a></p>
+ <p>If <var title="">type</var> indicates that the data is Binary, and <code title=dom-WebSocket-binaryType><a href=#dom-websocket-binarytype>binaryType</a></code> is set to "<code title="">arraybuffer</code>", then initialize <var title="">event</var>'s <code title=dom-MessageEvent-data><a href=#dom-messageevent-data>data</a></code> attribute to a new read-only <code><a href=#arraybuffer>ArrayBuffer</a></code> <!-- XXXX -->
+ object whose contents are <var title="">data</var>. <a href=#refsECMA262>[ECMA262]</a></p>
</li>
@@ -102390,7 +102387,6 @@
<li><code><a href=#texttracklist>TextTrackList</a></code>
<li><code><a href=#timeranges>TimeRanges</a></code>
<li><code><a href=#trackevent>TrackEvent</a></code>
- <li><code><a href=#transferable>Transferable</a></code>
<li><code><a href=#validitystate>ValidityState</a></code>
<li><code><a href=#videotrack>VideoTrack</a></code>
<li><code><a href=#videotracklist>VideoTrackList</a></code>
@@ -102993,9 +102989,6 @@
<dt id=refsTOR>[TOR]</dt>
<dd>(Non-normative) <cite><a href=https://www.torproject.org/>Tor</a></cite>.</dd>
- <dt id=refsTYPEDARRAY>[TYPEDARRAY]</dt>
- <dd><cite><a href=http://www.khronos.org/registry/typedarray/specs/latest/>Typed Array Specification</a></cite>, D. Herman, K. Russell. Khronos.</dd>
-
<dt id=refsTZDATABASE>[TZDATABASE]</dt>
<dd>(Non-normative) <cite><a href=http://www.iana.org/time-zones>Time Zone Database</a></cite>. IANA.</dd>
Modified: index
===================================================================
--- index 2014-02-03 21:39:32 UTC (rev 8453)
+++ index 2014-02-03 23:16:12 UTC (rev 8454)
@@ -3665,6 +3665,19 @@
<p>The ECMAScript <dfn id=js-syntaxerror title=js-SyntaxError><code>SyntaxError</code></dfn> exception is also
defined in the ECMAScript specification. <a href=#refsECMA262>[ECMA262]</a></p>
+ <p>The <dfn id=arraybuffer>ArrayBuffer</dfn> and related object types and underlying concepts from the
+ ECMAScript Specification are used for several features in this specification. <a href=#refsECMA262>[ECMA262]</a></p>
+
+ <p>The following helper IDL is used for referring to <code><a href=#arraybuffer>ArrayBuffer</a></code>-related types:</p>
+
+ <pre class=idl>typedef (<dfn id=int8array>Int8Array</dfn> or <dfn id=uint8array>Uint8Array</dfn> or <dfn id=uint8clampedarray>Uint8ClampedArray</dfn> or
+ <dfn id=int16array>Int16Array</dfn> or <dfn id=uint16array>Uint16Array</dfn> or
+ <dfn id=int32array>Int32Array</dfn> or <dfn id=uint32array>Uint32Array</dfn> or
+ <dfn id=float32array>Float32Array</dfn> or <dfn id=float64array>Float64Array</dfn>) <dfn id=arraybufferview>ArrayBufferView</dfn>;</pre>
+
+ <p class=note>In particular, the <code><a href=#uint8clampedarray>Uint8ClampedArray</a></code> type is used by some <a href=#imagedata title=ImageData>2D canvas APIs</a>, and the <a href=#network><code>WebSocket</code>
+ API</a> uses <code><a href=#arraybuffer>ArrayBuffer</a></code> objects for handling binary frames.</p>
+
</dd>
@@ -3826,18 +3839,7 @@
</ul></dd>
- <dt>Typed Arrays</dt>
- <dd>
-
- <p>The <dfn id=arraybuffer>ArrayBuffer</dfn> and <dfn id=arraybufferview>ArrayBufferView</dfn> interfaces and underlying concepts
- from the Typed Array Specification are used for several features in this specification. The
- <dfn id=uint8clampedarray>Uint8ClampedArray</dfn> interface type is specifically used in the definition of the
- <code><a href=#the-canvas-element>canvas</a></code> element's 2D API. <a href=#refsTYPEDARRAY>[TYPEDARRAY]</a></p>
-
- </dd>
-
-
<dt>File API</dt>
<dd>
@@ -8110,6 +8112,7 @@
<h4 id=transferable-objects><span class=secno>2.7.5 </span>Transferable objects</h4>
+<!--CLEANUP-->
<p>Some objects support being copied and closed in one operation.
This is called <i>transferring</i> the object, and is used in
particular to transfer ownership of unsharable or expensive
@@ -8117,19 +8120,16 @@
<p>The following <code><a href=#transferable>Transferable</a></code> types exist:</p>
- <ul class=brief><li><code><a href=#arraybuffer>ArrayBuffer</a></code> <a href=#refsTYPEDARRAY>[TYPEDARRAY]</a>
+ <ul class=brief><li><code><a href=#arraybuffer>ArrayBuffer</a></code> <a href=#refsECMA262>[ECMA262]</a>
<li><code><a href=#canvasproxy>CanvasProxy</a></code> (defined in this specification)
<li><code><a href=#messageport>MessagePort</a></code> (defined in this specification)
</ul><div class=impl>
<p>The following IDL block formalizes this:</p>
- <pre class=idl>[NoInterfaceObject]
-interface <dfn id=transferable>Transferable</dfn> { };
-<a href=#arraybuffer>ArrayBuffer</a> implements <a href=#transferable>Transferable</a>;
-<a href=#canvasproxy>CanvasProxy</a> implements <a href=#transferable>Transferable</a>;
-<a href=#messageport>MessagePort</a> implements <a href=#transferable>Transferable</a>;</pre>
+ <pre class=idl>typedef (<a href=#arraybuffer>ArrayBuffer</a> or <a href=#canvasproxy>CanvasProxy</a> or <a href=#messageport>MessagePort</a>) <dfn id=transferable>Transferable</dfn>;</pre>
+<!--CLEANUP-->
<p>To <dfn id=transfer-a-transferable-object>transfer a <code>Transferable</code> object</dfn> to a
new owner, the user agent must run the steps defined for the type of
object in question. The steps will return a new object of the same
@@ -8142,7 +8142,8 @@
<code><a href=#arraybuffer>ArrayBuffer</a></code> object <var title="">old</var> to a new owner <var title="">owner</var>,
a user agent must create a new <code><a href=#arraybuffer>ArrayBuffer</a></code> object pointing at the same underlying
data as <var title="">old</var>, thus obtaining <var title="">new</var>, must <a href=#concept-transferable-neutered title=concept-Transferable-neutered>neuter</a> the <var title="">old</var> object, and must
- finally return <var title="">new</var>. <a href=#refsTYPEDARRAY>[TYPEDARRAY]</a></p>
+ finally return <var title="">new</var>. <a href=#refsECMA262>[ECMA262]</a></p>
+ <!-- I'm expecting this section to move to the JS spec eventually so I'm leaving it as is for now -->
<p class=note>Rules for how to <a href=#transferCanvasProxy>transfer a
<code>CanvasProxy</code> object</a> and how to <a href=#transferMessagePort>transfer a
@@ -8255,17 +8256,20 @@
exception and abort the overall <a href=#structured-clone>structured clone</a> algorithm. Otherwise, let <var title="">output</var> be a newly constructed <code><a href=#arraybuffer>ArrayBuffer</a></code> object whose contents
are a copy of <var title="">input</var>'s contents, with the same length.</dd>
- <dt>If <var title="">input</var> is an <code><a href=#arraybufferview>ArrayBufferView</a></code> object</dt>
+ <dt>If <var title="">input</var> is an object with a [[DataView]] internal slot</dt>
<dd>
- <p>Let <var title="">output</var> be a newly constructed object of the same class as <var title="">input</var>, with each IDL attribute defined for that class being set to the value
- obtained from invoking the <a href=#internal-structured-cloning-algorithm>internal structured cloning algorithm</a> recursively with
- the value of the attribute on <var title="">input</var> as the new "<var title="">input</var>" argument and <var title="">memory</var> as the new "<var title="">memory</var>" argument.</p>
+ <p>Let <var title="">output</var> be a newly constructed object of the same class as <var title="">input</var>, with its [[DataView]] internal property present, its
+ [[ViewedArrayBuffer]] internal property set to the value obtained from invoking the
+ <a href=#internal-structured-cloning-algorithm>internal structured cloning algorithm</a> recursively with the value of the internal
+ property on <var title="">input</var> as the new "<var title="">input</var>" argument and
+ <var title="">memory</var> as the new "<var title="">memory</var>" argument, and with the
+ [[ByteLength]] and [[ByteOffset]] internal properties set to the same value as their
+ counterparts on <var title="">input</var>.</p>
- <p class=note>Only IDL attributes defined on the class (including the
- <code><a href=#arraybufferview>ArrayBufferView</a></code> attributes) are cloned. Properties added by a script, for
- example, are not cloned.</p>
+ <!-- the above might not make much sense, but it'll become moot when JS takes over defining
+ how to clone ArrayBufferView objects -->
</dd>
@@ -59057,14 +59061,14 @@
<code>ArrayBuffer</code></a> for its storage, and must have a zero start offset and a length
equal to the length of its storage, in bytes. The <a href=#canvas-pixel-arraybuffer>Canvas Pixel
<code>ArrayBuffer</code></a> must contain the image data. At least one pixel's worth of image
- data must be returned. <a href=#refsTYPEDARRAY>[TYPEDARRAY]</a></p>
+ data must be returned. <a href=#refsECMA262>[ECMA262]</a></p>
<p>A <dfn id=canvas-pixel-arraybuffer>Canvas Pixel <code>ArrayBuffer</code></dfn> is an <code><a href=#arraybuffer>ArrayBuffer</a></code> that whose
data is represented in left-to-right order, row by row top to bottom, starting with the top left,
with each pixel's red, green, blue, and alpha components being given in that order for each pixel.
Each component of each pixel represented in this array must be in the range 0..255, representing
the 8 bit value for that component. The components must be assigned consecutive indices starting
- with 0 for the top left pixel's red component. <a href=#refsTYPEDARRAY>[TYPEDARRAY]</a></p>
+ with 0 for the top left pixel's red component. <a href=#refsECMA262>[ECMA262]</a></p>
<p>The <dfn id=dom-context-2d-putimagedata title=dom-context-2d-putImageData><code>putImageData()</code></dfn> method writes
data from <code><a href=#imagedata>ImageData</a></code> structures back to the rendering context's <a href=#scratch-bitmap>scratch
@@ -80490,28 +80494,25 @@
<dd>
+<!--CLEANUP-->
<p>If <i><a href=#the-websocket-connection-is-established>the WebSocket connection is established</a></i>, and <i title="the WebSocket closing
handshake is started"><a href=#the-websocket-closing-handshake-is-started>the WebSocket closing handshake has not yet started</a></i>, then the user
agent must <i>send a WebSocket Message</i> comprised of <var title="">data</var> using a binary
frame opcode; if the data cannot be sent, e.g. because it would need to be buffered but the
buffer is full, the user agent must <a href=#concept-websocket-close-fail title=concept-websocket-close-fail>flag the
WebSocket as full</a> and then <i><a href=#close-the-websocket-connection>close the WebSocket connection</a></i>. The data to be sent is
- the data stored in the buffer described by the <code><a href=#arraybuffer>ArrayBuffer</a></code> object. <!-- that
- sentence is meant to invoke "The ArrayBuffer type describes a buffer used to store data for the
- array buffer views." at the top of the Typed Array spec, and "Optional byteOffset and length can
- be used to limit the section of the buffer referenced" in the definition of the TypedArray
- constructor --> Any invocation of this method with an <code><a href=#arraybuffer>ArrayBuffer</a></code> argument that
+ the data stored in the buffer described by the <code><a href=#arraybuffer>ArrayBuffer</a></code> object. Any invocation of this method with an <code><a href=#arraybuffer>ArrayBuffer</a></code> argument that
does not throw an exception must increase the <code title=dom-WebSocket-bufferedAmount><a href=#dom-websocket-bufferedamount>bufferedAmount</a></code> attribute by the length of the
- <code><a href=#arraybuffer>ArrayBuffer</a></code> in bytes. <!-- that sentence is meant to invoke the same as
- ArrayBuffer.byteLength --> <a href=#refsWSP>[WSP]</a> <a href=#refsTYPEDARRAY>[TYPEDARRAY]</a></p>
+ <code><a href=#arraybuffer>ArrayBuffer</a></code> in bytes. <a href=#refsWSP>[WSP]</a> <a href=#refsECMA262>[ECMA262]</a></p>
</dd>
- <dt>If the argument is an <code><a href=#arraybufferview>ArrayBufferView</a></code> object</dt>
+ <dt>If the argument is an object that matches the <code><a href=#arraybufferview>ArrayBufferView</a></code> type definition</dt>
<dd>
+<!--CLEANUP-->
<p>If <i><a href=#the-websocket-connection-is-established>the WebSocket connection is established</a></i>, and <i title="the WebSocket closing
handshake is started"><a href=#the-websocket-closing-handshake-is-started>the WebSocket closing handshake has not yet started</a></i>, then the user
agent must <i>send a WebSocket Message</i> comprised of <var title="">data</var> using a binary
@@ -80519,14 +80520,10 @@
buffer is full, the user agent must <a href=#concept-websocket-close-fail title=concept-websocket-close-fail>flag the
WebSocket as full</a> and then <i><a href=#close-the-websocket-connection>close the WebSocket connection</a></i>. The data to be sent is
the data stored in the section of the buffer described by the <code><a href=#arraybuffer>ArrayBuffer</a></code> object
- that the <code><a href=#arraybufferview>ArrayBufferView</a></code> object references. <!-- that sentence is meant to invoke
- "The ArrayBuffer type describes a buffer used to store data for the array buffer views." at the
- top of the Typed Array spec, and "Optional byteOffset and length can be used to limit the
- section of the buffer referenced" in the definition of the TypedArray constructor --> Any
- invocation of this method with an <code><a href=#arraybufferview>ArrayBufferView</a></code> argument that does not throw an
+ that <var title="">data</var> references. Any
+ invocation of this method with this kind of argument that does not throw an
exception must increase the <code title=dom-WebSocket-bufferedAmount><a href=#dom-websocket-bufferedamount>bufferedAmount</a></code>
- attribute by the length of the <code><a href=#arraybufferview>ArrayBufferView</a></code> in bytes. <!-- that sentence is
- meant to invoke the same as ArrayBufferView.byteLength --> <a href=#refsWSP>[WSP]</a> <a href=#refsTYPEDARRAY>[TYPEDARRAY]</a></p>
+ attribute by the length of <var title="">data</var>'s buffer in bytes. <a href=#refsWSP>[WSP]</a> <a href=#refsECMA262>[ECMA262]</a></p>
</dd>
@@ -80598,8 +80595,8 @@
initialize <var title="">event</var>'s <code title=dom-MessageEvent-data><a href=#dom-messageevent-data>data</a></code> attribute
to a new <code><a href=#blob>Blob</a></code> object that represents <var title="">data</var> as its raw data. <a href=#refsFILEAPI>[FILEAPI]</a></p>
- <p>If <var title="">type</var> indicates that the data is Binary, and <code title=dom-WebSocket-binaryType><a href=#dom-websocket-binarytype>binaryType</a></code> is set to "<code title="">arraybuffer</code>", then initialize <var title="">event</var>'s <code title=dom-MessageEvent-data><a href=#dom-messageevent-data>data</a></code> attribute to a new read-only <code><a href=#arraybuffer>ArrayBuffer</a></code>
- object whose contents are <var title="">data</var>. <a href=#refsTYPEDARRAY>[TYPEDARRAY]</a></p>
+ <p>If <var title="">type</var> indicates that the data is Binary, and <code title=dom-WebSocket-binaryType><a href=#dom-websocket-binarytype>binaryType</a></code> is set to "<code title="">arraybuffer</code>", then initialize <var title="">event</var>'s <code title=dom-MessageEvent-data><a href=#dom-messageevent-data>data</a></code> attribute to a new read-only <code><a href=#arraybuffer>ArrayBuffer</a></code> <!-- XXXX -->
+ object whose contents are <var title="">data</var>. <a href=#refsECMA262>[ECMA262]</a></p>
</li>
@@ -102390,7 +102387,6 @@
<li><code><a href=#texttracklist>TextTrackList</a></code>
<li><code><a href=#timeranges>TimeRanges</a></code>
<li><code><a href=#trackevent>TrackEvent</a></code>
- <li><code><a href=#transferable>Transferable</a></code>
<li><code><a href=#validitystate>ValidityState</a></code>
<li><code><a href=#videotrack>VideoTrack</a></code>
<li><code><a href=#videotracklist>VideoTrackList</a></code>
@@ -102993,9 +102989,6 @@
<dt id=refsTOR>[TOR]</dt>
<dd>(Non-normative) <cite><a href=https://www.torproject.org/>Tor</a></cite>.</dd>
- <dt id=refsTYPEDARRAY>[TYPEDARRAY]</dt>
- <dd><cite><a href=http://www.khronos.org/registry/typedarray/specs/latest/>Typed Array Specification</a></cite>, D. Herman, K. Russell. Khronos.</dd>
-
<dt id=refsTZDATABASE>[TZDATABASE]</dt>
<dd>(Non-normative) <cite><a href=http://www.iana.org/time-zones>Time Zone Database</a></cite>. IANA.</dd>
Modified: source
===================================================================
--- source 2014-02-03 21:39:32 UTC (rev 8453)
+++ source 2014-02-03 23:16:12 UTC (rev 8454)
@@ -12,32 +12,8 @@
! - adding it to the section with ARIA mappings
!
!-->
-<!--DEFER snapshot complete-->
-<!--START validation-->
+<!--BOILERPLATE middle-internals-->
-<pre class="idl">
- interface Screen { }; // CSSOM
- interface URL { }; // URL API
- interface Blob { }; // File API
- interface File : Blob { }; // File API
- interface FileList { }; // File API
- interface WebGLRenderingContext { }; // WebGL
- interface ArrayBuffer { }; // TypedArray
- interface ArrayBufferView { }; // TypedArray
- interface Uint8ClampedArray { }; // TypedArray
- interface XMLDocument { }; // DOM
- interface HTMLCollection { }; // DOM
- interface DOMTokenList { }; // DOM
- interface DOMSettableTokenList { attribute any value; }; // DOM
- interface SVGMatrix { }; // SVG
-</pre>
-
-<!--START complete--><!--START dev-html-->
-
-<!--START storage-->
-<!--SET FINGERPRINT=<span data-x="fingerprinting vector" class="fingerprint"><img src="images/fingerprint.png" alt="(This is a fingerprinting vector.)" width=46 height=64></span>-->
-<!--END storage-->
-
<h2 id="introduction">Introduction</h2>
<!--END dev-html-->
@@ -2401,6 +2377,21 @@
<p>The ECMAScript <dfn data-x="js-SyntaxError"><code>SyntaxError</code></dfn> exception is also
defined in the ECMAScript specification. <a href="#refsECMA262">[ECMA262]</a></p>
+ <p>The <dfn>ArrayBuffer</dfn> and related object types and underlying concepts from the
+ ECMAScript Specification are used for several features in this specification. <a
+ href="#refsECMA262">[ECMA262]</a></p>
+
+ <p>The following helper IDL is used for referring to <code>ArrayBuffer</code>-related types:</p>
+
+ <pre class="idl">typedef (<dfn>Int8Array</dfn> or <dfn>Uint8Array</dfn> or <dfn>Uint8ClampedArray</dfn> or
+ <dfn>Int16Array</dfn> or <dfn>Uint16Array</dfn> or
+ <dfn>Int32Array</dfn> or <dfn>Uint32Array</dfn> or
+ <dfn>Float32Array</dfn> or <dfn>Float64Array</dfn>) <dfn>ArrayBufferView</dfn>;</pre>
+
+ <p class="note">In particular, the <code>Uint8ClampedArray</code> type is used by some <span
+ data-x="ImageData">2D canvas APIs</span>, and the <a href="#network"><code>WebSocket</code>
+ API</a> uses <code>ArrayBuffer</code> objects for handling binary frames.</p>
+
</dd>
@@ -2586,18 +2577,7 @@
</dd>
- <dt>Typed Arrays</dt>
- <dd>
-
- <p>The <dfn>ArrayBuffer</dfn> and <dfn>ArrayBufferView</dfn> interfaces and underlying concepts
- from the Typed Array Specification are used for several features in this specification. The
- <dfn>Uint8ClampedArray</dfn> interface type is specifically used in the definition of the
- <code>canvas</code> element's 2D API. <a href="#refsTYPEDARRAY">[TYPEDARRAY]</a></p>
-
- </dd>
-
-
<dt>File API</dt>
<dd>
@@ -7684,6 +7664,7 @@
<h4>Transferable objects</h4>
+<!--CLEANUP-->
<p>Some objects support being copied and closed in one operation.
This is called <i>transferring</i> the object, and is used in
particular to transfer ownership of unsharable or expensive
@@ -7692,7 +7673,7 @@
<p>The following <code>Transferable</code> types exist:</p>
<ul class="brief">
- <li><code>ArrayBuffer</code> <a href="#refsTYPEDARRAY">[TYPEDARRAY]</a>
+ <li><code>ArrayBuffer</code> <a href="#refsECMA262">[ECMA262]</a>
<li><code>CanvasProxy</code> (defined in this specification)
<li><code>MessagePort</code> (defined in this specification)
</ul>
@@ -7701,12 +7682,9 @@
<p>The following IDL block formalizes this:</p>
- <pre class="idl">[NoInterfaceObject]
-interface <dfn>Transferable</dfn> { };
-<span>ArrayBuffer</span> implements <span>Transferable</span>;
-<span>CanvasProxy</span> implements <span>Transferable</span>;
-<span>MessagePort</span> implements <span>Transferable</span>;</pre>
+ <pre class="idl">typedef (<span>ArrayBuffer</span> or <span>CanvasProxy</span> or <span>MessagePort</span>) <dfn>Transferable</dfn>;</pre>
+<!--CLEANUP-->
<p>To <dfn>transfer a <code>Transferable</code> object</dfn> to a
new owner, the user agent must run the steps defined for the type of
object in question. The steps will return a new object of the same
@@ -7721,7 +7699,8 @@
a user agent must create a new <code>ArrayBuffer</code> object pointing at the same underlying
data as <var data-x="">old</var>, thus obtaining <var data-x="">new</var>, must <span
data-x="concept-Transferable-neutered">neuter</span> the <var data-x="">old</var> object, and must
- finally return <var data-x="">new</var>. <a href="#refsTYPEDARRAY">[TYPEDARRAY]</a></p>
+ finally return <var data-x="">new</var>. <a href="#refsECMA262">[ECMA262]</a></p>
+ <!-- I'm expecting this section to move to the JS spec eventually so I'm leaving it as is for now -->
<p class="note">Rules for how to <a href="#transferCanvasProxy">transfer a
<code>CanvasProxy</code> object</a> and how to <a href="#transferMessagePort">transfer a
@@ -7854,20 +7833,21 @@
data-x="">output</var> be a newly constructed <code>ArrayBuffer</code> object whose contents
are a copy of <var data-x="">input</var>'s contents, with the same length.</p></dd>
- <dt>If <var data-x="">input</var> is an <code>ArrayBufferView</code> object</dt>
+ <dt>If <var data-x="">input</var> is an object with a [[DataView]] internal slot</dt>
<dd>
<p>Let <var data-x="">output</var> be a newly constructed object of the same class as <var
- data-x="">input</var>, with each IDL attribute defined for that class being set to the value
- obtained from invoking the <span>internal structured cloning algorithm</span> recursively with
- the value of the attribute on <var data-x="">input</var> as the new "<var
- data-x="">input</var>" argument and <var data-x="">memory</var> as the new "<var
- data-x="">memory</var>" argument.</p>
+ data-x="">input</var>, with its [[DataView]] internal property present, its
+ [[ViewedArrayBuffer]] internal property set to the value obtained from invoking the
+ <span>internal structured cloning algorithm</span> recursively with the value of the internal
+ property on <var data-x="">input</var> as the new "<var data-x="">input</var>" argument and
+ <var data-x="">memory</var> as the new "<var data-x="">memory</var>" argument, and with the
+ [[ByteLength]] and [[ByteOffset]] internal properties set to the same value as their
+ counterparts on <var data-x="">input</var>.</p>
- <p class="note">Only IDL attributes defined on the class (including the
- <code>ArrayBufferView</code> attributes) are cloned. Properties added by a script, for
- example, are not cloned.</p>
+ <!-- the above might not make much sense, but it'll become moot when JS takes over defining
+ how to clone ArrayBufferView objects -->
</dd>
@@ -65783,14 +65763,14 @@
<code>ArrayBuffer</code></span> for its storage, and must have a zero start offset and a length
equal to the length of its storage, in bytes. The <span>Canvas Pixel
<code>ArrayBuffer</code></span> must contain the image data. At least one pixel's worth of image
- data must be returned. <a href="#refsTYPEDARRAY">[TYPEDARRAY]</a></p>
+ data must be returned. <a href="#refsECMA262">[ECMA262]</a></p>
<p>A <dfn>Canvas Pixel <code>ArrayBuffer</code></dfn> is an <code>ArrayBuffer</code> that whose
data is represented in left-to-right order, row by row top to bottom, starting with the top left,
with each pixel's red, green, blue, and alpha components being given in that order for each pixel.
Each component of each pixel represented in this array must be in the range 0..255, representing
the 8 bit value for that component. The components must be assigned consecutive indices starting
- with 0 for the top left pixel's red component. <a href="#refsTYPEDARRAY">[TYPEDARRAY]</a></p>
+ with 0 for the top left pixel's red component. <a href="#refsECMA262">[ECMA262]</a></p>
<p>The <dfn data-x="dom-context-2d-putImageData"><code>putImageData()</code></dfn> method writes
data from <code>ImageData</code> structures back to the rendering context's <span>scratch
@@ -90254,30 +90234,27 @@
<dd>
+<!--CLEANUP-->
<p>If <i>the WebSocket connection is established</i>, and <i data-x="the WebSocket closing
handshake is started">the WebSocket closing handshake has not yet started</i>, then the user
agent must <i>send a WebSocket Message</i> comprised of <var data-x="">data</var> using a binary
frame opcode; if the data cannot be sent, e.g. because it would need to be buffered but the
buffer is full, the user agent must <span data-x="concept-websocket-close-fail">flag the
WebSocket as full</span> and then <i>close the WebSocket connection</i>. The data to be sent is
- the data stored in the buffer described by the <code>ArrayBuffer</code> object. <!-- that
- sentence is meant to invoke "The ArrayBuffer type describes a buffer used to store data for the
- array buffer views." at the top of the Typed Array spec, and "Optional byteOffset and length can
- be used to limit the section of the buffer referenced" in the definition of the TypedArray
- constructor --> Any invocation of this method with an <code>ArrayBuffer</code> argument that
+ the data stored in the buffer described by the <code>ArrayBuffer</code> object. Any invocation of this method with an <code>ArrayBuffer</code> argument that
does not throw an exception must increase the <code
data-x="dom-WebSocket-bufferedAmount">bufferedAmount</code> attribute by the length of the
- <code>ArrayBuffer</code> in bytes. <!-- that sentence is meant to invoke the same as
- ArrayBuffer.byteLength --> <a href="#refsWSP">[WSP]</a> <a
- href="#refsTYPEDARRAY">[TYPEDARRAY]</a></p>
+ <code>ArrayBuffer</code> in bytes. <a href="#refsWSP">[WSP]</a> <a
+ href="#refsECMA262">[ECMA262]</a></p>
</dd>
- <dt>If the argument is an <code>ArrayBufferView</code> object</dt>
+ <dt>If the argument is an object that matches the <code>ArrayBufferView</code> type definition</dt>
<dd>
+<!--CLEANUP-->
<p>If <i>the WebSocket connection is established</i>, and <i data-x="the WebSocket closing
handshake is started">the WebSocket closing handshake has not yet started</i>, then the user
agent must <i>send a WebSocket Message</i> comprised of <var data-x="">data</var> using a binary
@@ -90285,15 +90262,11 @@
buffer is full, the user agent must <span data-x="concept-websocket-close-fail">flag the
WebSocket as full</span> and then <i>close the WebSocket connection</i>. The data to be sent is
the data stored in the section of the buffer described by the <code>ArrayBuffer</code> object
- that the <code>ArrayBufferView</code> object references. <!-- that sentence is meant to invoke
- "The ArrayBuffer type describes a buffer used to store data for the array buffer views." at the
- top of the Typed Array spec, and "Optional byteOffset and length can be used to limit the
- section of the buffer referenced" in the definition of the TypedArray constructor --> Any
- invocation of this method with an <code>ArrayBufferView</code> argument that does not throw an
+ that <var data-x="">data</var> references. Any
+ invocation of this method with this kind of argument that does not throw an
exception must increase the <code data-x="dom-WebSocket-bufferedAmount">bufferedAmount</code>
- attribute by the length of the <code>ArrayBufferView</code> in bytes. <!-- that sentence is
- meant to invoke the same as ArrayBufferView.byteLength --> <a href="#refsWSP">[WSP]</a> <a
- href="#refsTYPEDARRAY">[TYPEDARRAY]</a></p>
+ attribute by the length of <var data-x="">data</var>'s buffer in bytes. <a href="#refsWSP">[WSP]</a> <a
+ href="#refsECMA262">[ECMA262]</a></p>
</dd>
@@ -90399,9 +90372,9 @@
<p>If <var data-x="">type</var> indicates that the data is Binary, and <code
data-x="dom-WebSocket-binaryType">binaryType</code> is set to "<code
data-x="">arraybuffer</code>", then initialize <var data-x="">event</var>'s <code
- data-x="dom-MessageEvent-data">data</code> attribute to a new read-only <code>ArrayBuffer</code>
+ data-x="dom-MessageEvent-data">data</code> attribute to a new read-only <code>ArrayBuffer</code> <!-- XXXX -->
object whose contents are <var data-x="">data</var>. <a
- href="#refsTYPEDARRAY">[TYPEDARRAY]</a></p>
+ href="#refsECMA262">[ECMA262]</a></p>
</li>
@@ -115027,9 +115000,6 @@
<dt id="refsTURN">[TURN]</dt>
<dd><cite><a href="http://tools.ietf.org/html/rfc5766">Traversal Using Relays around NAT (TURN): Relay Extensions to Session Traversal Utilities for NAT (STUN)</a></cite>, R. Mahy, P. Matthews, J. Rosenberg. IETF.</dd>
- <dt id="refsTYPEDARRAY">[TYPEDARRAY]</dt>
- <dd><cite><a href="http://www.khronos.org/registry/typedarray/specs/latest/">Typed Array Specification</a></cite>, D. Herman, K. Russell. Khronos.</dd>
-
<dt id="refsTZDATABASE">[TZDATABASE]</dt>
<dd>(Non-normative) <cite><a href="http://www.iana.org/time-zones">Time Zone Database</a></cite>. IANA.</dd>
More information about the Commit-Watchers
mailing list