<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>9584</bug_id>
          
          <creation_ts>2010-04-23 02:22:21 +0000</creation_ts>
          <short_desc>drawImage() shouldn&apos;t throw INVALID_STATE_ERR</short_desc>
          <delta_ts>2010-10-05 12:58:53 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>pre-LC1 HTML Canvas 2D Context (editor: Ian Hickson)</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>NE</keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>LC</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jatinder Mann [MSFT]">jmann</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>xhva.spam</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>35222</commentid>
    <comment_count>0</comment_count>
    <who name="Jatinder Mann [MSFT]">jmann</who>
    <bug_when>2010-04-23 02:22:21 +0000</bug_when>
    <thetext>Per this conversation,http://lists.w3.org/Archives/Public/public-html/2009Aug/1458.html, we need to update the spec.

On Fri, 28 Aug 2009 03:03:19 +0200, Ian Hickson &lt;ian@hixie.ch&gt; wrote:

&gt; On Mon, 17 Aug 2009, Simon Pieters wrote:
&gt;&gt; On Fri, 14 Aug 2009 03:54:08 +0200, Ian Hickson &lt;ian@hixie.ch&gt; wrote:
&gt;&gt; &gt; On Thu, 6 Aug 2009, Simon Pieters wrote:
&gt;&gt; &gt; &gt;
&gt;&gt; &gt; &gt; The spec says that canvas drawImage() should throw INVALID_STATE_ERR
&gt;&gt; &gt; &gt; when the image isn&apos;t loaded yet or video isn&apos;t enough loaded. I
&gt;&gt; &gt; &gt; think this is a bad idea.
&gt;&gt; &gt; &gt;
&gt;&gt; &gt; &gt; I expect authors to just draw a video on a canvas when they see fit,
&gt;&gt; &gt; &gt; test locally or on a stable network, see that it works fine. Then
&gt;&gt; &gt; &gt; the script will stop working completely for some users because of
&gt;&gt; &gt; &gt; the uncaught exception when the script tries to drawImage() a video
&gt;&gt; &gt; &gt; that&apos;s not ready yet.
&gt;&gt; &gt; &gt;
&gt;&gt; &gt; &gt; Moreover, Opera has lazy loading of images (only loading images that
&gt;&gt; &gt; &gt; are rendered or have some event handlers or were created with new
&gt;&gt; &gt; &gt; Image() etc), so we&apos;d probably want to just load the image when the
&gt;&gt; &gt; &gt; script tries to draw it instead of throwing.
&gt;&gt; &gt; &gt;
&gt;&gt; &gt; &gt; Therefore I suggest that the spec be changed to not throw
&gt;&gt; &gt; &gt; INVALID_STATE_ERR for drawImage() (and createPattern()).
&gt;&gt; &gt; &gt;
&gt;&gt; &gt; &gt; The method could be changed from void to return a boolean,
&gt;&gt; &gt; &gt; indicating whether the image was successfully drawn, so scripts can
&gt;&gt; &gt; &gt; detect it easily.
&gt;&gt; &gt;
&gt;&gt; &gt; What should createPattern() return in this situation?
&gt;&gt;
&gt;&gt; It should return null, which will be ignored when set on fillStyle and
&gt;&gt; strokeStyle.
&gt;
&gt; Done. (It still doesn&apos;t return false, though, since you can detect this
&gt; case yourself if you really care.)
&gt;

It looks like you missed two instances of INVALID_STATE_ERR, in the green  
boxes for context.drawImage and context.createPattern. I can&apos;t tell if  
these boxes are normative spec text or just a summary of the information  
below, but that&apos;s not the point here...

-- 
Philip Jägenstedt
Core Developer
Opera Software</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38801</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-09-10 09:04:07 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Accepted
Change Description: no spec change
Rationale: This seems to have been fixed already.

BTW, you can tell what&apos;s normative and what isn&apos;t because it&apos;ll say &quot;MUST&quot; if it&apos;s normative.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>