Trait html5ever_ext::NodeExt
[−]
[src]
pub trait NodeExt: Sized + Minify { fn validate_children_and_remove_comments_and_processing_instructions(
&self,
context: &Path
) -> Result<(), HtmlError>; fn parent(&self) -> Option<Self>; fn first_child(&self) -> Option<Self>; fn is_inter_element_whitespace_comment_or_processing_instruction(
&self
) -> bool; fn attach_child(
&self,
rc_dom: &mut RcDom,
child: UnattachedNode
) -> Rc<Node>; fn attach_sibling_before(
&self,
rc_dom: &mut RcDom,
sibling_node: UnattachedNode
) -> Rc<Node>; fn remove(&self, rc_dom: &mut RcDom); fn move_node_children_to(&self, rc_dom: &mut RcDom, new_parent_node: &Self); fn move_node_to(&self, rc_dom: &mut RcDom, new_parent_node: &Self); fn move_node_before_sibling_of(
&self,
rc_dom: &mut RcDom,
sibling_node: &Self
); fn append_new_element_to(
&self,
rc_dom: &mut RcDom,
qualified_name: QualName,
attributes: Vec<Attribute>
) -> Rc<Node>; fn append_new_element_before_sibling_of(
&self,
rc_dom: &mut RcDom,
qualified_name: QualName,
attributes: Vec<Attribute>
) -> Rc<Node>; fn append_new_comment_to(&self, rc_dom: &mut RcDom, comment: &str); fn append_new_comment_before_sibling_of(
&self,
rc_dom: &mut RcDom,
comment: &str
); fn append_new_processing_instruction_to(
&self,
rc_dom: &mut RcDom,
target: &str,
data: &str
); fn append_new_processing_instruction_before_sibling_of(
&self,
rc_dom: &mut RcDom,
target: &str,
data: &str
); fn append_text(&self, rc_dom: &mut RcDom, text: &str); fn append_text_before_sibling_of(&self, rc_dom: &mut RcDom, text: &str); fn previous_sibling(
&self,
skip_inter_element_whitespace_comment_or_processing_instructions: bool
) -> Option<Self> { ... } fn next_sibling(
&self,
skip_inter_element_whitespace_comment_or_processing_instructions: bool
) -> Option<Self> { ... } }
This trait adds additional methods to a a HTML DOM node.
Required Methods
fn validate_children_and_remove_comments_and_processing_instructions(
&self,
context: &Path
) -> Result<(), HtmlError>
&self,
context: &Path
) -> Result<(), HtmlError>
Validated a HTML DOM node, removes any child comments and processing instructions.
fn parent(&self) -> Option<Self>
Returns the parent of this node. Returns None if there is no parent. Ordinarily, the 'root' node is of type 'Document'. The :root CSS pseudo-element matches the first html element node child of the root node of type 'Document', not 'Document' itself.
fn first_child(&self) -> Option<Self>
Returns the first child if extant, which may be an element, text node (or, if not preprocessed, a comment or processing instruction)
fn is_inter_element_whitespace_comment_or_processing_instruction(&self) -> bool
Used for determining siblings.
fn attach_child(&self, rc_dom: &mut RcDom, child: UnattachedNode) -> Rc<Node>
Used to attach an unattached child node to a parent
fn attach_sibling_before(
&self,
rc_dom: &mut RcDom,
sibling_node: UnattachedNode
) -> Rc<Node>
&self,
rc_dom: &mut RcDom,
sibling_node: UnattachedNode
) -> Rc<Node>
Used to attach an unattached sibling node to a sibling
fn remove(&self, rc_dom: &mut RcDom)
Removes this node from its parent.
fn move_node_children_to(&self, rc_dom: &mut RcDom, new_parent_node: &Self)
Moves a node's children to another parent node
fn move_node_to(&self, rc_dom: &mut RcDom, new_parent_node: &Self)
Moves an existing element node to a parent node
fn move_node_before_sibling_of(&self, rc_dom: &mut RcDom, sibling_node: &Self)
Moves an existing element before a sibling node
fn append_new_element_to(
&self,
rc_dom: &mut RcDom,
qualified_name: QualName,
attributes: Vec<Attribute>
) -> Rc<Node>
&self,
rc_dom: &mut RcDom,
qualified_name: QualName,
attributes: Vec<Attribute>
) -> Rc<Node>
Appends a new element node to a parent node
fn append_new_element_before_sibling_of(
&self,
rc_dom: &mut RcDom,
qualified_name: QualName,
attributes: Vec<Attribute>
) -> Rc<Node>
&self,
rc_dom: &mut RcDom,
qualified_name: QualName,
attributes: Vec<Attribute>
) -> Rc<Node>
Appends a new element before a sibling node
fn append_new_comment_to(&self, rc_dom: &mut RcDom, comment: &str)
Appends a new comment node to a parent node
fn append_new_comment_before_sibling_of(
&self,
rc_dom: &mut RcDom,
comment: &str
)
&self,
rc_dom: &mut RcDom,
comment: &str
)
Appends a new comment before a sibling node
fn append_new_processing_instruction_to(
&self,
rc_dom: &mut RcDom,
target: &str,
data: &str
)
&self,
rc_dom: &mut RcDom,
target: &str,
data: &str
)
Appends a new processing instruction node to a parent node
fn append_new_processing_instruction_before_sibling_of(
&self,
rc_dom: &mut RcDom,
target: &str,
data: &str
)
&self,
rc_dom: &mut RcDom,
target: &str,
data: &str
)
Appends a new processing instruction before a sibling node
fn append_text(&self, rc_dom: &mut RcDom, text: &str)
Appends a text node to a parent node
fn append_text_before_sibling_of(&self, rc_dom: &mut RcDom, text: &str)
Appends a text node before a sibling node
Provided Methods
fn previous_sibling(
&self,
skip_inter_element_whitespace_comment_or_processing_instructions: bool
) -> Option<Self>
&self,
skip_inter_element_whitespace_comment_or_processing_instructions: bool
) -> Option<Self>
Returns the previous sibling, or None if this is the first sibling
fn next_sibling(
&self,
skip_inter_element_whitespace_comment_or_processing_instructions: bool
) -> Option<Self>
&self,
skip_inter_element_whitespace_comment_or_processing_instructions: bool
) -> Option<Self>
Returns the next sibling, or None if this is the last sibling
Implementations on Foreign Types
impl NodeExt for Rc<Node>
[src]
fn validate_children_and_remove_comments_and_processing_instructions(
&self,
context: &Path
) -> Result<(), HtmlError>
[src]
&self,
context: &Path
) -> Result<(), HtmlError>
fn parent(&self) -> Option<Self>
[src]
fn first_child(&self) -> Option<Self>
[src]
fn is_inter_element_whitespace_comment_or_processing_instruction(&self) -> bool
[src]
fn attach_child(&self, rc_dom: &mut RcDom, child: UnattachedNode) -> Rc<Node>
[src]
fn attach_sibling_before(
&self,
rc_dom: &mut RcDom,
sibling_node: UnattachedNode
) -> Rc<Node>
[src]
&self,
rc_dom: &mut RcDom,
sibling_node: UnattachedNode
) -> Rc<Node>
fn remove(&self, rc_dom: &mut RcDom)
[src]
fn move_node_children_to(&self, rc_dom: &mut RcDom, new_parent_node: &Self)
[src]
fn move_node_to(&self, rc_dom: &mut RcDom, new_parent_node: &Self)
[src]
fn move_node_before_sibling_of(&self, rc_dom: &mut RcDom, sibling_node: &Self)
[src]
fn append_new_element_to(
&self,
rc_dom: &mut RcDom,
qualified_name: QualName,
attributes: Vec<Attribute>
) -> Rc<Node>
[src]
&self,
rc_dom: &mut RcDom,
qualified_name: QualName,
attributes: Vec<Attribute>
) -> Rc<Node>
fn append_new_element_before_sibling_of(
&self,
rc_dom: &mut RcDom,
qualified_name: QualName,
attributes: Vec<Attribute>
) -> Rc<Node>
[src]
&self,
rc_dom: &mut RcDom,
qualified_name: QualName,
attributes: Vec<Attribute>
) -> Rc<Node>
fn append_new_comment_to(&self, rc_dom: &mut RcDom, comment: &str)
[src]
fn append_new_comment_before_sibling_of(
&self,
rc_dom: &mut RcDom,
comment: &str
)
[src]
&self,
rc_dom: &mut RcDom,
comment: &str
)
fn append_new_processing_instruction_to(
&self,
rc_dom: &mut RcDom,
target: &str,
data: &str
)
[src]
&self,
rc_dom: &mut RcDom,
target: &str,
data: &str
)
fn append_new_processing_instruction_before_sibling_of(
&self,
rc_dom: &mut RcDom,
target: &str,
data: &str
)
[src]
&self,
rc_dom: &mut RcDom,
target: &str,
data: &str
)
fn append_text(&self, rc_dom: &mut RcDom, text: &str)
[src]
fn append_text_before_sibling_of(&self, rc_dom: &mut RcDom, text: &str)
[src]
fn previous_sibling(
&self,
skip_inter_element_whitespace_comment_or_processing_instructions: bool
) -> Option<Self>
[src]
&self,
skip_inter_element_whitespace_comment_or_processing_instructions: bool
) -> Option<Self>
fn next_sibling(
&self,
skip_inter_element_whitespace_comment_or_processing_instructions: bool
) -> Option<Self>
[src]
&self,
skip_inter_element_whitespace_comment_or_processing_instructions: bool
) -> Option<Self>