[html5] r8629 - [giow] (3) Define how to handle neutered ImageData objects Fixing https://www.w3 [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue May 13 11:39:39 PDT 2014


Author: ianh
Date: 2014-05-13 11:39:37 -0700 (Tue, 13 May 2014)
New Revision: 8629

Modified:
   complete.html
   index
   source
Log:
[giow] (3) Define how to handle neutered ImageData objects
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=25672
Affected topics: Canvas

Modified: complete.html
===================================================================
--- complete.html	2014-05-13 18:12:47 UTC (rev 8628)
+++ complete.html	2014-05-13 18:39:37 UTC (rev 8629)
@@ -59476,7 +59476,7 @@
     <p>Returns an <code><a href=#imagedata>ImageData</a></code> object with the given dimensions. All the pixels in the
     returned object are transparent black.</p>
 
-    <p>Throws an <code><a href=#indexsizeerror>IndexSizeError</a></code> exception if the either of the width or height
+    <p>Throws an <code><a href=#indexsizeerror>IndexSizeError</a></code> exception if either of the width or height
     arguments are zero.</p>
 
    </dd>
@@ -59549,6 +59549,9 @@
 
     <p>Throws a <code><a href=#notsupportederror>NotSupportedError</a></code> exception if any of the arguments are not finite.</p>
 
+    <p>Throws an <code><a href=#invalidstateerror>InvalidStateError</a></code> exception if the <var title="">imagedata</var>
+    object's data has been <a href=#concept-transferable-neutered title=concept-Transferable-neutered>neutered</a>.</p>
+
    </dd>
 
   </dl><div class=impl>
@@ -59659,6 +59662,11 @@
 
   <ol><li>
 
+    <p>If the <var title="">imagedata</var> argument's <code title=dom-imagedata-data><a href=#dom-imagedata-data>data</a></code> attribute has been <a href=#concept-transferable-neutered title=concept-Transferable-neutered>neutered</a>, throw an <code><a href=#invalidstateerror>InvalidStateError</a></code>
+    exception and abort these steps.</p>
+
+   <li>
+
     <p>If <var title="">dirtyWidth</var> is negative, let <var title="">dirtyX</var> be <span title=""><var title="">dirtyX</var>+<var title="">dirtyWidth</var></span>, and let <var title="">dirtyWidth</var> be equal to the absolute magnitude of <var title="">dirtyWidth</var>.</p>
 
     <p>If <var title="">dirtyHeight</var> is negative, let <var title="">dirtyY</var> be <span title=""><var title="">dirtyY</var>+<var title="">dirtyHeight</var></span>, and let <var title="">dirtyHeight</var> be equal to the absolute magnitude of <var title="">dirtyHeight</var>.</p>
@@ -59691,9 +59699,10 @@
 
    </li>
 
+<!--CLEANUP-->
    <li><p>For all integer values of <var title="">x</var> and <var title="">y</var> where <span title=""><var title="">dirtyX</var> ≤ <var title="">x</var> < <span title=""><var title="">dirtyX</var>+<var title="">dirtyWidth</var></span></span> and <span title=""><var title="">dirtyY</var> ≤ <var title="">y</var> < <span title=""><var title="">dirtyY</var>+<var title="">dirtyHeight</var></span></span>, copy the
    four channels of the pixel with coordinate (<var title="">x</var>, <var title="">y</var>) in
-   the <var title="">imagedata</var> data structure to the pixel with coordinate (<span title=""><var title="">dx</var>+<var title="">x</var></span>, <span title=""><var title="">dy</var>+<var title="">y</var></span>) in the rendering context's <a href=#scratch-bitmap>scratch
+   the <var title="">imagedata</var> data structure's <a href=#canvas-pixel-arraybuffer>Canvas Pixel <code>ArrayBuffer</code></a> to the pixel with coordinate (<span title=""><var title="">dx</var>+<var title="">x</var></span>, <span title=""><var title="">dy</var>+<var title="">y</var></span>) in the rendering context's <a href=#scratch-bitmap>scratch
    bitmap</a>.</li>
 
   </ol><p>The handling of pixel rounding when the specified coordinates are not integers is not defined
@@ -76178,10 +76187,11 @@
     any pixels missing in the original replaced by transparent black. These coordinates are in the
     source image's pixel coordinate space, <em>not</em> in CSS pixels.</p>
 
+<!--CLEANUP-->
     <p>Throws an <code><a href=#invalidstateerror>InvalidStateError</a></code> exception if the source image is not in a valid
     state (e.g. an <code><a href=#the-img-element>img</a></code> element that hasn't finished loading, or a
     <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object whose bitmap data has zero length along one or both
-    dimensions). Throws a <code><a href=#securityerror>SecurityError</a></code> exception if the script is not allowed to
+    dimensions, or an <code><a href=#imagedata>ImageData</a></code> object whose data is <code title=dom-imagedata-data><a href=#dom-imagedata-data>data</a></code> attribute has been <a href=#concept-transferable-neutered title=concept-Transferable-neutered>neutered</a>). Throws a <code><a href=#securityerror>SecurityError</a></code> exception if the script is not allowed to
     access the image data of the source image (e.g. a <code><a href=#the-video-element>video</a></code> that is
     <a href=#cors-cross-origin>CORS-cross-origin</a>, or a <code><a href=#the-canvas-element>canvas</a></code> being drawn on by a script in a worker
     from another <a href=#origin>origin</a>).</p>
@@ -76369,6 +76379,10 @@
     <ol><li><p>If either the <var title="">sw</var> or <var title="">sh</var> arguments are specified
      but zero, throw an <code><a href=#indexsizeerror>IndexSizeError</a></code> exception and abort these steps.</li>
 
+     <li><p>If the <var title="">image</var> object's <code title=dom-imagedata-data><a href=#dom-imagedata-data>data</a></code>
+     attribute has been <a href=#concept-transferable-neutered title=concept-Transferable-neutered>neutered</a>, throw an
+     <code><a href=#invalidstateerror>InvalidStateError</a></code> exception and abort these steps.</li>
+
      <li><p>Create a new <code><a href=#imagebitmap>ImageBitmap</a></code> object.</li>
 
      <li><p>Let the <code><a href=#imagebitmap>ImageBitmap</a></code> object's bitmap data be the image data given by the

Modified: index
===================================================================
--- index	2014-05-13 18:12:47 UTC (rev 8628)
+++ index	2014-05-13 18:39:37 UTC (rev 8629)
@@ -59476,7 +59476,7 @@
     <p>Returns an <code><a href=#imagedata>ImageData</a></code> object with the given dimensions. All the pixels in the
     returned object are transparent black.</p>
 
-    <p>Throws an <code><a href=#indexsizeerror>IndexSizeError</a></code> exception if the either of the width or height
+    <p>Throws an <code><a href=#indexsizeerror>IndexSizeError</a></code> exception if either of the width or height
     arguments are zero.</p>
 
    </dd>
@@ -59549,6 +59549,9 @@
 
     <p>Throws a <code><a href=#notsupportederror>NotSupportedError</a></code> exception if any of the arguments are not finite.</p>
 
+    <p>Throws an <code><a href=#invalidstateerror>InvalidStateError</a></code> exception if the <var title="">imagedata</var>
+    object's data has been <a href=#concept-transferable-neutered title=concept-Transferable-neutered>neutered</a>.</p>
+
    </dd>
 
   </dl><div class=impl>
@@ -59659,6 +59662,11 @@
 
   <ol><li>
 
+    <p>If the <var title="">imagedata</var> argument's <code title=dom-imagedata-data><a href=#dom-imagedata-data>data</a></code> attribute has been <a href=#concept-transferable-neutered title=concept-Transferable-neutered>neutered</a>, throw an <code><a href=#invalidstateerror>InvalidStateError</a></code>
+    exception and abort these steps.</p>
+
+   <li>
+
     <p>If <var title="">dirtyWidth</var> is negative, let <var title="">dirtyX</var> be <span title=""><var title="">dirtyX</var>+<var title="">dirtyWidth</var></span>, and let <var title="">dirtyWidth</var> be equal to the absolute magnitude of <var title="">dirtyWidth</var>.</p>
 
     <p>If <var title="">dirtyHeight</var> is negative, let <var title="">dirtyY</var> be <span title=""><var title="">dirtyY</var>+<var title="">dirtyHeight</var></span>, and let <var title="">dirtyHeight</var> be equal to the absolute magnitude of <var title="">dirtyHeight</var>.</p>
@@ -59691,9 +59699,10 @@
 
    </li>
 
+<!--CLEANUP-->
    <li><p>For all integer values of <var title="">x</var> and <var title="">y</var> where <span title=""><var title="">dirtyX</var> ≤ <var title="">x</var> < <span title=""><var title="">dirtyX</var>+<var title="">dirtyWidth</var></span></span> and <span title=""><var title="">dirtyY</var> ≤ <var title="">y</var> < <span title=""><var title="">dirtyY</var>+<var title="">dirtyHeight</var></span></span>, copy the
    four channels of the pixel with coordinate (<var title="">x</var>, <var title="">y</var>) in
-   the <var title="">imagedata</var> data structure to the pixel with coordinate (<span title=""><var title="">dx</var>+<var title="">x</var></span>, <span title=""><var title="">dy</var>+<var title="">y</var></span>) in the rendering context's <a href=#scratch-bitmap>scratch
+   the <var title="">imagedata</var> data structure's <a href=#canvas-pixel-arraybuffer>Canvas Pixel <code>ArrayBuffer</code></a> to the pixel with coordinate (<span title=""><var title="">dx</var>+<var title="">x</var></span>, <span title=""><var title="">dy</var>+<var title="">y</var></span>) in the rendering context's <a href=#scratch-bitmap>scratch
    bitmap</a>.</li>
 
   </ol><p>The handling of pixel rounding when the specified coordinates are not integers is not defined
@@ -76178,10 +76187,11 @@
     any pixels missing in the original replaced by transparent black. These coordinates are in the
     source image's pixel coordinate space, <em>not</em> in CSS pixels.</p>
 
+<!--CLEANUP-->
     <p>Throws an <code><a href=#invalidstateerror>InvalidStateError</a></code> exception if the source image is not in a valid
     state (e.g. an <code><a href=#the-img-element>img</a></code> element that hasn't finished loading, or a
     <code><a href=#canvasrenderingcontext2d>CanvasRenderingContext2D</a></code> object whose bitmap data has zero length along one or both
-    dimensions). Throws a <code><a href=#securityerror>SecurityError</a></code> exception if the script is not allowed to
+    dimensions, or an <code><a href=#imagedata>ImageData</a></code> object whose data is <code title=dom-imagedata-data><a href=#dom-imagedata-data>data</a></code> attribute has been <a href=#concept-transferable-neutered title=concept-Transferable-neutered>neutered</a>). Throws a <code><a href=#securityerror>SecurityError</a></code> exception if the script is not allowed to
     access the image data of the source image (e.g. a <code><a href=#the-video-element>video</a></code> that is
     <a href=#cors-cross-origin>CORS-cross-origin</a>, or a <code><a href=#the-canvas-element>canvas</a></code> being drawn on by a script in a worker
     from another <a href=#origin>origin</a>).</p>
@@ -76369,6 +76379,10 @@
     <ol><li><p>If either the <var title="">sw</var> or <var title="">sh</var> arguments are specified
      but zero, throw an <code><a href=#indexsizeerror>IndexSizeError</a></code> exception and abort these steps.</li>
 
+     <li><p>If the <var title="">image</var> object's <code title=dom-imagedata-data><a href=#dom-imagedata-data>data</a></code>
+     attribute has been <a href=#concept-transferable-neutered title=concept-Transferable-neutered>neutered</a>, throw an
+     <code><a href=#invalidstateerror>InvalidStateError</a></code> exception and abort these steps.</li>
+
      <li><p>Create a new <code><a href=#imagebitmap>ImageBitmap</a></code> object.</li>
 
      <li><p>Let the <code><a href=#imagebitmap>ImageBitmap</a></code> object's bitmap data be the image data given by the

Modified: source
===================================================================
--- source	2014-05-13 18:12:47 UTC (rev 8628)
+++ source	2014-05-13 18:39:37 UTC (rev 8629)
@@ -65107,7 +65107,7 @@
     <p>Returns an <code>ImageData</code> object with the given dimensions. All the pixels in the
     returned object are transparent black.</p>
 
-    <p>Throws an <code>IndexSizeError</code> exception if the either of the width or height
+    <p>Throws an <code>IndexSizeError</code> exception if either of the width or height
     arguments are zero.</p>
 
    </dd>
@@ -65181,6 +65181,9 @@
 
     <p>Throws a <code>NotSupportedError</code> exception if any of the arguments are not finite.</p>
 
+    <p>Throws an <code>InvalidStateError</code> exception if the <var data-x="">imagedata</var>
+    object's data has been <span data-x="concept-Transferable-neutered">neutered</span>.</p>
+
    </dd>
 
   </dl>
@@ -65313,6 +65316,13 @@
 
    <li>
 
+    <p>If the <var data-x="">imagedata</var> argument's <code
+    data-x="dom-imagedata-data">data</code> attribute has been <span
+    data-x="concept-Transferable-neutered">neutered</span>, throw an <code>InvalidStateError</code>
+    exception and abort these steps.</p>
+
+   <li>
+
     <p>If <var data-x="">dirtyWidth</var> is negative, let <var data-x="">dirtyX</var> be <span
     data-x=""><var data-x="">dirtyX</var>+<var data-x="">dirtyWidth</var></span>, and let <var
     data-x="">dirtyWidth</var> be equal to the absolute magnitude of <var
@@ -65361,13 +65371,14 @@
 
    </li>
 
+<!--CLEANUP-->
    <li><p>For all integer values of <var data-x="">x</var> and <var data-x="">y</var> where <span
    data-x=""><var data-x="">dirtyX</var> ≤ <var data-x="">x</var> < <span
    data-x=""><var data-x="">dirtyX</var>+<var data-x="">dirtyWidth</var></span></span> and <span
    data-x=""><var data-x="">dirtyY</var> ≤ <var data-x="">y</var> < <span
    data-x=""><var data-x="">dirtyY</var>+<var data-x="">dirtyHeight</var></span></span>, copy the
    four channels of the pixel with coordinate (<var data-x="">x</var>, <var data-x="">y</var>) in
-   the <var data-x="">imagedata</var> data structure to the pixel with coordinate (<span
+   the <var data-x="">imagedata</var> data structure's <span>Canvas Pixel <code>ArrayBuffer</code></span> to the pixel with coordinate (<span
    data-x=""><var data-x="">dx</var>+<var data-x="">x</var></span>, <span data-x=""><var
    data-x="">dy</var>+<var data-x="">y</var></span>) in the rendering context's <span>scratch
    bitmap</span>.</p></li>
@@ -84060,10 +84071,13 @@
     any pixels missing in the original replaced by transparent black. These coordinates are in the
     source image's pixel coordinate space, <em>not</em> in CSS pixels.</p>
 
+<!--CLEANUP-->
     <p>Throws an <code>InvalidStateError</code> exception if the source image is not in a valid
     state (e.g. an <code>img</code> element that hasn't finished loading, or a
     <code>CanvasRenderingContext2D</code> object whose bitmap data has zero length along one or both
-    dimensions). Throws a <code>SecurityError</code> exception if the script is not allowed to
+    dimensions, or an <code>ImageData</code> object whose data is <code
+    data-x="dom-imagedata-data">data</code> attribute has been <span
+    data-x="concept-Transferable-neutered">neutered</span>). Throws a <code>SecurityError</code> exception if the script is not allowed to
     access the image data of the source image (e.g. a <code>video</code> that is
     <span>CORS-cross-origin</span>, or a <code>canvas</code> being drawn on by a script in a worker
     from another <span>origin</span>).</p>
@@ -84285,6 +84299,10 @@
      <li><p>If either the <var data-x="">sw</var> or <var data-x="">sh</var> arguments are specified
      but zero, throw an <code>IndexSizeError</code> exception and abort these steps.</p></li>
 
+     <li><p>If the <var data-x="">image</var> object's <code data-x="dom-imagedata-data">data</code>
+     attribute has been <span data-x="concept-Transferable-neutered">neutered</span>, throw an
+     <code>InvalidStateError</code> exception and abort these steps.</p></li>
+
      <li><p>Create a new <code>ImageBitmap</code> object.</p></li>
 
      <li><p>Let the <code>ImageBitmap</code> object's bitmap data be the image data given by the



More information about the Commit-Watchers mailing list