From 14bbfe38300c6c66491a92b0486a58b9a0b47b2d Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Sat, 1 Aug 2026 06:40:28 +0000 Subject: [PATCH 1/2] Editorial: use encodingLabel for algorithm arguments Distinguish the encoding label supplied to FileReader algorithms from an encoding's canonical name. Co-Authored-By: codex --- index.bs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/index.bs b/index.bs index 5036e80..d7b282b 100644 --- a/index.bs +++ b/index.bs @@ -1011,7 +1011,7 @@ when invoked, must return [=this=]'s [=FileReader/error=].
A {{FileReader}} |fr| has an associated read operation algorithm, -which given |blob|, a |type| and an optional |encodingName|, +which given |blob|, a |type| and an optional |encodingLabel|, runs the following steps: 1. If |fr|'s [=FileReader/state=] is `"loading"`, @@ -1046,7 +1046,7 @@ runs the following steps: [=queue a task=] to run the following steps and abort this algorithm: 1. Set |fr|'s [=FileReader/state=] to `"done"`. 1. Let |result| be the result of - [=package data=] given |bytes|, |type|, |blob|'s {{Blob/type}}, and |encodingName|. + [=package data=] given |bytes|, |type|, |blob|'s {{Blob/type}}, and |encodingLabel|. 1. If [=package data=] threw an exception |error|: 1. Set |fr|'s [=FileReader/error=] to |error|. 1. [=Fire a progress event=] called {{error!!event}} at |fr|. @@ -1193,7 +1193,7 @@ the user agent must run the steps below:
A {{Blob}} has an associated package data algorithm, -given |bytes|, a |type|, a optional |mimeType|, and a optional |encodingName|, +given |bytes|, a |type|, a optional |mimeType|, and a optional |encodingLabel|, which switches on |type| and runs the associated steps: : DataURL @@ -1207,8 +1207,8 @@ which switches on |type| and runs the associated steps: : Text :: 1. Let |encoding| be failure. - 1. If the |encodingName| is present, set |encoding| to the result of - [=getting an encoding=] from |encodingName|. + 1. If the |encodingLabel| is present, set |encoding| to the result of + [=getting an encoding=] from |encodingLabel|. 1. If |encoding| is failure, and |mimeType| is present: 1. Let |type| be the result of [=parse a MIME type=] given |mimeType|. 1. If |type| is not failure, From 0e80c93fecbbb96f323ce343ab710d8a5af80486 Mon Sep 17 00:00:00 2001 From: Domenic Denicola Date: Sat, 1 Aug 2026 06:43:34 +0000 Subject: [PATCH 2/2] Editorial: require a MIME type when packaging data All callers pass a Blob type to the package data algorithm, so make the argument required and remove the redundant presence check. Clarify that an empty MIME type is omitted from Data URLs. Co-Authored-By: codex --- index.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.bs b/index.bs index d7b282b..9e3b84e 100644 --- a/index.bs +++ b/index.bs @@ -1193,15 +1193,15 @@ the user agent must run the steps below:
A {{Blob}} has an associated package data algorithm, -given |bytes|, a |type|, a optional |mimeType|, and a optional |encodingLabel|, +given |bytes|, a |type|, a |mimeType|, and an optional |encodingLabel|, which switches on |type| and runs the associated steps: : DataURL :: Return |bytes| as a DataURL [[!RFC2397]] subject to the considerations below: - * Use |mimeType| as part of the Data URL if it is available + * Use |mimeType| as part of the Data URL if it is not the empty string in keeping with the Data URL specification [[!RFC2397]]. - * If |mimeType| is not available return a Data URL without a media-type. [[!RFC2397]]. + * Otherwise, return a Data URL without a media-type. [[!RFC2397]]. Issue(104): Better specify how the DataURL is generated. @@ -1209,7 +1209,7 @@ which switches on |type| and runs the associated steps: :: 1. Let |encoding| be failure. 1. If the |encodingLabel| is present, set |encoding| to the result of [=getting an encoding=] from |encodingLabel|. - 1. If |encoding| is failure, and |mimeType| is present: + 1. If |encoding| is failure: 1. Let |type| be the result of [=parse a MIME type=] given |mimeType|. 1. If |type| is not failure, set |encoding| to the result of [=getting an encoding=]