diff --git a/encoding.bs b/encoding.bs index fe4e1a9..b19d150 100644 --- a/encoding.bs +++ b/encoding.bs @@ -1855,8 +1855,8 @@ TextEncoderStream includes GenericTransformStream;
A {{TextEncoderStream}} object offers no label argument as it @@ -1974,26 +1974,26 @@ constructor steps are:
If encoder's pending high surrogate is non-null, then: +
If encoder's leading surrogate is non-null, then:
Let high surrogate be encoder's pending high surrogate. +
Let leadingSurrogate be encoder's leading surrogate. -
Set encoder's pending high surrogate to null. +
Set encoder's leading surrogate to null. -
If item is in the range U+DC00 to U+DFFF, inclusive, then return a scalar value - whose value is 0x10000 + ((high surrogate − 0xD800) << 10) + - (item − 0xDC00). +
If item is a trailing surrogate, then return a scalar value whose value + is + 0x10000 + ((leadingSurrogate − 0xD800) << 10) + (item − 0xDC00).
Restore item to input.
Return U+FFFD.
If item is in the range U+D800 to U+DBFF, inclusive, then set pending high - surrogate to item and return continue. +
If item is a leading surrogate, then set leading surrogate to + item and return continue. -
If item is in the range U+DC00 to U+DFFF, inclusive, then return U+FFFD. +
If item is a trailing surrogate, then return U+FFFD.
Return item.
If encoder's pending high surrogate is non-null, then: +
If encoder's leading surrogate is non-null, then:
shared UTF-16 decoder has an associated UTF-16 lead byte and -UTF-16 lead surrogate (both initially null), and +UTF-16 leading surrogate (both initially null), and is UTF-16BE decoder (initially false).
shared UTF-16 decoder's handler, given ioQueue and @@ -3330,12 +3330,12 @@ rather the decode algorithm.
If byte is end-of-queue and either - UTF-16 lead byte or UTF-16 lead surrogate is non-null, set - UTF-16 lead byte and UTF-16 lead surrogate to null, and return + UTF-16 lead byte or UTF-16 leading surrogate is non-null, set + UTF-16 lead byte and UTF-16 leading surrogate to null, and return error.
If byte is end-of-queue and - UTF-16 lead byte and UTF-16 lead surrogate are null, return + UTF-16 lead byte and UTF-16 leading surrogate are null, return finished.
If UTF-16 lead byte is null, set UTF-16 lead byte to @@ -3354,13 +3354,16 @@ rather the decode algorithm.
Then set UTF-16 lead byte to null.
If UTF-16 lead surrogate is non-null, let lead surrogate be - UTF-16 lead surrogate, set UTF-16 lead surrogate to null, and then: +
If UTF-16 leading surrogate is non-null:
If code unit is in the range U+DC00 to U+DFFF, inclusive, - return a code point whose value is - 0x10000 + ((lead surrogate − 0xD800) << 10) + (code unit − 0xDC00). +
Let leadingSurrogate be UTF-16 leading surrogate. + +
Set UTF-16 leading surrogate to null. + +
If code unit is a trailing surrogate, then return a code point whose + value is + 0x10000 + ((leadingSurrogate − 0xD800) << 10) + (code unit − 0xDC00).
Let byte1 be code unit >> 8. @@ -3371,16 +3374,12 @@ rather the decode algorithm. byte1.
If code unit is in the range U+D800 to U+DBFF, inclusive, set - UTF-16 lead surrogate to code unit and return - continue. +
If code unit is a leading surrogate, then set + UTF-16 leading surrogate to code unit and return continue. -
If code unit is in the range U+DC00 to U+DFFF, inclusive, - return error. - +
If code unit is a trailing surrogate, then return error.
Return code point code unit.