Trait style::dom::TNode
[−]
[src]
pub trait TNode: Sized + Copy + Clone + Debug + NodeInfo + PartialEq { type ConcreteElement: TElement<ConcreteNode = Self>; type ConcreteDocument: TDocument<ConcreteNode = Self>; fn parent_node(&self) -> Option<Self>; fn first_child(&self) -> Option<Self>; fn last_child(&self) -> Option<Self>; fn prev_sibling(&self) -> Option<Self>; fn next_sibling(&self) -> Option<Self>; fn owner_doc(&self) -> Self::ConcreteDocument; fn is_in_document(&self) -> bool; fn traversal_parent(&self) -> Option<Self::ConcreteElement>; fn opaque(&self) -> OpaqueNode; fn debug_id(self) -> usize; fn as_element(&self) -> Option<Self::ConcreteElement>; fn as_document(&self) -> Option<Self::ConcreteDocument>; fn can_be_fragmented(&self) -> bool; unsafe fn set_can_be_fragmented(&self, value: bool); fn dom_children(&self) -> DomChildren<Self> { ... } fn dom_descendants(&self) -> DomDescendants<Self> { ... } fn next_in_preorder(&self, scoped_to: Option<Self>) -> Option<Self> { ... } fn parent_element(&self) -> Option<Self::ConcreteElement> { ... } }
The TNode
trait. This is the main generic trait over which the style
system can be implemented.
Associated Types
type ConcreteElement: TElement<ConcreteNode = Self>
The concrete TElement
type.
type ConcreteDocument: TDocument<ConcreteNode = Self>
The concrete TDocument
type.
Required Methods
fn parent_node(&self) -> Option<Self>
Get this node's parent node.
fn first_child(&self) -> Option<Self>
Get this node's first child.
fn last_child(&self) -> Option<Self>
Get this node's first child.
fn prev_sibling(&self) -> Option<Self>
Get this node's previous sibling.
fn next_sibling(&self) -> Option<Self>
Get this node's next sibling.
fn owner_doc(&self) -> Self::ConcreteDocument
Get the owner document of this node.
fn is_in_document(&self) -> bool
Returns whether the node is attached to a document.
fn traversal_parent(&self) -> Option<Self::ConcreteElement>
Get this node's parent element from the perspective of a restyle traversal.
fn opaque(&self) -> OpaqueNode
Converts self into an OpaqueNode
.
fn debug_id(self) -> usize
A debug id, only useful, mm... for debugging.
fn as_element(&self) -> Option<Self::ConcreteElement>
Get this node as an element, if it's one.
fn as_document(&self) -> Option<Self::ConcreteDocument>
Get this node as a document, if it's one.
fn can_be_fragmented(&self) -> bool
Whether this node can be fragmented. This is used for multicol, and only for Servo.
unsafe fn set_can_be_fragmented(&self, value: bool)
Set whether this node can be fragmented.
Provided Methods
fn dom_children(&self) -> DomChildren<Self>
Iterate over the DOM children of a node.
fn dom_descendants(&self) -> DomDescendants<Self>
Iterate over the DOM children of a node, in preorder.
fn next_in_preorder(&self, scoped_to: Option<Self>) -> Option<Self>
Returns the next children in pre-order, optionally scoped to a subtree root.
fn parent_element(&self) -> Option<Self::ConcreteElement>
Get this node's parent element if present.