From 87ecc5cdd52f13a94b898f0a7082cd7d15b4875f Mon Sep 17 00:00:00 2001 From: Blixt Date: Mon, 23 Jul 2018 19:13:50 +0200 Subject: [PATCH 1/2] Change label to encoding for FileReader.readAsText Along with FileReaderSync, of course. Before: readAsText(blob[, label]) After: readAsText(blob[, encoding]) --- index.bs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/index.bs b/index.bs index 44e946e..d9e1dd7 100644 --- a/index.bs +++ b/index.bs @@ -953,7 +953,7 @@ interface FileReader: EventTarget { // async read methods void readAsArrayBuffer(Blob blob); void readAsBinaryString(Blob blob); - void readAsText(Blob blob, optional DOMString label); + void readAsText(Blob blob, optional DOMString encoding); void readAsDataURL(Blob blob); void abort(); @@ -1137,11 +1137,11 @@ the user agent must run the steps below. The {{FileReader/readAsText()}} method The {{FileReader/readAsText()}} method can be called with an optional parameter, -label, +encoding, which is a {{DOMString}} argument that represents the label of an encoding [[!Encoding]]; if provided, it must be used as part of the encoding determination used when processing this method call. -When the readAsText(blob, label) method is called, +When the readAsText(blob, encoding) method is called, the user agent must run the steps below. 1. If {{FileReader/readyState}} = {{FileReader/LOADING}} throw an {{InvalidStateError}} and terminate this algorithm. @@ -1264,7 +1264,7 @@ take a {{Blob}} parameter. This section defines this parameter.
-
blob +
blob
This is a {{Blob}} argument and must be a reference to a single {{File}} in a {{FileList}} or a {{Blob}} argument not obtained from the underlying OS file system. @@ -1278,8 +1278,8 @@ When reading {{Blob}} objects using the {{FileReader/readAsText()}} read meth the following encoding determination steps must be followed: 1. Let |encoding| be null. -2. If the {{FileReader/readAsText()/label}} argument is present when calling the method, - set |encoding| to the result of the getting an encoding from {{FileReader/readAsText()/label}}. +2. If the {{FileReader/readAsText()/encoding}} argument is present when calling the method, + set |encoding| to the result of the getting an encoding from {{FileReader/readAsText()/encoding}}. 3. If the getting an encoding steps above return failure, then set |encoding| to null. 4. If |encoding| is null, @@ -1423,7 +1423,7 @@ interface FileReaderSync { ArrayBuffer readAsArrayBuffer(Blob blob); DOMString readAsBinaryString(Blob blob); - DOMString readAsText(Blob blob, optional DOMString label); + DOMString readAsText(Blob blob, optional DOMString encoding); DOMString readAsDataURL(Blob blob); }; @@ -1440,7 +1440,7 @@ the {{FileReaderSync}} constructor must be available.
The {{FileReaderSync/readAsText()}} method
-When the readAsText(blob, label) method is called, +When the readAsText(blob, encoding) method is called, the following steps must be followed: 1. Initiate a read operation using the blob argument, From a6904b1286e02a1ff9433deb88ecf3158f843875 Mon Sep 17 00:00:00 2001 From: Blixt Date: Wed, 25 Jul 2018 11:50:34 +0200 Subject: [PATCH 2/2] Add oldids="label" to support old links to encoding --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index d9e1dd7..81ed20f 100644 --- a/index.bs +++ b/index.bs @@ -1137,7 +1137,7 @@ the user agent must run the steps below. The {{FileReader/readAsText()}} method The {{FileReader/readAsText()}} method can be called with an optional parameter, -encoding, +encoding, which is a {{DOMString}} argument that represents the label of an encoding [[!Encoding]]; if provided, it must be used as part of the encoding determination used when processing this method call.