| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
use crate::tokenizer::states::RawKind; |
| 13 |
use crate::tokenizer::Tag; |
| 14 |
|
| 15 |
use crate::tendril::StrTendril; |
| 16 |
|
| 17 |
#[derive(PartialEq, Eq, Copy, Clone, Debug)] |
| 18 |
pub(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)] |
| 45 |
pub(crate) enum SplitStatus { |
| 46 |
NotSplit, |
| 47 |
Whitespace, |
| 48 |
NotWhitespace, |
| 49 |
} |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
#[derive(PartialEq, Eq, Clone, Debug)] |
| 54 |
#[allow(clippy::enum_variant_names)] |
| 55 |
pub(crate) enum Token { |
| 56 |
Tag(Tag), |
| 57 |
Comment(StrTendril), |
| 58 |
Characters(SplitStatus, StrTendril), |
| 59 |
NullCharacter, |
| 60 |
Eof, |
| 61 |
} |
| 62 |
|
| 63 |
pub(crate) enum ProcessResult<Handle> { |
| 64 |
Done, |
| 65 |
DoneAckSelfClosing, |
| 66 |
SplitWhitespace(StrTendril), |
| 67 |
Reprocess(InsertionMode, Token), |
| 68 |
#[allow(dead_code)] |
| 69 |
ReprocessForeign(Token), |
| 70 |
Script(Handle), |
| 71 |
ToPlaintext, |
| 72 |
ToRawData(RawKind), |
| 73 |
} |
| 74 |
|
| 75 |
pub(crate) enum FormatEntry<Handle> { |
| 76 |
Element(Handle, Tag), |
| 77 |
Marker, |
| 78 |
} |
| 79 |
|
| 80 |
pub(crate) enum InsertionPoint<Handle> { |
| 81 |
|
| 82 |
LastChild(Handle), |
| 83 |
#[allow(dead_code)] |
| 84 |
|
| 85 |
BeforeSibling(Handle), |
| 86 |
|
| 87 |
TableFosterParenting { |
| 88 |
element: Handle, |
| 89 |
prev_element: Handle, |
| 90 |
}, |
| 91 |
} |