Skip to content

Commit

Permalink
[g] (2) Change the way we allow custom ImageData objects to be created
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.whatwg.org/webapps@822 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed May 17, 2007
1 parent 61c1131 commit bd36f55
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 29 deletions.
44 changes: 29 additions & 15 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<h1 id=html-5>HTML 5</h1>

<h2 class="no-num no-toc" id=working>Working Draft &mdash; 16 May 2007</h2>
<h2 class="no-num no-toc" id=working>Working Draft &mdash; 17 May 2007</h2>

<p>You can take part in this work. <a
href="http://www.whatwg.org/mailing-list">Join the working group's
Expand Down Expand Up @@ -144,7 +144,7 @@
requirements</a>
<ul class=toc>
<li><a href="#common"><span class=secno>1.3.1. </span>Common
conformance requirements for APIs</a>
conformance requirements for APIs exposed to JavaScript</a>

<li><a href="#dependencies"><span class=secno>1.3.2.
</span>Dependencies</a>
Expand Down Expand Up @@ -1973,7 +1973,7 @@
<!-- XXX unexpandable entities? -->

<h4 id=common><span class=secno>1.3.1. </span>Common conformance
requirements for APIs</h4>
requirements for APIs exposed to JavaScript</h4>

<p class=big-issue>A lot of arrays/lists/<span>collection</span>s in this
spec assume zero-based indexes but use the term "<var
Expand Down Expand Up @@ -2002,6 +2002,17 @@
defined for that method in its IDL definition, the excess arguments must
be ignored.

<p>Unless other specified, if a method is expecting, as one of its
arguments, as defined by its IDL definition, an object implementing a
particular interface <var title="">X</var>, and the argument passed is an
object whose [[Class]] property is neither that interface <var
title="">X</var>, nor the name of an interface <var title="">Y</var> where
this specification requires that all objects implementing interface <var
title="">Y</var> also implement interface <var title="">X</var>, nor the
name of an interface that inherits from the expected interface <var
title="">X</var>, then a <code title="">TYPE_MISMATCH_ERR</code> exception
must be raised.

<p class=big-issue>Anything else? Passing the wrong type of object, maybe?
Implied conversions to int/float?

Expand Down Expand Up @@ -16742,35 +16753,38 @@ notes on what would need to be defined for dashed lines:
canvas coordinate space, mapping each pixel represented by the <code><a
href="#imagedata">ImageData</a></code> structure into one device pixel.

<p>If any of the following conditions are true, the method must raise a
<code>TYPE_MISMATCH_ERR</code> exception:
<p>If the first argument to the method is not an object whose [[Class]]
property is <code><a href="#imagedata">ImageData</a></code>, but all of
the following conditions are true, then the method must treat the first
argument as if it was an <code><a href="#imagedata">ImageData</a></code>
object (and thus not raise the <code>TYPE_MISMATCH_ERR</code> exception):

<ul>
<li>The method's first argument is not an object with <code
<li>The method's first argument is an object with <code
title=dom-imagedata-width><a href="#width5">width</a></code> and <code
title=dom-imagedata-height><a href="#height5">height</a></code>
attributes with integer values and a <code title=dom-imagedata-data><a
href="#data1">data</a></code> attribute whose value is an integer array.

<li>The <code><a href="#imagedata">ImageData</a></code> object's <code
title=dom-imagedata-width><a href="#width5">width</a></code> is not
greater than zero.
title=dom-imagedata-width><a href="#width5">width</a></code> is greater
than zero.

<li>The <code><a href="#imagedata">ImageData</a></code> object's <code
title=dom-imagedata-height><a href="#height5">height</a></code> is not
title=dom-imagedata-height><a href="#height5">height</a></code> is
greater than zero.

<li>The <code><a href="#imagedata">ImageData</a></code> object's <code
title=dom-imagedata-width><a href="#width5">width</a></code> multiplied
by its <code title=dom-imagedata-height><a
href="#height5">height</a></code> multiplied by 4 is not equal to the
number of entries in the the <code><a
href="#imagedata">ImageData</a></code> object's <code
title=dom-imagedata-data><a href="#data1">data</a></code> array.
href="#height5">height</a></code> multiplied by 4 is equal to the number
of entries in the <code><a href="#imagedata">ImageData</a></code>
object's <code title=dom-imagedata-data><a href="#data1">data</a></code>
array.

<li>The <code><a href="#imagedata">ImageData</a></code> object's <code
title=dom-imagedata-data><a href="#data1">data</a></code> array contains
entries that are not in the range 0 to 255 inclusive.
title=dom-imagedata-data><a href="#data1">data</a></code> array only
contains entries that are in the range 0 to 255 inclusive.
</ul>

<p>The handling of pixel rounding when the specified coordinates do not
Expand Down
44 changes: 30 additions & 14 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,8 @@
well.</p> <!-- XXX unexpandable entities? -->


<h4>Common conformance requirements for APIs</h4>
<h4>Common conformance requirements for APIs exposed to
JavaScript</h4>

<p class="big-issue">A lot of arrays/lists/<span>collection</span>s
in this spec assume zero-based indexes but use the term "<var
Expand Down Expand Up @@ -477,9 +478,21 @@
a <code title="big-issue">NOT_SUPPORTED_ERR</code> exception must be
raised.</p>

<p>Unless other specified, if a method is passed more
arguments than is defined for that method in its IDL definition,
the excess arguments must be ignored.</p>
<p>Unless other specified, if a method is passed more arguments than
is defined for that method in its IDL definition, the excess
arguments must be ignored.</p>

<p>Unless other specified, if a method is expecting, as one of its
arguments, as defined by its IDL definition, an object implementing
a particular interface <var title="">X</var>, and the argument
passed is an object whose [[Class]] property is neither that
interface <var title="">X</var>, nor the name of an interface <var
title="">Y</var> where this specification requires that all objects
implementing interface <var title="">Y</var> also implement
interface <var title="">X</var>, nor the name of an interface that
inherits from the expected interface <var title="">X</var>, then a
<code title="">TYPE_MISMATCH_ERR</code> exception must be
raised.</p>

<p class="big-issue">Anything else? Passing the wrong type of
object, maybe? Implied conversions to int/float?</p>
Expand Down Expand Up @@ -14362,34 +14375,37 @@ notes on what would need to be defined for dashed lines:
coordinate space, mapping each pixel represented by the
<code>ImageData</code> structure into one device pixel.</p>

<p>If any of the following conditions are true, the method must
raise a <code>TYPE_MISMATCH_ERR</code> exception:</p>
<p>If the first argument to the method is not an object whose
[[Class]] property is <code>ImageData</code>, but all of the
following conditions are true, then the method must treat the first
argument as if it was an <code>ImageData</code> object (and thus not
raise the <code>TYPE_MISMATCH_ERR</code> exception):</p>

<ul>

<li>The method's first argument is not an object with <code
<li>The method's first argument is an object with <code
title="dom-imagedata-width">width</code> and <code
title="dom-imagedata-height">height</code> attributes with integer
values and a <code title="dom-imagedata-data">data</code> attribute
whose value is an integer array.</li>

<li>The <code>ImageData</code> object's <code
title="dom-imagedata-width">width</code> is not greater than
title="dom-imagedata-width">width</code> is greater than
zero.</li>

<li>The <code>ImageData</code> object's <code
title="dom-imagedata-height">height</code> is not greater than
title="dom-imagedata-height">height</code> is greater than
zero.</li>

<li>The <code>ImageData</code> object's <code
title="dom-imagedata-width">width</code> multiplied by its <code
title="dom-imagedata-height">height</code> multiplied by 4 is not
equal to the number of entries in the the <code>ImageData</code>
object's <code title="dom-imagedata-data">data</code> array.</li>
title="dom-imagedata-height">height</code> multiplied by 4 is equal
to the number of entries in the <code>ImageData</code> object's
<code title="dom-imagedata-data">data</code> array.</li>

<li>The <code>ImageData</code> object's <code
title="dom-imagedata-data">data</code> array contains entries that
are not in the range 0 to 255 inclusive.</li>
title="dom-imagedata-data">data</code> array only contains entries
that are in the range 0 to 255 inclusive.</li>

</ul>

Expand Down

0 comments on commit bd36f55

Please sign in to comment.