use crate::tokenizer::states::RawKind;
use crate::tokenizer::Tag;
use crate::tendril::StrTendril;
pub(crate) use self::FormatEntry::*;
pub(crate) use self::InsertionMode::*;
pub(crate) use self::InsertionPoint::*;
pub(crate) use self::ProcessResult::*;
pub(crate) use self::SplitStatus::*;
pub(crate) use self::Token::*;
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
pub(crate) enum InsertionMode {
Initial,
BeforeHtml,
BeforeHead,
InHead,
InHeadNoscript,
AfterHead,
InBody,
Text,
InTable,
InTableText,
InCaption,
InColumnGroup,
InTableBody,
InRow,
InCell,
InSelect,
InSelectInTable,
InTemplate,
AfterBody,
InFrameset,
AfterFrameset,
AfterAfterBody,
AfterAfterFrameset,
}
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
pub(crate) enum SplitStatus {
NotSplit,
Whitespace,
NotWhitespace,
}
#[derive(PartialEq, Eq, Clone, Debug)]
#[allow(clippy::enum_variant_names)]
pub(crate) enum Token {
TagToken(Tag),
CommentToken(StrTendril),
CharacterTokens(SplitStatus, StrTendril),
NullCharacterToken,
EOFToken,
}
pub(crate) enum ProcessResult<Handle> {
Done,
DoneAckSelfClosing,
SplitWhitespace(StrTendril),
Reprocess(InsertionMode, Token),
#[allow(dead_code)] ReprocessForeign(Token),
Script(Handle),
ToPlaintext,
ToRawData(RawKind),
}
pub(crate) enum FormatEntry<Handle> {
Element(Handle, Tag),
Marker,
}
pub(crate) enum InsertionPoint<Handle> {
LastChild(Handle),
#[allow(dead_code)] BeforeSibling(Handle),
TableFosterParenting {
element: Handle,
prev_element: Handle,
},
}