Skip to content

Commit

Permalink
Remove FileAPI monkey-patch
Browse files Browse the repository at this point in the history
The serialization steps were upstreamed in
w3c/FileAPI@828c3b6.
  • Loading branch information
mkruisselbrink authored and domenic committed Sep 26, 2017
1 parent 5b19b37 commit 766dcd3
Showing 1 changed file with 0 additions and 92 deletions.
92 changes: 0 additions & 92 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -8878,98 +8878,6 @@ o.myself = o;</pre>
usually it is simpler to perform the serialization ahead of time, as a synchronous consequence of
author code.</p>

<h4>Monkey patch for <code>Blob</code> and <code>FileList</code> objects</h4>

<p class="&#x0058;&#x0058;&#x0058;">This monkey patch will be moved in due course. See <a
href="https://github.com/w3c/FileAPI/issues/32">w3c/FileAPI issue 32</a>.</p>

<p><code>Blob</code> objects are <span>serializable objects</span>. The <code>Blob</code>
interface must be annotated with the <code data-x="Serializable">[Serializable]</code>
<span>extended attribute</span>. Their <span>serialization steps</span>, given <var>value</var>
and <var>serialized</var>, are:</p>

<ol>
<li><p>Set <var>serialized</var>.[[SnapshotState]] to <var>value</var>'s <span>snapshot
state</span>.</p></li>

<li><p>Set <var>serialized</var>.[[ByteSequence]] to <var>value</var>'s underlying byte
sequence.</p></li>
</ol>

<p>Their <span>deserialization steps</span>, given <var>serialized</var> and <var>value</var>,
are:</p>

<ol>
<li><p>Set <var>value</var>'s <span>snapshot state</span> to
<var>serialized</var>.[[SnapshotState]].</p></li>

<li><p>Set <var>value</var>'s underlying byte sequence to
<var>serialized</var>.[[ByteSequence]].</p></li>
</ol>

<hr>

<p><code>File</code> objects are <span>serializable objects</span>. The <code>File</code>
interface must be annotated with the <code data-x="Serializable">[Serializable]</code>
<span>extended attribute</span>. Their <span>serialization steps</span>, given <var>value</var>
and <var>serialized</var>, are:</p>

<ol>
<li><p>Set <var>serialized</var>.[[SnapshotState]] to <var>value</var>'s <span>snapshot
state</span>.</p></li>

<li><p>Set <var>serialized</var>.[[ByteSequence]] to <var>value</var>'s underlying byte
sequence.</p></li>

<li><p>Set <var>serialized</var>.[[Name]] to the value of <var>value</var>'s <code
data-x="dom-File-name">name</code> attribute.</p></li>

<li><p>Set <var>serialized</var>.[[LastModified]] to the value of <var>value</var>'s <code
data-x="dom-File-lastModified">lastModified</code> attribute.</p></li>
</ol>

<p>Their <span>deserialization steps</span>, given <var>serialized</var> and <var>value</var>,
are:</p>

<ol>
<li><p>Set <var>value</var>'s <span>snapshot state</span> to
<var>serialized</var>.[[SnapshotState]].</p></li>

<li><p>Set <var>value</var>'s underlying byte sequence to
<var>serialized</var>.[[ByteSequence]].</p></li>

<li><p>Initialize the value of <var>value</var>'s <code data-x="dom-File-name">name</code>
attribute to <var>serialized</var>.[[Name]].</p></li>

<li><p>Initialize the value of <var>value</var>'s <code
data-x="dom-File-lastModified">lastModified</code> attribute to
<var>serialized</var>.[[LastModified]].</p></li>
</ol>

<hr>

<p><code>FileList</code> objects are <span>serializable objects</span>. The <code>FileList</code>
interface must be annotated with the <code data-x="Serializable">[Serializable]</code>
<span>extended attribute</span>. Their <span>serialization steps</span>, given <var>value</var>
and <var>serialized</var>, are:</p>

<ol>
<li><p>Set <var>serialized</var>.[[Files]] to an empty <span>list</span>.</p></li>

<li><p>For each <var>file</var> in <var>value</var>, <span data-x="list append">append</span>
the <span>sub-serialization</span> of <var>file</var> to
<var>serialized</var>.[[Files]].</p></li>
</ol>

<p>Their <span>deserialization steps</span>, given <var>serialized</var> and <var>value</var>,
are:</p>

<ol>
<li><p><span data-x="list iterate">For each</span> <var>file</var> of
<var>serialized</var>.[[Files]], add the <span>sub-deserialization</span> of <var>file</var> to
<var>value</var>.</p></li>
</ol>

</div>


Expand Down

0 comments on commit 766dcd3

Please sign in to comment.