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

The concrete TElement type.

The concrete TDocument type.

Required Methods

Get this node's parent node.

Get this node's first child.

Get this node's first child.

Get this node's previous sibling.

Get this node's next sibling.

Get the owner document of this node.

Returns whether the node is attached to a document.

Get this node's parent element from the perspective of a restyle traversal.

Converts self into an OpaqueNode.

A debug id, only useful, mm... for debugging.

Get this node as an element, if it's one.

Get this node as a document, if it's one.

Whether this node can be fragmented. This is used for multicol, and only for Servo.

Set whether this node can be fragmented.

Provided Methods

Important traits for DomChildren<N>

Iterate over the DOM children of a node.

Important traits for DomDescendants<N>

Iterate over the DOM children of a node, in preorder.

Returns the next children in pre-order, optionally scoped to a subtree root.

Get this node's parent element if present.

Implementors