pub struct RcDom {
pub document: Rc<Node>,
pub errors: RefCell<Vec<Cow<'static, str>>>,
pub quirks_mode: Cell<QuirksMode>,
}Expand description
The DOM itself; the result of parsing.
Fields§
§document: Rc<Node>The Document itself.
errors: RefCell<Vec<Cow<'static, str>>>Errors that occurred during parsing.
quirks_mode: Cell<QuirksMode>The document’s quirks mode.
Implementations§
Trait Implementations§
source§impl TreeSink for RcDom
impl TreeSink for RcDom
type ElemName<'a> = ExpandedName<'a>
source§type Handle = Rc<Node>
type Handle = Rc<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.source§fn parse_error(&self, msg: Cow<'static, str>)
fn parse_error(&self, msg: Cow<'static, str>)
Signal a parse error.
source§fn get_document(&self) -> Rc<Node>
fn get_document(&self) -> Rc<Node>
Get a handle to the
Document node.source§fn get_template_contents(&self, target: &Rc<Node>) -> Rc<Node>
fn get_template_contents(&self, target: &Rc<Node>) -> Rc<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 set_quirks_mode(&self, mode: QuirksMode)
fn set_quirks_mode(&self, mode: QuirksMode)
Set the document’s quirks mode.
source§fn same_node(&self, x: &Rc<Node>, y: &Rc<Node>) -> bool
fn same_node(&self, x: &Rc<Node>, y: &Rc<Node>) -> bool
Do two handles refer to the same node?
source§fn elem_name<'a>(&self, target: &'a Rc<Node>) -> ExpandedName<'a>
fn elem_name<'a>(&self, target: &'a Rc<Node>) -> ExpandedName<'a>
What is the name of this element? Read more
source§fn create_element(
&self,
name: QualName,
attrs: Vec<Attribute>,
flags: ElementFlags,
) -> Rc<Node>
fn create_element( &self, name: QualName, attrs: Vec<Attribute>, flags: ElementFlags, ) -> Rc<Node>
Create an element. Read more
source§fn create_comment(&self, text: StrTendril) -> Rc<Node>
fn create_comment(&self, text: StrTendril) -> Rc<Node>
Create a comment node.
source§fn create_pi(&self, target: StrTendril, data: StrTendril) -> Rc<Node>
fn create_pi(&self, target: StrTendril, data: StrTendril) -> Rc<Node>
Create a Processing Instruction node.
source§fn append(&self, parent: &Rc<Node>, child: NodeOrText<Rc<Node>>)
fn append(&self, parent: &Rc<Node>, child: NodeOrText<Rc<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_before_sibling(&self, sibling: &Rc<Node>, child: NodeOrText<Rc<Node>>)
fn append_before_sibling(&self, sibling: &Rc<Node>, child: NodeOrText<Rc<Node>>)
Append a node as the sibling immediately before the given node. Read more
source§fn append_based_on_parent_node(
&self,
element: &Self::Handle,
prev_element: &Self::Handle,
child: NodeOrText<Self::Handle>,
)
fn append_based_on_parent_node( &self, element: &Self::Handle, prev_element: &Self::Handle, child: NodeOrText<Self::Handle>, )
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: &Rc<Node>, attrs: Vec<Attribute>)
fn add_attrs_if_missing(&self, target: &Rc<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: &Rc<Node>)
fn remove_from_parent(&self, target: &Rc<Node>)
Detach the given node from its parent.
source§fn reparent_children(&self, node: &Rc<Node>, new_parent: &Rc<Node>)
fn reparent_children(&self, node: &Rc<Node>, new_parent: &Rc<Node>)
Remove all the children from node and append them to new_parent.
source§fn is_mathml_annotation_xml_integration_point(&self, target: &Rc<Node>) -> bool
fn is_mathml_annotation_xml_integration_point(&self, target: &Rc<Node>) -> bool
Returns true if the adjusted current node is an HTML integration point
and the token is a start tag.
source§fn mark_script_already_started(&self, _node: &Self::Handle)
fn mark_script_already_started(&self, _node: &Self::Handle)
Mark a HTML
<script> as “already started”.source§fn pop(&self, _node: &Self::Handle)
fn pop(&self, _node: &Self::Handle)
Indicate that a node was popped off the stack of open elements.
source§fn associate_with_form(
&self,
_target: &Self::Handle,
_form: &Self::Handle,
_nodes: (&Self::Handle, Option<&Self::Handle>),
)
fn associate_with_form( &self, _target: &Self::Handle, _form: &Self::Handle, _nodes: (&Self::Handle, Option<&Self::Handle>), )
Associate the given form-associatable element with the form element
source§fn set_current_line(&self, _line_number: u64)
fn set_current_line(&self, _line_number: u64)
Called whenever the line number changes.
source§fn complete_script(&self, _node: &Self::Handle) -> NextParserState
fn complete_script(&self, _node: &Self::Handle) -> NextParserState
Indicate that a
script element is complete.Auto Trait Implementations§
impl !Freeze for RcDom
impl !RefUnwindSafe for RcDom
impl !Send for RcDom
impl !Sync for RcDom
impl Unpin for RcDom
impl !UnwindSafe for RcDom
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