Struct script::dom::node::Node[][src]

pub struct Node {
Show fields eventtarget: EventTarget, parent_node: MutNullableDom<Node>, first_child: MutNullableDom<Node>, last_child: MutNullableDom<Node>, next_sibling: MutNullableDom<Node>, prev_sibling: MutNullableDom<Node>, owner_doc: MutNullableDom<Document>, rare_data: DomRefCell<Option<Box<NodeRareData>>>, child_list: MutNullableDom<NodeList>, children_count: Cell<u32>, flags: Cell<NodeFlags>, inclusive_descendants_version: Cell<u64>, ranges: WeakRangeVec, style_and_layout_data: DomRefCell<Option<Box<StyleAndOpaqueLayoutData>>>,
Expand description

An HTML node.


eventtarget: EventTarget

The JavaScript reflector for this node.

parent_node: MutNullableDom<Node>

The parent of this node.

first_child: MutNullableDom<Node>

The first child of this node.

last_child: MutNullableDom<Node>

The last child of this node.

next_sibling: MutNullableDom<Node>

The next sibling of this node.

prev_sibling: MutNullableDom<Node>

The previous sibling of this node.

owner_doc: MutNullableDom<Document>

The document that this node belongs to.

rare_data: DomRefCell<Option<Box<NodeRareData>>>

Rare node data.

child_list: MutNullableDom<NodeList>

The live list of children return by .childNodes.

children_count: Cell<u32>

The live count of children of this node.

flags: Cell<NodeFlags>

A bitfield of flags for node items.

inclusive_descendants_version: Cell<u64>

The maximum version of any inclusive descendant of this node.

ranges: WeakRangeVec

A vector of weak references to Range instances of which the start or end containers are this node. No range should ever be found twice in this vector, even if both the start and end containers are this node.

style_and_layout_data: DomRefCell<Option<Box<StyleAndOpaqueLayoutData>>>

Style+Layout information.


Adds a new child to the end of this node’s list of children.

Fails unless new_child is disconnected from the tree.

Clean up flags and unbind from tree.

Removes the given child from this node’s list of children.

Fails unless child is a child of this node.

Returns true if this node is before other in the same connected DOM tree.

Return all registered mutation observers for this node. Lazily initialize the raredata if it does not exist.

Add a new mutation observer for a given node.

Removes the mutation observer for a given node.

Dumps the subtree rooted at this node, for debugging.

Dumps the node tree, for debugging, with indentation.

Returns a string that describes this node.

Returns the type ID of this node.

Returns true if this node has a parent.

The maximum version number of this node’s descendants, including itself

Iterates over this node and all its descendants, in preorder.

Returns the rendered bounding content box if the element is rendered, and none otherwise. Get an iterator over all nodes which match a set of selectors Be careful not to do anything which may manipulate the DOM tree whilst iterating, otherwise the iterator may be invalidated.

Used by HTMLTableSectionElement::InsertRow and HTMLTableRowElement::InsertCell

Used by HTMLTableSectionElement::DeleteRow and HTMLTableRowElement::DeleteCell

Trait Implementations

Check whether a DOM object implements one of its deriving interfaces.

Cast a DOM object upwards to one of the interfaces it derives from.

Cast a DOM object downwards to one of the interfaces it might implement.

Returns the receiver’s reflector.

Returns the global scope of the realm that the DomObject was created in.

This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is

Returns whether the given DOM class derives that interface.

Trace self.

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more

Initializes the Reflector

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Take the serializer and call its methods to serialize this type. The type will dictate which methods are called and with what parameters. Read more

Convert self to a JSVal. JSAPI failure causes a panic.

Returns self as the superclass of the implementation for this trait, if any. Read more

Called on the parent when its children are changed.

Called when a Node is removed from a tree, where ‘tree_connected’ indicates whether the tree is part of a Document. Implements removing steps: Read more

Returns true if given attribute attr affects style of the given element. Read more

Returns the right AttrValue variant for the attribute with name name on this element. Read more

Called when a Node is appended to a tree, where ‘tree_connected’ indicates whether the tree is part of a Document. Read more

Called during event dispatch after the bubbling phase completes.

Called on an element when it is popped off the stack of open elements of a parser. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.



The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.