aboutsummaryrefslogtreecommitdiff
path: root/src/tokenizer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tokenizer.rs')
-rw-r--r--src/tokenizer.rs26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/tokenizer.rs b/src/tokenizer.rs
index b41c208..cd5ae71 100644
--- a/src/tokenizer.rs
+++ b/src/tokenizer.rs
@@ -49,14 +49,20 @@ impl<R: Reader + Position<O>, O: Offset, E: Emitter<O>> Tokenizer<R, O, E> {
/// To be called when the tokenizer iterator implementation yields [`Event::CdataOpen`].
///
- /// For spec-compliant parsing *action* must be [`CdataAction::Cdata`],
+ /// For spec-compliant parsing the supplied boolean must be `true`
/// if there is an _adjusted current node_ and it is not an element in
- /// the HTML namespace, or [`CdataAction::BogusComment`] otherwise
- /// (as per the third condition under [Markup declaration open state]).
+ /// the HTML namespace, or `false` otherwise (as per the third condition
+ /// under [Markup declaration open state]).
///
/// [Markup declaration open state]: https://html.spec.whatwg.org/multipage/parsing.html#markup-declaration-open-state
- pub fn handle_cdata_open(&mut self, action: CdataAction) {
- machine::handle_cdata_open(&mut self.machine, action);
+ pub fn handle_cdata_open(
+ &mut self,
+ adjusted_current_node_present_and_not_in_html_namespace: bool,
+ ) {
+ machine::handle_cdata_open(
+ &mut self.machine,
+ adjusted_current_node_present_and_not_in_html_namespace,
+ );
}
/// Returns a mutable reference to the emitter.
@@ -65,16 +71,6 @@ impl<R: Reader + Position<O>, O: Offset, E: Emitter<O>> Tokenizer<R, O, E> {
}
}
-/// Used by [`Tokenizer::handle_cdata_open`] to determine how to process `<![CDATA[`
-///
-/// (Since as per the spec this depends on the _adjusted current node_).
-pub enum CdataAction {
- /// Process it as CDATA.
- Cdata,
- /// Process it as a bogus comment.
- BogusComment,
-}
-
/// An event yielded by the [`Iterator`] implementation for the [`Tokenizer`].
#[derive(Debug)]
pub enum Event<T> {