@@ -188,15 +188,15 @@ from an <a for=/>I/O queue</a> <var>ioQueue</var>, run these steps:
188
188
<p> To <a for="I/O queue">push</a> a sequence of items to an <a for=/>I/O queue</a>
189
189
<var> ioQueue</var> is to push each item in the sequence to <var> ioQueue</var> , in the given order.
190
190
191
- <p> To <dfn id=concept-stream-prepend for="I/O queue">prepend</dfn> an <a for=list>item</a> other
192
- than <a>end-of-queue</a> to an <a for=/>I/O queue</a> , perform the normal <a for=/>list</a>
193
- <a for=list>prepend</a> operation. To prepend a sequence of items not containing
194
- <a>end-of-queue</a> , insert those items, in the given order, before the first item in the queue.
191
+ <p> To <dfn id=concept-stream-prepend for="I/O queue">restore</dfn> an <a for=list>item</a> other
192
+ than <a>end-of-queue</a> to an <a for=/>I/O queue</a> , perform the <a for=/>list</a>
193
+ <a for=list>prepend</a> operation. To <a for="I/O queue">restore</a> a <a for=/>list</a> of
194
+ <a for=list>items</a> excluding <a>end-of-queue</a> to an <a for=/>I/O queue</a> , insert those
195
+ items, in the given order, before the first item in the queue.
195
196
196
- <p class=example id=example-tokens> Inserting the sequence of scalar value items
197
- <code> &#128169;</code> in an I/O queue of scalar values "<code> hello world</code> ", results in
198
- an I/O queue "<code> &#128169; hello world</code> ". The next item to be read would be
199
- <code> &</code> . <!-- 💩 -->
197
+ <p class=example id=example-tokens> Inserting the bytes « 0xF0, 0x9F » in an I/O queue
198
+ « 0x92 0xA9, <a>end-of-queue</a> », results in an I/O queue
199
+ « 0xF0, 0x9F, 0x92 0xA9, <a>end-of-queue</a> ». The next item to be read would be 0xF0. <!-- 💩 -->
200
200
201
201
<p> To <dfn for="from I/O queue">convert</dfn> an <a for=/>I/O queue</a> <var> ioQueue</var> into a
202
202
<a for=/>list</a> , <a>string</a> , or <a>byte sequence</a> , return the result of
@@ -218,8 +218,8 @@ an I/O queue "<code>&#128169; hello world</code>". The next item to be read
218
218
See <a href="https://github.com/whatwg/infra/issues/319">whatwg/infra issue #319</a> . [[INFRA]]
219
219
220
220
<p class=note> <a for=/>I/O queues</a> are defined as <a for=/>lists</a> , not
221
- <a spec=infra>queues</a> , because they feature a <a for="I/O queue">prepend </a> operation. However,
222
- this prepend operation is an internal detail of the algorithms in this specification, and is not to
221
+ <a spec=infra>queues</a> , because they feature a <a for="I/O queue">restore </a> operation. However,
222
+ this restore operation is an internal detail of the algorithms in this specification, and is not to
223
223
be used by other standards. Implementations are free to find alternative ways to implement such
224
224
algorithms, as detailed in [[#implementation-considerations]] .
225
225
@@ -1355,7 +1355,7 @@ initially false.
1355
1355
<a>replacement</a> , <a>throws</a> a {{RangeError}} .
1356
1356
1357
1357
<dt><code><var> decoder</var> . <a attribute for=TextDecoderCommon>encoding</a> </code>
1358
- <dd><p> Returns <a for=TextDecoderCommon>encoding</a> 's <a>name</a> , lowercased.
1358
+ <dd><p> Returns <a for=TextDecoderCommon>encoding</a> 's <a for=encoding >name</a> , lowercased.
1359
1359
1360
1360
<dt><code><var> decoder</var> . <a attribute for=TextDecoderCommon>fatal</a> </code>
1361
1361
<dd><p> Returns true if <a for=TextDecoderCommon>error mode</a> is "<code> fatal</code> ", otherwise
@@ -1672,7 +1672,7 @@ TextDecoderStream includes GenericTransformStream;
1672
1672
<a>replacement</a> , <a>throws</a> a {{RangeError}} .
1673
1673
1674
1674
<dt><code><var> decoder</var> . <a attribute for=TextDecoderCommon>encoding</a> </code>
1675
- <dd><p> Returns <a for=TextDecoderCommon>encoding</a> 's <a>name</a> , lowercased.
1675
+ <dd><p> Returns <a for=TextDecoderCommon>encoding</a> 's <a for=encoding >name</a> , lowercased.
1676
1676
1677
1677
<dt><code><var> decoder</var> . <a attribute for=TextDecoderCommon>fatal</a> </code>
1678
1678
<dd><p> Returns true if <a for=TextDecoderCommon>error mode</a> is "<code> fatal</code> ", and
@@ -1981,7 +1981,7 @@ constructor steps are:
1981
1981
whose value is 0x10000 + ((<var> high surrogate</var> − 0xD800) << 10) +
1982
1982
(<var> item</var> − 0xDC00).
1983
1983
1984
- <li><p> <a>Prepend </a> <var> item</var> to <var> input</var> .
1984
+ <li><p> <a>Restore </a> <var> item</var> to <var> input</var> .
1985
1985
1986
1986
<li><p> Return U+FFFD.
1987
1987
</ol>
@@ -2113,7 +2113,7 @@ in deployed content. Therefore it is not part of the <a>UTF-8 decoder</a> algori
2113
2113
set <a>UTF-8 lower boundary</a> to 0x80, and set
2114
2114
<a>UTF-8 upper boundary</a> to 0xBF.
2115
2115
2116
- <li><p> <a>Prepend </a> <var> byte</var> to <var> ioQueue</var> .
2116
+ <li><p> <a>Restore </a> <var> byte</var> to <var> ioQueue</var> .
2117
2117
2118
2118
<li><p> Return <a>error</a> .
2119
2119
</ol>
@@ -2339,7 +2339,7 @@ consumers of content generated with <a>GBK</a>'s <a for=/>encoder</a>.
2339
2339
<p> If <var> byte</var> is not in the range 0x30 to 0x39, inclusive, then:
2340
2340
2341
2341
<ol>
2342
- <li><p> <a>Prepend </a> <a>gb18030 second</a> , <a>gb18030 third</a> , and <var> byte</var> to
2342
+ <li><p> <a>Restore </a> « <a>gb18030 second</a> , <a>gb18030 third</a> , <var> byte</var> » to
2343
2343
<var> ioQueue</var> .
2344
2344
2345
2345
<li><p> Set <a>gb18030 first</a> , <a>gb18030 second</a> , and <a>gb18030 third</a> to 0x00.
@@ -2366,10 +2366,8 @@ consumers of content generated with <a>GBK</a>'s <a for=/>encoder</a>.
2366
2366
<li><p> If <var> byte</var> is in the range 0x81 to 0xFE, inclusive, set
2367
2367
<a>gb18030 third</a> to <var> byte</var> and return <a>continue</a> .
2368
2368
2369
- <li><p> <a>Prepend</a> <a>gb18030 second</a>
2370
- followed by <var> byte</var> to <var> ioQueue</var> , set
2371
- <a>gb18030 first</a> and <a>gb18030 second</a> to 0x00, and return
2372
- <a>error</a> .
2369
+ <li><p> <a>Restore</a> « <a>gb18030 second</a> , <var> byte</var> » to <var> ioQueue</var> , set
2370
+ <a>gb18030 first</a> and <a>gb18030 second</a> to 0x00, and return <a>error</a> .
2373
2371
</ol>
2374
2372
2375
2373
<li>
@@ -2394,7 +2392,7 @@ consumers of content generated with <a>GBK</a>'s <a for=/>encoder</a>.
2394
2392
<li><p> If <var> code point</var> is non-null, return a code point whose value is
2395
2393
<var> code point</var> .
2396
2394
2397
- <li><p> If <var> byte</var> is an <a>ASCII byte</a> , <a>prepend </a> <var> byte</var> to
2395
+ <li><p> If <var> byte</var> is an <a>ASCII byte</a> , <a>restore </a> <var> byte</var> to
2398
2396
<var> ioQueue</var> .
2399
2397
2400
2398
<li><p> Return <a>error</a> .
@@ -2540,7 +2538,7 @@ and <var>byte</var>, runs these steps:
2540
2538
<li><p> If <var> code point</var> is non-null, return a code point whose value is
2541
2539
<var> code point</var> .
2542
2540
2543
- <li><p> If <var> byte</var> is an <a>ASCII byte</a> , <a>prepend </a> <var> byte</var> to
2541
+ <li><p> If <var> byte</var> is an <a>ASCII byte</a> , <a>restore </a> <var> byte</var> to
2544
2542
<var> ioQueue</var> .
2545
2543
2546
2544
<li><p> Return <a>error</a> .
@@ -2636,7 +2634,7 @@ and <var>code point</var>, runs these steps:
2636
2634
<li><p> If <var> code point</var> is non-null, return a code point whose value is
2637
2635
<var> code point</var> .
2638
2636
2639
- <li><p> If <var> byte</var> is an <a>ASCII byte</a> , <a>prepend </a> <var> byte</var> to
2637
+ <li><p> If <var> byte</var> is an <a>ASCII byte</a> , <a>restore </a> <var> byte</var> to
2640
2638
<var> ioQueue</var> .
2641
2639
2642
2640
<li><p> Return <a>error</a> .
@@ -2854,7 +2852,7 @@ and <var>code point</var>, runs these steps:
2854
2852
<a lt="ISO-2022-JP decoder escape">escape</a> , and return
2855
2853
<a>continue</a> .
2856
2854
2857
- <li><p> If <var> byte</var> is not <a>end-of-queue</a> , then <a>prepend </a>
2855
+ <li><p> If <var> byte</var> is not <a>end-of-queue</a> , then <a>restore </a>
2858
2856
<var> byte</var> to <var> ioQueue</var> .
2859
2857
2860
2858
<li><p> Set <a>ISO-2022-JP output</a> to false,
@@ -2898,9 +2896,9 @@ and <var>code point</var>, runs these steps:
2898
2896
<a>error</a> otherwise.
2899
2897
</ol>
2900
2898
2901
- <li><p> If <var> byte</var> is <a>end-of-queue</a> , then <a>prepend </a>
2902
- <var> lead </var> to < var>ioQueue </var> . Otherwise , <a>prepend</a>
2903
- <var> lead </var> and <var> byte </var> to <var> ioQueue</var> .
2899
+ <li><p> If <var> byte</var> is <a>end-of-queue</a> , then <a>restore </a> <var> lead </var> to
2900
+ <var> ioQueue </var> ; otherwise, <a>restore</a> « < var>lead </var> , <var> byte </var> » to
2901
+ <var> ioQueue</var> .
2904
2902
2905
2903
<li><p> Set <a>ISO-2022-JP output</a> to false,
2906
2904
<a>ISO-2022-JP decoder state</a> to <a>ISO-2022-JP decoder output state</a>
@@ -2972,15 +2970,15 @@ and <var>code point</var>, runs these steps:
2972
2970
<li><p> If <var> code point</var> is an <a>ASCII code point</a> , and
2973
2971
<a>ISO-2022-JP encoder state</a> is not
2974
2972
<a lt="ISO-2022-JP encoder ASCII">ASCII</a> ,
2975
- <a>prepend </a> <var> code point</var> to
2973
+ <a>restore </a> <var> code point</var> to
2976
2974
<var> ioQueue</var> , set <a>ISO-2022-JP encoder state</a> to
2977
2975
<a lt="ISO-2022-JP encoder ASCII">ASCII</a> , and return three bytes
2978
2976
0x1B 0x28 0x42.
2979
2977
2980
2978
<li><p> If <var> code point</var> is either U+00A5 or U+203E, and
2981
2979
<a>ISO-2022-JP encoder state</a> is not
2982
2980
<a lt="ISO-2022-JP encoder Roman">Roman</a> ,
2983
- <a>prepend </a> <var> code point</var> to
2981
+ <a>restore </a> <var> code point</var> to
2984
2982
<var> ioQueue</var> , set <a>ISO-2022-JP encoder state</a> to
2985
2983
<a lt="ISO-2022-JP encoder Roman">Roman</a> , and return three bytes
2986
2984
0x1B 0x28 0x4A.
@@ -3003,7 +3001,7 @@ and <var>code point</var>, runs these steps:
3003
3001
3004
3002
<ol>
3005
3003
<li><p> If <a>ISO-2022-JP encoder state</a> is <a lt="ISO-2022-JP encoder jis0208">jis0208</a> ,
3006
- then <a>prepend </a> <var> code point</var> to <var> ioQueue</var> , set
3004
+ then <a>restore </a> <var> code point</var> to <var> ioQueue</var> , set
3007
3005
<a>ISO-2022-JP encoder state</a> to <a lt="ISO-2022-JP encoder ASCII">ASCII</a> , and return three
3008
3006
bytes 0x1B 0x28 0x42.
3009
3007
@@ -3012,7 +3010,7 @@ and <var>code point</var>, runs these steps:
3012
3010
3013
3011
<li><p> If <a>ISO-2022-JP encoder state</a> is not
3014
3012
<a lt="ISO-2022-JP encoder jis0208">jis0208</a> ,
3015
- <a>prepend </a> <var> code point</var> to
3013
+ <a>restore </a> <var> code point</var> to
3016
3014
<var> ioQueue</var> , set <a>ISO-2022-JP encoder state</a> to
3017
3015
<a lt="ISO-2022-JP encoder jis0208">jis0208</a> , and return three bytes
3018
3016
0x1B 0x24 0x42.
@@ -3071,7 +3069,7 @@ and <var>code point</var>, runs these steps:
3071
3069
<li><p> If <var> code point</var> is non-null, return a code point whose value is
3072
3070
<var> code point</var> .
3073
3071
3074
- <li><p> If <var> byte</var> is an <a>ASCII byte</a> , <a>prepend </a> <var> byte</var> to
3072
+ <li><p> If <var> byte</var> is an <a>ASCII byte</a> , <a>restore </a> <var> byte</var> to
3075
3073
<var> ioQueue</var> .
3076
3074
3077
3075
<li><p> Return <a>error</a> .
@@ -3171,7 +3169,7 @@ and <var>code point</var>, runs these steps:
3171
3169
<li><p> If <var> code point</var> is non-null, return a code point whose value is
3172
3170
<var> code point</var> .
3173
3171
3174
- <li><p> If <var> byte</var> is an <a>ASCII byte</a> , <a>prepend </a> <var> byte</var> to
3172
+ <li><p> If <var> byte</var> is an <a>ASCII byte</a> , <a>restore </a> <var> byte</var> to
3175
3173
<var> ioQueue</var> .
3176
3174
3177
3175
<li><p> Return <a>error</a> .
@@ -3297,10 +3295,11 @@ rather the <a>decode</a> algorithm.
3297
3295
3298
3296
<li><p> Let <var> byte2</var> be <var> code unit</var> & 0x00FF.
3299
3297
3300
- <li><p> Let <var> bytes</var> be two bytes whose values are <var> byte1</var> and <var> byte2</var> ,
3301
- if <a>is UTF-16BE decoder</a> is true, and <var> byte2</var> and <var> byte1</var> otherwise.
3298
+ <li><p> Let <var> bytes</var> be a <a for=/>list</a> of two bytes whose values are <var> byte1</var>
3299
+ and <var> byte2</var> , if <a>is UTF-16BE decoder</a> is true; otherwise <var> byte2</var> and
3300
+ <var> byte1</var> .
3302
3301
3303
- <li><p> <a>Prepend </a> the <var> bytes</var> to <var> ioQueue</var> and return <a>error</a> .
3302
+ <li><p> <a>Restore </a> <var> bytes</var> to <var> ioQueue</var> and return <a>error</a> .
3304
3303
<!-- unpaired surrogates; IE/WebKit output them, Gecko/Opera U+FFFD them -->
3305
3304
</ol>
3306
3305
@@ -3396,7 +3395,7 @@ decoded using <a>UTF-16BE/LE</a>.
3396
3395
3397
3396
<h2 class=no-num id=implementation-considerations>Implementation considerations</h2>
3398
3397
3399
- <p> Instead of supporting <a for=/>I/O queues</a> with arbitrary <a for="I/O queue">prepend </a> , the
3398
+ <p> Instead of supporting <a for=/>I/O queues</a> with arbitrary <a for="I/O queue">restore </a> , the
3400
3399
<a for=/>decoders</a> for <a for=/>encodings</a> in this standard could be implemented with:
3401
3400
3402
3401
<ol>
0 commit comments