<?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>17427</bug_id>
          
          <creation_ts>2012-06-05 20:25:39 +0000</creation_ts>
          <short_desc>&lt;canvas&gt;: drawImage() should accept SVGImageElement (&lt;svg:image&gt;)</short_desc>
          <delta_ts>2016-03-18 08:54:47 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#2dcontext</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>Needs Impl Interest</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>cabanier</cc>
    
    <cc>cam</cc>
    
    <cc>d</cc>
    
    <cc>dtrebbien</cc>
    
    <cc>ian</cc>
    
    <cc>junov</cc>
    
    <cc>junov</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>68744</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-06-05 20:25:39 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html
Multipage: http://www.whatwg.org/C#2dcontext
Complete: http://www.whatwg.org/c#2dcontext

Comment:
drawImage should accept SVGImageElement

Posted from: 71.184.125.56 by bzbarsky@mit.edu
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:15.0) Gecko/15.0 Firefox/15.0a1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68745</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-06-05 20:26:10 +0000</bug_when>
    <thetext>We&apos;re trying to converge &lt;hgml:img&gt; and &lt;svg:image&gt; as much as we can, as I understand.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70907</commentid>
    <comment_count>2</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-07-18 17:43:49 +0000</bug_when>
    <thetext>This bug was cloned to create bug 18220 as part of operation convergence.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74164</commentid>
    <comment_count>3</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-09-20 21:41:43 +0000</bug_when>
    <thetext>Is there a spec I can point to that defines the &lt;svg:image&gt; processing model? The stuff like &quot;available&quot;, interaction with the network, CORS, event loop, etc?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74320</commentid>
    <comment_count>4</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2012-09-23 01:25:40 +0000</bug_when>
    <thetext>No, but if you can tell me the list of things that I need to define (and what terms to link to from the HTML spec) I&apos;ll do the SVG spec changes needed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78766</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-11-25 05:17:32 +0000</bug_when>
    <thetext>I don&apos;t know exactly what it needs, but here&apos;s the equivalent section for the &lt;img&gt; element in HTML:

   http://www.whatwg.org/specs/web-apps/current-work/#the-img-element

The stuff I need for drawImage() specifically is the same stuff as what I need for ImageBitmap, which may be easier to isolate — see the section that says &quot;If image is an img element&quot; here:

   http://www.whatwg.org/specs/web-apps/current-work/#images

...specifically, the equivalents of:

   &quot;completely available&quot;
   &quot;origin&quot;
   &quot;media data&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83904</commentid>
    <comment_count>6</comment_count>
    <who name="rcabanie">cabanier</who>
    <bug_when>2013-03-02 22:19:22 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; I don&apos;t know exactly what it needs, but here&apos;s the equivalent section for
&gt; the &lt;img&gt; element in HTML:
&gt; 
&gt;    http://www.whatwg.org/specs/web-apps/current-work/#the-img-element
&gt; 
&gt; The stuff I need for drawImage() specifically is the same stuff as what I
&gt; need for ImageBitmap, which may be easier to isolate — see the section that
&gt; says &quot;If image is an img element&quot; here:
&gt; 
&gt;    http://www.whatwg.org/specs/web-apps/current-work/#images
&gt; 
&gt; ...specifically, the equivalents of:
&gt; 
&gt;    &quot;completely available&quot;
&gt;    &quot;origin&quot;
&gt;    &quot;media data&quot;

I&apos;m not sure that this is needed. The svgsvgelement [1] is like the HTML canvas. The element and all of its descendant are part of the document and available.

1: http://www.w3.org/TR/SVG/struct.html#InterfaceSVGSVGElement</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86085</commentid>
    <comment_count>7</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-04-12 22:01:37 +0000</bug_when>
    <thetext>We&apos;re not talking about &lt;svg:svg&gt;, we&apos;re talking about &lt;svg:image&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86088</commentid>
    <comment_count>8</comment_count>
    <who name="rcabanie">cabanier</who>
    <bug_when>2013-04-12 22:27:27 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; We&apos;re not talking about &lt;svg:svg&gt;, we&apos;re talking about &lt;svg:image&gt;.

I didn&apos;t catch that. I don&apos;t think there&apos;s a big demand for such a feature.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125538</commentid>
    <comment_count>9</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2016-03-16 17:43:30 +0000</bug_when>
    <thetext>bz, it seems this didn&apos;t get the interest we need to add this to HTML. Let me know if you want me to reconsider.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125539</commentid>
    <comment_count>10</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2016-03-16 17:45:27 +0000</bug_when>
    <thetext>+junov just in case Chrome is interested in this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125551</commentid>
    <comment_count>11</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2016-03-16 18:57:36 +0000</bug_when>
    <thetext>My understanding is that the SVG working group is actively trying to converge its &quot;duplicated&quot; elements with the corresponding HTML ones.  Given that, it seems like we should treat them identically; pretty much anything else is rather author-hostile.

In particular, it seems to me that &lt;svg:image&gt; should use the same processing model as &lt;html:img&gt; and hence this should all be quite straightforward to spec.  And probably implement; in Gecko all the logic is shared and hence the work to support &lt;svg:image&gt; here is tiny; I would be surprised if it&apos;s very different in other browsers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125553</commentid>
    <comment_count>12</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2016-03-17 04:56:14 +0000</bug_when>
    <thetext>Okay, happy to reconsider. I guess we could check all the places that accept HTMLImageElement and make them accept SVGImageElement too.

I don&apos;t think we necessarily need to wait on SVG to sort out their standard if we all know it&apos;s supposed to work identically (though we should maybe point that out with a note until things are sorted).

Justin, what do you think?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125562</commentid>
    <comment_count>13</comment_count>
    <who name="Justin Novosad">junov</who>
    <bug_when>2016-03-17 19:20:41 +0000</bug_when>
    <thetext>Yes, I think this makes sense. To match use cases of HTMLImageElement, I think we should add SVGImageElement to the CanvasImageSource and ImageBitmapSource typedefs, which implies supporting it as an argument to drawImage, createPattern and createImageBitmap.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125563</commentid>
    <comment_count>14</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2016-03-18 08:54:47 +0000</bug_when>
    <thetext>Created a pull request: https://github.com/whatwg/html/pull/900.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>