Skip to content

Commit

Permalink
Throw when resizing OffscreenCanvas placeholder
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
junov authored and domenic committed Sep 21, 2017
1 parent f0f7a14 commit 5a51d3e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -59196,6 +59196,13 @@ callback <dfn>BlobCallback</dfn> = void (<span>Blob</span>? blob);</pre>
attribute defaults to 300, and the <code data-x="attr-canvas-height">height</code> attribute
defaults to 150.</p>

<p>When setting the value of the <code data-x="attr-canvas-width">width</code> or <code
data-x="attr-canvas-height">height</code> attribute, if the <span
data-x="concept-canvas-context-mode">context mode</span> of the <code>canvas</code>
element is set to <span data-x="concept-canvas-placeholder">placeholder</span>, the
user agent must throw an <span>"<code>InvalidStateError</code>"</span> <code>DOMException</code>
and leave the attribute's value unchanged.</p>

<p>The <span>intrinsic dimensions</span> of the <code>canvas</code> element when it
<span>represents</span> <span>embedded content</span> are equal to the dimensions of the
element's bitmap.</p>
Expand Down

0 comments on commit 5a51d3e

Please sign in to comment.