Re: [w3c/FileAPI] Rewrite a lot of the internals of Blobs to make reading more explicit. (#154)

@inexorabletash commented on this pull request.

In progress. Made it to line ~400 or so

>  
-Their [=deserialization step=], given |serialized| and |value|, are:
+1. If |forStorage| is true:
+  1. Let |bytes| be the result of [=read all bytes|reading all bytes=] from |value|.
+  1. Set |serialized|.\[[BlobData]] to the result of [=creating blob data from bytes=] given |bytes|.
+
+1. Otherwise:
+  1. Set |serialized|.\[[BlobData]] to |value|.[=[[data]]=].
+
+1. Set |serialized|.\[[Type]] to |value|.[=[[type]]=].
+
+</div>
+
+<div algorithm="blob deserialize">
+Their [=deserialization step=] (the <dfn>blob deserialization steps</dfn>),

nit: "step" &rarr; "steps"

> -    * {{USVString}} elements.
-
-  <dt id="dfn-BlobPropertyBagMembers">An *optional* {{BlobPropertyBag}}
-  <dd>which takes these optional members:
-    * <dfn id="dfn-BPtype" dict-member for="BlobPropertyBag">type</dfn>,
-      the ASCII-encoded string in lower case representing the media type of the {{Blob}}.
-      Normative conditions for this member are provided in the [[#constructorBlob]].
-    * <dfn dict-member for="BlobPropertyBag">endings</dfn>,
-      an enum which can take the values {{"transparent"}} or {{"native"}}.
-      By default this is set to {{"transparent"}}. If set to {{"native"}},
-      [=convert line endings to native|line endings will be converted to native=]
-      in any {{USVString}} elements in {{blobParts}}.
-</dl>
+1. Let |read state| be a new [=bytes blob read state=].
+1. If |offset| is larger than |snapshot state|[<code><a for="bytes blob snapshot state">"data"</a></code>]'s [=byte sequence/length=],
+  set |read state|.[=bytes blob read state/bytes=] to an empty [=byte sequence=].

FWIW, I don't see the _struct_._name_ syntax called out in Infra. Do you know if there's plan to add it?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/FileAPI/pull/154#pullrequestreview-416547487

Received on Thursday, 21 May 2020 23:24:54 UTC