Skip to content

Commit

Permalink
Disallow serializing and transferring non-origin-clean ImageBitmap
Browse files Browse the repository at this point in the history
This feature brings extra complexity for Cross-Origin-Opener-Policy and
Cross-Origin-Embedder-Policy, and is rarely used.

Relevant discussion:
https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/Z1XdYf6SjDU
  • Loading branch information
yutakahirano authored and domenic committed Dec 18, 2019
1 parent a1a503a commit ef4d727
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -96596,12 +96596,12 @@ dictionary <dfn>ImageBitmapOptions</dfn> {
are:</p>

<ol>
<li><p>If <var>value</var>'s <span data-x="concept-canvas-origin-clean">origin-clean</span>
flag is not set, then throw a <span>"<code>DataCloneError</code>"</span>
<code>DOMException</code>.

<li><p>Set <var>serialized</var>.[[BitmapData]] to a copy of <var>value</var>'s <span
data-x="concept-ImageBitmap-bitmap-data">bitmap data</span>.</p></li>

<li><p>Set <var>serialized</var>.[[OriginClean]] to true if <var>value</var>'s <span
data-x="concept-canvas-origin-clean">origin-clean</span> flag is set, and false
otherwise.</p></li>
</ol>

<p>Their <span>deserialization steps</span>, given <var>serialized</var> and <var>value</var>,
Expand All @@ -96610,21 +96610,18 @@ dictionary <dfn>ImageBitmapOptions</dfn> {
<ol>
<li><p>Set <var>value</var>'s <span data-x="concept-ImageBitmap-bitmap-data">bitmap data</span>
to <var>serialized</var>.[[BitmapData]].</p></li>

<li><p>If <var>serialized</var>.[[OriginClean]] is true, set <var>value</var>'s <span
data-x="concept-canvas-origin-clean">origin-clean</span> flag.</p></li>
</ol>

<p>Their <span>transfer steps</span>, given <var>value</var> and <var>dataHolder</var>, are:</p>

<ol>
<li><p>If <var>value</var>'s <span data-x="concept-canvas-origin-clean">origin-clean</span>
flag is not set, then throw a <span>"<code>DataCloneError</code>"</span>
<code>DOMException</code>.

<li><p>Set <var>dataHolder</var>.[[BitmapData]] to <var>value</var>'s <span
data-x="concept-ImageBitmap-bitmap-data">bitmap data</span>.</p></li>

<li><p>Set <var>dataHolder</var>.[[OriginClean]] to true if <var>value</var>'s <span
data-x="concept-canvas-origin-clean">origin-clean</span> flag is set, and false
otherwise.</p></li>

<li><p>Unset <var>value</var>'s <span data-x="concept-ImageBitmap-bitmap-data">bitmap
data</span>.</p></li>
</ol>
Expand All @@ -96635,9 +96632,6 @@ dictionary <dfn>ImageBitmapOptions</dfn> {
<ol>
<li><p>Set <var>value</var>'s <span data-x="concept-ImageBitmap-bitmap-data">bitmap data</span>
to <var>dataHolder</var>.[[BitmapData]].</p></li>

<li><p>If <var>dataHolder</var>.[[OriginClean]] is true, set <var>value</var>'s <span
data-x="concept-canvas-origin-clean">origin-clean</span> flag.</p></li>
</ol>

<hr>
Expand Down

0 comments on commit ef4d727

Please sign in to comment.