Skip to content

Commit 5a51d3e

Browse files
junovdomenic
authored andcommitted
Throw when resizing OffscreenCanvas placeholder
Attempting to set the width or height attribute of a canvas element after it has transferred control to an OffscreenCanvas should throw an exception. Before this change, the behavior was to silently ignore changes to these attributes, which was not clear because that case was not specifically mentioned in the spec.
1 parent f0f7a14 commit 5a51d3e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

source

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59196,6 +59196,13 @@ callback <dfn>BlobCallback</dfn> = void (<span>Blob</span>? blob);</pre>
5919659196
attribute defaults to 300, and the <code data-x="attr-canvas-height">height</code> attribute
5919759197
defaults to 150.</p>
5919859198

59199+
<p>When setting the value of the <code data-x="attr-canvas-width">width</code> or <code
59200+
data-x="attr-canvas-height">height</code> attribute, if the <span
59201+
data-x="concept-canvas-context-mode">context mode</span> of the <code>canvas</code>
59202+
element is set to <span data-x="concept-canvas-placeholder">placeholder</span>, the
59203+
user agent must throw an <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>
59204+
and leave the attribute's value unchanged.</p>
59205+
5919959206
<p>The <span>intrinsic dimensions</span> of the <code>canvas</code> element when it
5920059207
<span>represents</span> <span>embedded content</span> are equal to the dimensions of the
5920159208
element's bitmap.</p>

0 commit comments

Comments
 (0)