Struct script::dom::servoparser::Sink
source · pub struct Sink {
base_url: ServoUrl,
document: Dom<Document>,
current_line: Cell<u64>,
script: MutNullableDom<HTMLScriptElement>,
parsing_algorithm: ParsingAlgorithm,
}
Fields§
§base_url: ServoUrl
§document: Dom<Document>
§current_line: Cell<u64>
§script: MutNullableDom<HTMLScriptElement>
§parsing_algorithm: ParsingAlgorithm
Implementations§
Trait Implementations§
source§impl MallocSizeOf for Sink
impl MallocSizeOf for Sink
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
source§impl TreeSink for Sink
impl TreeSink for Sink
source§fn is_mathml_annotation_xml_integration_point(&self, handle: &Dom<Node>) -> bool
fn is_mathml_annotation_xml_integration_point(&self, handle: &Dom<Node>) -> bool
https://html.spec.whatwg.org/multipage/#html-integration-point
Specifically, the <annotation-xml>
cases.
source§type Handle = Dom<Node>
type Handle = Dom<Node>
Handle
is a reference to a DOM node. The tree builder requires
that a Handle
implements Clone
to get another reference to
the same node.type ElemName<'a> = ExpandedName<'a> where Self: 'a
source§fn get_document(&self) -> Dom<Node>
fn get_document(&self) -> Dom<Node>
Get a handle to the
Document
node.source§fn get_template_contents(&self, target: &Dom<Node>) -> Dom<Node>
fn get_template_contents(&self, target: &Dom<Node>) -> Dom<Node>
Get a handle to a template’s template contents. The tree builder
promises this will never be called with something else than
a template element.
source§fn same_node(&self, x: &Dom<Node>, y: &Dom<Node>) -> bool
fn same_node(&self, x: &Dom<Node>, y: &Dom<Node>) -> bool
Do two handles refer to the same node?
source§fn elem_name<'a>(&self, target: &'a Dom<Node>) -> ExpandedName<'a>
fn elem_name<'a>(&self, target: &'a Dom<Node>) -> ExpandedName<'a>
What is the name of this element? Read more
source§fn create_element(
&self,
name: QualName,
attrs: Vec<Attribute>,
_flags: ElementFlags,
) -> Dom<Node>
fn create_element( &self, name: QualName, attrs: Vec<Attribute>, _flags: ElementFlags, ) -> Dom<Node>
Create an element. Read more
source§fn create_comment(&self, text: StrTendril) -> Dom<Node>
fn create_comment(&self, text: StrTendril) -> Dom<Node>
Create a comment node.
source§fn create_pi(&self, target: StrTendril, data: StrTendril) -> Dom<Node>
fn create_pi(&self, target: StrTendril, data: StrTendril) -> Dom<Node>
Create a Processing Instruction node.
source§fn associate_with_form(
&self,
target: &Dom<Node>,
form: &Dom<Node>,
nodes: (&Dom<Node>, Option<&Dom<Node>>),
)
fn associate_with_form( &self, target: &Dom<Node>, form: &Dom<Node>, nodes: (&Dom<Node>, Option<&Dom<Node>>), )
Associate the given form-associatable element with the form element
source§fn append_before_sibling(
&self,
sibling: &Dom<Node>,
new_node: NodeOrText<Dom<Node>>,
)
fn append_before_sibling( &self, sibling: &Dom<Node>, new_node: NodeOrText<Dom<Node>>, )
Append a node as the sibling immediately before the given node. Read more
source§fn parse_error(&self, msg: Cow<'static, str>)
fn parse_error(&self, msg: Cow<'static, str>)
Signal a parse error.
source§fn set_quirks_mode(&self, mode: QuirksMode)
fn set_quirks_mode(&self, mode: QuirksMode)
Set the document’s quirks mode.
source§fn append(&self, parent: &Dom<Node>, child: NodeOrText<Dom<Node>>)
fn append(&self, parent: &Dom<Node>, child: NodeOrText<Dom<Node>>)
Append a node as the last child of the given node. If this would
produce adjacent sibling text nodes, it should concatenate the text
instead. Read more
source§fn append_based_on_parent_node(
&self,
elem: &Dom<Node>,
prev_elem: &Dom<Node>,
child: NodeOrText<Dom<Node>>,
)
fn append_based_on_parent_node( &self, elem: &Dom<Node>, prev_elem: &Dom<Node>, child: NodeOrText<Dom<Node>>, )
When the insertion point is decided by the existence of a parent node of the
element, we consider both possibilities and send the element which will be used
if a parent node exists, along with the element to be used if there isn’t one.
source§fn append_doctype_to_document(
&self,
name: StrTendril,
public_id: StrTendril,
system_id: StrTendril,
)
fn append_doctype_to_document( &self, name: StrTendril, public_id: StrTendril, system_id: StrTendril, )
Append a
DOCTYPE
element to the Document
node.source§fn add_attrs_if_missing(&self, target: &Dom<Node>, attrs: Vec<Attribute>)
fn add_attrs_if_missing(&self, target: &Dom<Node>, attrs: Vec<Attribute>)
Add each attribute to the given element, if no attribute with that name
already exists. The tree builder promises this will never be called
with something else than an element.
source§fn remove_from_parent(&self, target: &Dom<Node>)
fn remove_from_parent(&self, target: &Dom<Node>)
Detach the given node from its parent.
source§fn mark_script_already_started(&self, node: &Dom<Node>)
fn mark_script_already_started(&self, node: &Dom<Node>)
Mark a HTML
<script>
as “already started”.source§fn complete_script(&self, node: &Dom<Node>) -> NextParserState
fn complete_script(&self, node: &Dom<Node>) -> NextParserState
Indicate that a
script
element is complete.source§fn reparent_children(&self, node: &Dom<Node>, new_parent: &Dom<Node>)
fn reparent_children(&self, node: &Dom<Node>, new_parent: &Dom<Node>)
Remove all the children from node and append them to new_parent.
source§fn set_current_line(&self, line_number: u64)
fn set_current_line(&self, line_number: u64)
Called whenever the line number changes.
Auto Trait Implementations§
impl !Freeze for Sink
impl !RefUnwindSafe for Sink
impl !Send for Sink
impl !Sync for Sink
impl Unpin for Sink
impl !UnwindSafe for Sink
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Filterable for T
impl<T> Filterable for T
source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert