Struct script::dom::servoparser::ServoParser[][src]

pub struct ServoParser {
Show 14 fields reflector: Reflector, document: Dom<Document>, bom_sniff: DomRefCell<Option<Vec<u8>>>, network_decoder: DomRefCell<Option<NetworkDecoder>>, network_input: DomRefCell<BufferQueue>, script_input: DomRefCell<BufferQueue>, tokenizer: DomRefCell<Tokenizer>, last_chunk_received: Cell<bool>, suspended: Cell<bool>, script_nesting_level: Cell<usize>, aborted: Cell<bool>, script_created_parser: bool, prefetch_tokenizer: DomRefCell<Tokenizer>, prefetch_input: DomRefCell<BufferQueue>,
Expand description

The parser maintains two input streams: one for input from script through document.write(), and one for input from network.

There is no concrete representation of the insertion point, instead it always points to just before the next character from the network input, with all of the script input before itself.

    ... script input ... | ... network input ...
                insertion point


reflector: Reflectordocument: Dom<Document>

The document associated with this parser.

bom_sniff: DomRefCell<Option<Vec<u8>>>

The BOM sniffing state.

None means we’ve found the BOM, we’ve found there isn’t one, or we’re not parsing from a byte stream. Some contains the BOM bytes found so far.

network_decoder: DomRefCell<Option<NetworkDecoder>>

The decoder used for the network input.

network_input: DomRefCell<BufferQueue>

Input received from network.

script_input: DomRefCell<BufferQueue>

Input received from script. Used only to support document.write().

tokenizer: DomRefCell<Tokenizer>

The tokenizer of this parser.

last_chunk_received: Cell<bool>

Whether to expect any further input from the associated network request.

suspended: Cell<bool>

Whether this parser should avoid passing any further data to the tokenizer.

script_nesting_level: Cell<usize>

aborted: Cell<bool>

script_created_parser: bool

prefetch_tokenizer: DomRefCell<Tokenizer>

We do a quick-and-dirty parse of the input looking for resources to prefetch.

prefetch_input: DomRefCell<BufferQueue>


Corresponds to the latter part of the “Otherwise” branch of the ‘An end tag whose tag name is “script”’ of

This first moves everything from the script input to the beginning of the network input, effectively resetting the insertion point to just before the next character to be consumed.

    | ... script input ... network input ...
    insertion point

Steps 6-8 of

Trait Implementations

Returns the receiver’s reflector.

Returns the global scope of the realm that the DomObject was created in.

Function pointer to the general wrap function type

This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is

Returns whether the given DOM class derives that interface.

Trace self.

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more

Initializes the Reflector

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Convert self to a JSVal. JSAPI failure causes a panic.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.



The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.