html5ever/tree_builder/
types.rs1use crate::tokenizer::states::RawKind;
13use crate::tokenizer::Tag;
14
15use crate::tendril::StrTendril;
16
17#[derive(PartialEq, Eq, Copy, Clone, Debug)]
18pub(crate) enum InsertionMode {
19    Initial,
20    BeforeHtml,
21    BeforeHead,
22    InHead,
23    InHeadNoscript,
24    AfterHead,
25    InBody,
26    Text,
27    InTable,
28    InTableText,
29    InCaption,
30    InColumnGroup,
31    InTableBody,
32    InRow,
33    InCell,
34    InSelect,
35    InSelectInTable,
36    InTemplate,
37    AfterBody,
38    InFrameset,
39    AfterFrameset,
40    AfterAfterBody,
41    AfterAfterFrameset,
42}
43
44#[derive(PartialEq, Eq, Copy, Clone, Debug)]
45pub(crate) enum SplitStatus {
46    NotSplit,
47    Whitespace,
48    NotWhitespace,
49}
50
51#[derive(PartialEq, Eq, Clone, Debug)]
54#[allow(clippy::enum_variant_names)]
55pub(crate) enum Token {
56    Tag(Tag),
57    Comment(StrTendril),
58    Characters(SplitStatus, StrTendril),
59    NullCharacter,
60    Eof,
61}
62
63pub(crate) enum ProcessResult<Handle> {
64    Done,
65    DoneAckSelfClosing,
66    SplitWhitespace(StrTendril),
67    Reprocess(InsertionMode, Token),
68    #[allow(dead_code)] ReprocessForeign(Token),
70    Script(Handle),
71    ToPlaintext,
72    ToRawData(RawKind),
73}
74
75pub(crate) enum FormatEntry<Handle> {
76    Element(Handle, Tag),
77    Marker,
78}
79
80pub(crate) enum InsertionPoint<Handle> {
81    LastChild(Handle),
83    #[allow(dead_code)] BeforeSibling(Handle),
86    TableFosterParenting {
88        element: Handle,
89        prev_element: Handle,
90    },
91}