title: IndexSizeError on drawImage on IE and Edge
body: <p>I am finding that a certain code fails in Internet Explorer and Edge, but seems to work flawlessly in Chrome and Firefox:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var image = document.getElementById("myImage");
  var canvas = document.getElementById("myCanvas");
  var context = canvas.getContext("2d");
  context.drawImage(image, 1, 0, 499, 278, 0, 0, 749, 417);</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>img {
    width: 300px;
    height: 200px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;img id="myImage" src="https://image.ibb.co/bsANfm/emptyphoto.png" /&gt;
  
  &lt;canvas id="myCanvas" width="600" height="400"&gt;&lt;/canvas&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>For some reason, the CanvasRenderingContext2D.drawImage() call fails in IE 11 and Edge 40.15063.674.0, where I'm getting an IndexSizeError exception. <a href="https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage" rel="nofollow noreferrer">According to MDN</a>, I should only be getting this error if the size of either the canvas or the source rectangle is 0, which is not the case here.</p>
  
  <p>Could anyone shed some light into whether I'm doing something wrong here, or if there's some workaround available?</p>