You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The <dfnclass="dfn-paneled" data-dfn-type="dfn" data-exportid="slice-blob">slice blob</dfn> algorithm given a <codeclass="idl"><adata-link-type="idl" href="#dfn-Blob" id="ref-for-dfn-Blob⑧">Blob</a></code><var>blob</var>,
822
-
an optional parameter <var>start</var>, an optional parameter <var>end</var>,
823
-
and an optional parameter <var>contentType</var> is used to refer to the following
821
+
The <dfnclass="dfn-paneled" data-dfn-type="dfn" data-exportid="slice-blob">slice blob</dfn> algorithm given a <codeclass="idl"><adata-link-type="idl" href="#dfn-Blob" id="ref-for-dfn-Blob⑧">Blob</a></code><var>blob</var>, <var>start</var>, <var>end</var>, and <var>contentType</var> is used to refer to the following
824
822
steps and returns a new <codeclass="idl"><adata-link-type="idl" href="#dfn-Blob" id="ref-for-dfn-Blob⑨">Blob</a></code> containing the bytes ranging from the <var>start</var> parameter
825
823
up to but not including the <var>end</var> parameter. It must act as follows:
826
824
<ol>
827
825
<lidata-md>
828
826
<p>Let <var>originalSize</var> be <var>blob</var>’s <codeclass="idl"><adata-link-type="idl" href="#dfn-size" id="ref-for-dfn-size">size</a></code>.</p>
829
827
<lidata-md>
830
-
<p>The optional <var>start</var> parameter is a value for the start point of a <adata-link-type="dfn" href="#slice-blob" id="ref-for-slice-blob">slice blob</a> call, and must be treated as a byte-order position, with the zeroth position representing the
828
+
<p>The <var>start</var> parameter, if non-null, is a value for the start point of a <adata-link-type="dfn" href="#slice-blob" id="ref-for-slice-blob">slice blob</a> call, and must be treated as a byte-order position, with the zeroth position representing the
831
829
first byte. User agents must normalize <var>start</var> according to the following:</p>
832
830
<oltype="a">
833
-
<li>If the optional <var>start</var> parameter is not used as a parameter when making this call,
834
-
let <var>relativeStart</var> be 0.
831
+
<li>If <var>start</var> is null, let <var>relativeStart</var> be 0.
835
832
<li>If <var>start</var> is negative, let <var>relativeStart</var> be <code>max((<var>originalSize</var> + <var>start</var>), 0)</code>.
836
833
<li>Otherwise, let <var>relativeStart</var> be <code>min(<var>start</var>, <var>originalSize</var>)</code>.
837
834
</ol>
838
835
<lidata-md>
839
-
<p>The optional <var>end</var> parameter is a value for the end point of a <adata-link-type="dfn" href="#slice-blob" id="ref-for-slice-blob①">slice blob</a> call.
840
-
User agents must normalize <var>end</var> according to the following:</p>
836
+
<p>The <var>end</var> parameter, if non-null. is a value for the end point of a <adata-link-type="dfn" href="#slice-blob" id="ref-for-slice-blob①">slice blob</a> call. User agents must normalize <var>end</var> according to the following:</p>
841
837
<oltype="a">
842
-
<li>If the optional <var>end</var> parameter is not used as a parameter when making this call,
843
-
let <var>relativeEnd</var> be <var>originalSize</var>.
838
+
<li>If <var>end</var> is null, let <var>relativeEnd</var> be <var>originalSize</var>.
844
839
<li>If <var>end</var> is negative, let <var>relativeEnd</var> be <code>max((<var>originalSize</var> + <var>end</var>), 0)</code>.
845
-
<li>Else, let <var>relativeEnd</var> be <code>min(<var>end</var>, <var>originalSize</var>)</code>.
840
+
<li>Otherwise, let <var>relativeEnd</var> be <code>min(<var>end</var>, <var>originalSize</var>)</code>.
846
841
</ol>
847
842
<lidata-md>
848
-
<p>The optional <var>contentType</var> parameteris used to set the ASCII-encoded string in lower
849
-
case representing the media type of the <codeclass="idl"><adata-link-type="idl" href="#dfn-Blob" id="ref-for-dfn-Blob①⓪">Blob</a></code>. User agents must normalize <var>contentType</var> according to the following:</p>
843
+
<p>The <var>contentType</var> parameter, if non-null, is used to set the ASCII-encoded string in
844
+
lower case representing the media type of the <codeclass="idl"><adata-link-type="idl" href="#dfn-Blob" id="ref-for-dfn-Blob①⓪">Blob</a></code>. User agents must normalize <var>contentType</var> according to the following:</p>
850
845
<oltype="a">
851
-
<li>If the <var>contentType</var> parameter is not provided, let <var>relativeContentType</var> be set to the empty string.
846
+
<li>If <var>contentType</var> is null, let <var>relativeContentType</var> be set to the empty
847
+
string.
852
848
<li>
853
849
Otherwise, let <var>relativeContentType</var> be set to <var>contentType</var> and run the
returns a new <codeclass="idl"><adata-link-type="idl" href="#dfn-Blob" id="ref-for-dfn-Blob③①">Blob</a></code> object with bytes ranging from the optional <var>start</var> parameter
1267
1264
up to but not including the optional <var>end</var> parameter, and with a <codeclass="idl"><adata-link-type="idl" href="#dfn-type" id="ref-for-dfn-type①⓪">type</a></code> attribute
1268
-
that is the value of the optional <var>contentType</var> parameter. It must act as follows:</p>
1269
-
<ol>
1270
-
<lidata-md>
1271
-
<p>Return the result of <adata-link-type="dfn" href="#slice-blob" id="ref-for-slice-blob②">slice blob</a> given <adata-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this">this</a>, <var>start</var>, <var>end</var>,
1272
-
and <var>contentType</var>.</p>
1273
-
</ol>
1274
-
<divclass="example" id="example-0ffe45c5">
1275
-
<aclass="self-link" href="#example-0ffe45c5"></a> The examples below illustrate the different types of <codeclass="idl"><adata-link-type="idl" href="#dfn-slice" id="ref-for-dfn-slice③">slice()</a></code> calls possible. Since the <codeclass="idl"><adata-link-type="idl" href="#dfn-file" id="ref-for-dfn-file⑦">File</a></code> interface inherits from the <codeclass="idl"><adata-link-type="idl" href="#dfn-Blob" id="ref-for-dfn-Blob③②">Blob</a></code> interface, examples are based on the use of the <codeclass="idl"><adata-link-type="idl" href="#dfn-file" id="ref-for-dfn-file⑧">File</a></code> interface.
1265
+
that is the value of the optional <var>contentType</var> parameter. It must act as follows:
1266
+
<ol>
1267
+
<lidata-md>
1268
+
<p>Let <var>sliceStart</var>, <var>sliceEnd</var>, and <var>sliceContentType</var> be null.</p>
1269
+
<lidata-md>
1270
+
<p>If <var>start</var> is given, set <var>sliceStart</var> to <var>start</var>.</p>
1271
+
<lidata-md>
1272
+
<p>If <var>end</var> is given, set <var>sliceEnd</var> to <var>end</var>.</p>
1273
+
<lidata-md>
1274
+
<p>If <var>contentType</var> is given, set <var>sliceContentType</var> to <var>contentType</var>.</p>
1275
+
<lidata-md>
1276
+
<p>Return the result of <adata-link-type="dfn" href="#slice-blob" id="ref-for-slice-blob②">slice blob</a> given <adata-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this">this</a>, <var>sliceStart</var>, <var>sliceEnd</var>, and <var>sliceContentType</var>.</p>
1277
+
</ol>
1278
+
<divclass="example" id="example-0ffe45c5">
1279
+
<aclass="self-link" href="#example-0ffe45c5"></a> The examples below illustrate the different types of <codeclass="idl"><adata-link-type="idl" href="#dfn-slice" id="ref-for-dfn-slice③">slice()</a></code> calls possible. Since the <codeclass="idl"><adata-link-type="idl" href="#dfn-file" id="ref-for-dfn-file⑦">File</a></code> interface inherits from the <codeclass="idl"><adata-link-type="idl" href="#dfn-Blob" id="ref-for-dfn-Blob③②">Blob</a></code> interface, examples are based on the use of the <codeclass="idl"><adata-link-type="idl" href="#dfn-file" id="ref-for-dfn-file⑧">File</a></code> interface.
1276
1280
<preclass="lang-javascript highlight"><c-c1>// obtain input element through DOM</c->
0 commit comments