8000 add more spec links to TextDecoderCommon · servo/servo@35e8169 · GitHub
[go: up one dir, main page]

Skip to content

Commit 35e8169

Browse files
author
minghuaw
committed
add more spec links to TextDecoderCommon
Signed-off-by: minghuaw <wuminghua7@huawei.com>
1 parent b3f994d commit 35e8169

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

components/script/dom/textdecodercommon.rs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,34 @@ use crate::dom::bindings::error::{Error, Fallible};
1212

1313
/// The shared part of `TextDecoder` and `TextDecoderStream`
1414
///
15-
/// Note that this does NOT correspond to the `TextDecoderCommon`
16-
/// interface defined in the WebIDL
15+
/// Note that other than the three attributes defined in the `TextDecoderCommon`
16+
/// interface in the WebIDL, this also performs decoding.
17+
///
18+
/// <https://encoding.spec.whatwg.org/#textdecodercommon>
1719
#[allow(non_snake_case)]
1820
#[derive(JSTraceable, MallocSizeOf)]
1921
pub(crate) struct TextDecoderCommon {
22+
/// <https://encoding.spec.whatwg.org/#dom-textdecoder-encoding>
2023
#[no_trace]
2124
encoding: &'static Encoding,
25+
26+
/// <https://encoding.spec.whatwg.org/#dom-textdecoder-fatal>
2227
fatal: bool,
28+
29+
/// <https://encoding.spec.whatwg.org/#dom-textdecoder-ignorebom>
2330
ignoreBOM: bool,
31+
32+
/// The native decoder that is used to perform decoding
33+
///
34+
/// <https://encoding.spec.whatwg.org/#textdecodercommon-decoder>
2435
#[ignore_malloc_size_of = "defined in encoding_rs"]
2536
#[no_trace]
2637
decoder: RefCell<Decoder>,
38+
39+
/// <https://encoding.spec.whatwg.org/#textdecodercommon-i-o-queue>
2740
in_stream: RefCell<Vec<u8>>,
41+
42+
/// <https://encoding.spec.whatwg.org/#textdecoder-do-not-flush-flag>
2843
do_not_flush: Cell<bool>,
2944
}
3045

@@ -63,6 +78,7 @@ impl TextDecoderCommon {
6378
self.ignoreBOM
6479
}
6580

81+
/// <https://encoding.spec.whatwg.org/#dom-textdecoder-decode>
6682
#[allow(unsafe_code)]
6783
pub(crate) fn decode(
6884
&self,

0 commit comments

Comments
 (0)
0