Skip to content

Commit e0383f6

Browse files
committed
Throw when <canvas> is not usable as image
This algorithm is used by createPattern() for which Chrome, Edge (different exception), Firefox, and Safari all throw. It's also used by drawImage() for which Edge, Firefox, and Safari throw. Chrome is the odd one out there. This changed in 76782de and nobody picked it up then. That change also forgot to change the domintro boxes which still suggest throwing (and how I noticed this problem).
1 parent 0217e1d commit e0383f6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62263,7 +62263,8 @@ try {
6226362263
https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=2567 -->
6226462264

6226562265
<li><p>If <var>image</var> is an <code>HTMLCanvasElement</code> object with either a horizontal
62266-
dimension or a vertical dimension equal to zero, then return <i>bad</i>.</p></li>
62266+
dimension or a vertical dimension equal to zero, then throw an
62267+
<span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>.</p></li>
6226762268

6226862269
<li><p>If <var>image</var> is an <code>ImageBitmap</code> object with its
6226962270
<span>[[Detached]]</span> internal slot value set to true, then throw an

0 commit comments

Comments
 (0)