Struct html5ever::tree_builder::TreeBuilder [] [src]

pub struct TreeBuilder<Handle, Sink> {
    // some fields omitted
}

The HTML tree builder.

Methods

impl<Handle, Sink> TreeBuilder<Handle, Sink> where Handle: Clone, Sink: TreeSink<Handle=Handle>
[src]

fn new(sink: Sink, opts: TreeBuilderOpts) -> TreeBuilder<Handle, Sink>

Create a new tree builder which sends tree modifications to a particular TreeSink.

The tree builder is also a TokenSink.

fn new_for_fragment(sink: Sink, context_elem: Handle, form_elem: Option<Handle>, opts: TreeBuilderOpts) -> TreeBuilder<Handle, Sink>

Create a new tree builder which sends tree modifications to a particular TreeSink. This is for parsing fragments.

The tree builder is also a TokenSink.

fn tokenizer_state_for_context_elem(&self) -> State

fn unwrap(self) -> Sink

fn sink<'a>(&'a self) -> &'a Sink

fn sink_mut<'a>(&'a mut self) -> &'a mut Sink

fn trace_handles(&self, tracer: &Tracer<Handle=Handle>)

Call the Tracer's trace_handle method on every Handle in the tree builder's internal state. This is intended to support garbage-collected DOMs.

fn is_fragment(&self) -> bool

Are we parsing a HTML fragment?

Trait Implementations

impl<Handle, Sink> TokenSink for TreeBuilder<Handle, Sink> where Handle: Clone, Sink: TreeSink<Handle=Handle>
[src]

fn process_token(&mut self, token: Token)

Process a token.

fn adjusted_current_node_present_but_not_in_html_namespace(&self) -> bool

Used in the markup declaration open state. By default, this always returns false and thus all CDATA sections are tokenized as bogus comments. https://html.spec.whatwg.org/multipage/#markup-declaration-open-state Read more

fn query_state_change(&mut self) -> Option<State>

The tokenizer will call this after emitting any tag. This allows the tree builder to change the tokenizer's state. By default no state changes occur. Read more