From 595f2ec2787fcfd4fbffc392dfc925db39b28915 Mon Sep 17 00:00:00 2001 From: Marijn Kruisselbrink Date: Fri, 3 Feb 2017 14:45:59 -0800 Subject: [PATCH] Remove definition of Blob.close() and all related terms. As discussed in #10, the utility of the close() method is unclear, and properly specifying it would add a large amount of complexity. By removing closing entirely, this fixes #10, fixes #17 and fixes #18. --- index.bs | 104 +----- index.html | 926 ++++++++++++++++++++--------------------------------- 2 files changed, 355 insertions(+), 675 deletions(-) diff --git a/index.bs b/index.bs index 4c767ab..82d5bd2 100644 --- a/index.bs +++ b/index.bs @@ -205,14 +205,6 @@ and has a {{Blob/size}} attribute which is the total number of bytes in the byte and a {{Blob/type}} attribute, which is an ASCII-encoded string in lower case representing the media type of the byte sequence. -A {{Blob}} must have a readability state, -which is one of OPENED or CLOSED. -A {{Blob}} that refers to a byte sequence, -including one of 0 bytes, -is said to be in the OPENED readability state. -A {{Blob}} is said to be closed if its {{Blob/close()}} method has been called. -A {{Blob}} that is closed is said to be in the CLOSED readability state. - Each {{Blob}} must have an internal snapshot state, which must be initially set to the state of the underlying storage, if any such underlying storage exists, @@ -226,15 +218,11 @@ interface Blob { readonly attribute unsigned long long size; readonly attribute DOMString type; - readonly attribute boolean isClosed; - - //slice Blob into byte-ranged chunks + // slice Blob into byte-ranged chunks Blob slice([Clamp] optional long long start, [Clamp] optional long long end, optional DOMString contentType); - void close(); - }; dictionary BlobPropertyBag { @@ -252,8 +240,7 @@ When the {{Blob()}} constructor is invoked, user agents must run the following steps: 1. If invoked with zero parameters, - return a new {{Blob}} object with its readability state set to OPENED, - consisting of 0 bytes, + return a new {{Blob}} object consisting of 0 bytes, with {{Blob/size}} set to 0, and with {{Blob/type}} set to the empty string. @@ -289,8 +276,7 @@ user agents must run the following steps: then set |t| to the empty string and return from these substeps. 2. Convert every character in |t| to [=ASCII lowercase=]. -6. Return a {{Blob}} object with its readability state set to OPENED, - referring to |bytes| as its associated byte sequence, +6. Return a {{Blob}} object referring to |bytes| as its associated byte sequence, with its {{Blob/size}} set to the length of |bytes|, and its {{Blob/type}} set to the value of |t| from the substeps above. @@ -349,8 +335,6 @@ Attributes
Returns the size of the byte sequence in number of bytes. On getting, conforming user agents must return the total number of bytes that can be read by a {{FileReader}} or {{FileReaderSync}} object, or 0 if the {{Blob}} has no bytes to be read. - If the {{Blob}} has a readability state of CLOSED - then {{Blob/size}} must return 0.
type
The ASCII-encoded string in lower case representing the media type of the {{Blob}}. @@ -376,13 +360,6 @@ Attributes Note: Use of the {{Blob/type}} attribute informs the encoding determination and parsing the Content-Type header when dereferencing Blob URLs. - -
isClosed -
The boolean value that indicates whether the {{Blob}} is in the CLOSED readability state. - On getting, user agents must return false - if the {{Blob}} is in the OPENED readability state, - and true if the {{Blob}} is in the CLOSED readability state - as a result of the {{Blob/close()}} method being called. @@ -439,12 +416,6 @@ It must act as follows: 6. Return a new {{Blob}} object |S| with the following characteristics:
    -
  1. |S| has a readability state equal to that of |O|'s readability state. - - Note: The readability state of the context object is retained - by the {{Blob}} object returned by the {{Blob/slice()}} call; - this has implications on whether the returned {{Blob}} is actually usable - for read operations or as a Blob URL.
  2. |S| refers to |span| consecutive bytes from |O|, beginning with the byte at byte-order position |relativeStart|.
  3. |S|.{{Blob/size}} = |span|. @@ -483,19 +454,6 @@ It must act as follows: -

    -The close method

    - -The close() method is said to close a {{Blob}}, -and must act as follows: - -1. If the readability state of the context object is CLOSED, - terminate this algorithm. -2. Otherwise, set the readability state of the context object to CLOSED. -3. If the context object has an entry in the Blob URL Store, - remove the entry that corresponds to the context object. - -