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

#[repr(C)]pub struct Node {
    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>>>,

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.


impl Node[src]

fn add_child(&self, new_child: &Node, before: Option<&Node>)[src]

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

Fails unless new_child is disconnected from the tree.

pub fn clean_up_layout_data(&self)[src]

pub fn complete_remove_subtree(root: &Node, context: &UnbindContext<'_>)[src]

Clean up flags and unbind from tree.

fn remove_child(&self, child: &Node, cached_index: Option<u32>)[src]

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

Fails unless child is a child of this node.

pub fn to_untrusted_node_address(&self) -> UntrustedNodeAddress[src]

pub fn to_opaque(&self) -> OpaqueNode[src]

pub fn as_custom_element(&self) -> Option<Root<Dom<Element>>>[src]

pub fn fire_synthetic_mouse_event_not_trusted(&self, name: DOMString)[src]

pub fn parent_directionality(&self) -> String[src]

impl Node[src]

fn rare_data(&self) -> Ref<'_, Option<Box<NodeRareData>>>[src]

fn rare_data_mut(&self) -> RefMut<'_, Option<Box<NodeRareData>>>[src]

fn ensure_rare_data(&self) -> RefMut<'_, Box<NodeRareData>>[src]

pub fn is_before(&self, other: &Node) -> bool[src]

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

pub fn registered_mutation_observers_mut(
) -> RefMut<'_, Vec<RegisteredObserver>>

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

pub fn registered_mutation_observers(
) -> Option<Ref<'_, Vec<RegisteredObserver>>>

pub fn add_mutation_observer(&self, observer: RegisteredObserver)[src]

Add a new mutation observer for a given node.

pub fn remove_mutation_observer(&self, observer: &MutationObserver)[src]

Removes the mutation observer for a given node.

pub fn dump(&self)[src]

Dumps the subtree rooted at this node, for debugging.

pub fn dump_indent(&self, indent: u32)[src]

Dumps the node tree, for debugging, with indentation.

pub fn debug_str(&self) -> String[src]

Returns a string that describes this node.

pub fn is_in_doc(&self) -> bool[src]

pub fn is_in_shadow_tree(&self) -> bool[src]

pub fn has_weird_parser_insertion_mode(&self) -> bool[src]

pub fn set_weird_parser_insertion_mode(&self)[src]

pub fn is_connected(&self) -> bool[src]

pub fn type_id(&self) -> NodeTypeId[src]

Returns the type ID of this node.

pub fn len(&self) -> u32[src]

pub fn index(&self) -> u32[src]

pub fn has_parent(&self) -> bool[src]

Returns true if this node has a parent.

pub fn children_count(&self) -> u32[src]

pub fn ranges(&self) -> &WeakRangeVec[src]

pub fn is_doctype(&self) -> bool[src]

pub fn get_flag(&self, flag: NodeFlags) -> bool[src]

pub fn set_flag(&self, flag: NodeFlags, value: bool)[src]

pub fn note_dirty_descendants(&self)[src]

pub fn has_dirty_descendants(&self) -> bool[src]

pub fn rev_version(&self)[src]

pub fn dirty(&self, damage: NodeDamage)[src]

pub fn inclusive_descendants_version(&self) -> u64[src]

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

pub fn traverse_preorder(
    shadow_including: ShadowIncluding
) -> TreeIterator

Notable traits for TreeIterator

impl Iterator for TreeIterator type Item = Root<Dom<Node>>;

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

pub fn inclusively_following_siblings(
) -> impl Iterator<Item = Root<Dom<Node>>>

pub fn inclusively_preceding_siblings(
) -> impl Iterator<Item = Root<Dom<Node>>>

pub fn common_ancestor(
    other: &Node,
    shadow_including: ShadowIncluding
) -> Option<Root<Dom<Node>>>

pub fn is_inclusive_ancestor_of(&self, parent: &Node) -> bool[src]

pub fn is_ancestor_of(&self, parent: &Node) -> bool[src]

fn is_shadow_including_inclusive_ancestor_of(&self, node: &Node) -> bool[src]

pub fn following_siblings(&self) -> impl Iterator<Item = Root<Dom<Node>>>[src]

pub fn preceding_siblings(&self) -> impl Iterator<Item = Root<Dom<Node>>>[src]

pub fn following_nodes(&self, root: &Node) -> FollowingNodeIterator[src]

pub fn preceding_nodes(&self, root: &Node) -> PrecedingNodeIterator[src]

pub fn descending_last_children(&self) -> impl Iterator<Item = Root<Dom<Node>>>[src]

pub fn is_parent_of(&self, child: &Node) -> bool[src]

pub fn to_trusted_node_address(&self) -> TrustedNodeAddress[src]

pub fn bounding_content_box(&self) -> Option<Rect<Au>>[src]

Returns the rendered bounding content box if the element is rendered, and none otherwise.

pub fn bounding_content_box_or_zero(&self) -> Rect<Au>[src]

pub fn content_boxes(&self) -> Vec<Rect<Au>>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator

pub fn client_rect(&self) -> Rect<i32>[src]

pub fn scroll_area(&self) -> Rect<i32>[src]

pub fn scroll_offset(&self) -> Vector2D<f32>[src]

pub fn before(&self, nodes: Vec<NodeOrString>) -> Result<(), Error>[src]

pub fn after(&self, nodes: Vec<NodeOrString>) -> Result<(), Error>[src]

pub fn replace_with(&self, nodes: Vec<NodeOrString>) -> Result<(), Error>[src]

pub fn prepend(&self, nodes: Vec<NodeOrString>) -> Result<(), Error>[src]

pub fn append(&self, nodes: Vec<NodeOrString>) -> Result<(), Error>[src]

pub fn replace_children(&self, nodes: Vec<NodeOrString>) -> Result<(), Error>[src]

pub fn query_selector(
    selectors: DOMString
) -> Result<Option<Root<Dom<Element>>>, Error>

pub fn query_selector_iter(
    selectors: DOMString
) -> Result<QuerySelectorIterator, Error>
[src] 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.

pub fn query_selector_all(
    selectors: DOMString
) -> Result<Root<Dom<NodeList>>, Error>

pub fn ancestors(&self) -> impl Iterator<Item = Root<Dom<Node>>>[src]

pub fn inclusive_ancestors(
    shadow_including: ShadowIncluding
) -> impl Iterator<Item = Root<Dom<Node>>>

pub fn owner_doc(&self) -> Root<Dom<Document>>[src]

pub fn set_owner_doc(&self, document: &Document)[src]

pub fn containing_shadow_root(&self) -> Option<Root<Dom<ShadowRoot>>>[src]

pub fn set_containing_shadow_root(&self, shadow_root: Option<&ShadowRoot>)[src]

pub fn is_in_html_doc(&self) -> bool[src]

pub fn is_connected_with_browsing_context(&self) -> bool[src]

pub fn children(&self) -> impl Iterator<Item = Root<Dom<Node>>>[src]

pub fn rev_children(&self) -> impl Iterator<Item = Root<Dom<Node>>>[src]

pub fn child_elements(&self) -> impl Iterator<Item = Root<Dom<Element>>>[src]

pub fn remove_self(&self)[src]

pub fn unique_id(&self) -> String[src]

pub fn summarize(&self) -> NodeInfo[src]

pub fn insert_cell_or_row<F, G, I>(
    index: i32,
    get_items: F,
    new_child: G
) -> Result<Root<Dom<HTMLElement>>, Error> where
    F: Fn() -> Root<Dom<HTMLCollection>>,
    G: Fn() -> Root<Dom<I>>,
    I: DerivedFrom<Node> + DerivedFrom<HTMLElement> + DomObject

Used by HTMLTableSectionElement::InsertRow and HTMLTableRowElement::InsertCell

pub fn delete_cell_or_row<F, G>(
    index: i32,
    get_items: F,
    is_delete_type: G
) -> Result<(), Error> where
    F: Fn() -> Root<Dom<HTMLCollection>>,
    G: Fn(&Element) -> bool

Used by HTMLTableSectionElement::DeleteRow and HTMLTableRowElement::DeleteCell

pub fn get_stylesheet(&self) -> Option<Arc<Stylesheet>>[src]

pub fn get_cssom_stylesheet(&self) -> Option<Root<Dom<CSSStyleSheet>>>[src]

pub fn retarget(&self, b: &Node) -> Root<Dom<Node>>[src]

pub fn is_document_named_item(&self, name: &Atom) -> bool[src]

pub fn is_styled(&self) -> bool[src]

pub fn is_display_none(&self) -> bool[src]

pub fn style(&self) -> Option<Arc<ComputedValues>>[src]

impl Node[src]

pub fn reflect_node<N>(node: Box<N>, document: &Document) -> Root<Dom<N>> where
    N: DerivedFrom<Node> + DomObject + DomObjectWrap

pub fn new_inherited(doc: &Document) -> Node[src]

pub fn new_document_node() -> Node[src]

fn new_(flags: NodeFlags, doc: Option<&Document>) -> Node[src]

pub fn adopt(node: &Node, document: &Document)[src]

pub fn ensure_pre_insertion_validity(
    node: &Node,
    parent: &Node,
    child: Option<&Node>
) -> Result<(), Error>

pub fn pre_insert(
    node: &Node,
    parent: &Node,
    child: Option<&Node>
) -> Result<Root<Dom<Node>>, Error>

fn insert(
    node: &Node,
    parent: &Node,
    child: Option<&Node>,
    suppress_observers: SuppressObserver

pub fn replace_all(node: Option<&Node>, parent: &Node)[src]

pub fn string_replace_all(string: DOMString, parent: &Node)[src]

fn pre_remove(child: &Node, parent: &Node) -> Result<Root<Dom<Node>>, Error>[src]

fn remove(node: &Node, parent: &Node, suppress_observers: SuppressObserver)[src]

pub fn clone(
    node: &Node,
    maybe_doc: Option<&Document>,
    clone_children: CloneChildrenFlag
) -> Root<Dom<Node>>

pub fn child_text_content(&self) -> DOMString[src]

pub fn descendant_text_content(&self) -> DOMString[src]

pub fn collect_text_contents<T: Iterator<Item = Root<Dom<Node>>>>(
    iterator: T
) -> DOMString

pub fn namespace_to_string(namespace: Namespace) -> Option<DOMString>[src]

pub fn locate_namespace(node: &Node, prefix: Option<DOMString>) -> Namespace[src]

Trait Implementations

impl Castable for Node[src]

impl DerivedFrom<EventTarget> for Node[src]

impl DerivedFrom<Node> for Attr[src]

impl DerivedFrom<Node> for CDATASection[src]

impl DerivedFrom<Node> for HTMLAudioElement[src]

impl DerivedFrom<Node> for HTMLBRElement[src]

impl DerivedFrom<Node> for HTMLBaseElement[src]

impl DerivedFrom<Node> for HTMLBodyElement[src]

impl DerivedFrom<Node> for HTMLButtonElement[src]

impl DerivedFrom<Node> for HTMLCanvasElement[src]

impl DerivedFrom<Node> for HTMLDListElement[src]

impl DerivedFrom<Node> for HTMLDataElement[src]

impl DerivedFrom<Node> for HTMLDataListElement[src]

impl DerivedFrom<Node> for HTMLDetailsElement[src]

impl DerivedFrom<Node> for CharacterData[src]

impl DerivedFrom<Node> for HTMLDialogElement[src]

impl DerivedFrom<Node> for HTMLDirectoryElement[src]

impl DerivedFrom<Node> for HTMLDivElement[src]

impl DerivedFrom<Node> for HTMLElement[src]

impl DerivedFrom<Node> for HTMLEmbedElement[src]

impl DerivedFrom<Node> for HTMLFieldSetElement[src]

impl DerivedFrom<Node> for HTMLFontElement[src]

impl DerivedFrom<Node> for HTMLFormElement[src]

impl DerivedFrom<Node> for HTMLFrameElement[src]

impl DerivedFrom<Node> for HTMLFrameSetElement[src]

impl DerivedFrom<Node> for Comment[src]

impl DerivedFrom<Node> for HTMLHRElement[src]

impl DerivedFrom<Node> for HTMLHeadElement[src]

impl DerivedFrom<Node> for HTMLHeadingElement[src]

impl DerivedFrom<Node> for HTMLHtmlElement[src]

impl DerivedFrom<Node> for HTMLIFrameElement[src]

impl DerivedFrom<Node> for HTMLImageElement[src]

impl DerivedFrom<Node> for HTMLInputElement[src]

impl DerivedFrom<Node> for HTMLLIElement[src]

impl DerivedFrom<Node> for HTMLLabelElement[src]

impl DerivedFrom<Node> for HTMLLegendElement[src]

impl DerivedFrom<Node> for Document[src]

impl DerivedFrom<Node> for HTMLLinkElement[src]

impl DerivedFrom<Node> for HTMLMapElement[src]

impl DerivedFrom<Node> for HTMLMediaElement[src]

impl DerivedFrom<Node> for HTMLMenuElement[src]

impl DerivedFrom<Node> for HTMLMetaElement[src]

impl DerivedFrom<Node> for HTMLMeterElement[src]

impl DerivedFrom<Node> for HTMLModElement[src]

impl DerivedFrom<Node> for HTMLOListElement[src]

impl DerivedFrom<Node> for HTMLObjectElement[src]

impl DerivedFrom<Node> for HTMLOptGroupElement[src]

impl DerivedFrom<Node> for DocumentFragment[src]

impl DerivedFrom<Node> for HTMLOptionElement[src]

impl DerivedFrom<Node> for HTMLOutputElement[src]

impl DerivedFrom<Node> for HTMLParagraphElement[src]

impl DerivedFrom<Node> for HTMLParamElement[src]

impl DerivedFrom<Node> for HTMLPictureElement[src]

impl DerivedFrom<Node> for HTMLPreElement[src]

impl DerivedFrom<Node> for HTMLProgressElement[src]

impl DerivedFrom<Node> for HTMLQuoteElement[src]

impl DerivedFrom<Node> for HTMLScriptElement[src]

impl DerivedFrom<Node> for HTMLSelectElement[src]

impl DerivedFrom<Node> for DocumentType[src]

impl DerivedFrom<Node> for HTMLSourceElement[src]

impl DerivedFrom<Node> for HTMLSpanElement[src]

impl DerivedFrom<Node> for HTMLStyleElement[src]

impl DerivedFrom<Node> for HTMLTableCaptionElement[src]

impl DerivedFrom<Node> for HTMLTableCellElement[src]

impl DerivedFrom<Node> for HTMLTableColElement[src]

impl DerivedFrom<Node> for HTMLTableElement[src]

impl DerivedFrom<Node> for HTMLTableRowElement[src]

impl DerivedFrom<Node> for HTMLTableSectionElement[src]

impl DerivedFrom<Node> for HTMLTemplateElement[src]

impl DerivedFrom<Node> for Element[src]

impl DerivedFrom<Node> for HTMLTextAreaElement[src]

impl DerivedFrom<Node> for HTMLTimeElement[src]

impl DerivedFrom<Node> for HTMLTitleElement[src]

impl DerivedFrom<Node> for HTMLTrackElement[src]

impl DerivedFrom<Node> for HTMLUListElement[src]

impl DerivedFrom<Node> for HTMLUnknownElement[src]

impl DerivedFrom<Node> for HTMLVideoElement[src]

impl DerivedFrom<Node> for Node[src]

impl DerivedFrom<Node> for ProcessingInstruction[src]

impl DerivedFrom<Node> for SVGElement[src]

impl DerivedFrom<Node> for HTMLAnchorElement[src]

impl DerivedFrom<Node> for SVGGraphicsElement[src]

impl DerivedFrom<Node> for SVGSVGElement[src]

impl DerivedFrom<Node> for ShadowRoot[src]

impl DerivedFrom<Node> for Text[src]

impl DerivedFrom<Node> for XMLDocument[src]

impl DerivedFrom<Node> for HTMLAreaElement[src]

impl DomObject for Node[src]

impl HasParent for Node[src]

type Parent = EventTarget

fn as_parent(&self) -> &EventTarget[src]

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

impl IDLInterface for Node[src]

impl JSTraceable for Node[src]

impl MallocSizeOf for Node[src]

impl MutDomObject for Node[src]

impl NodeMethods for Node[src]

impl PartialEq<Node> for Node[src]

impl<'a> Serialize for &'a Node[src]

impl ToJSValConvertible for Node[src]

impl VirtualMethods for Node[src]

Auto Trait Implementations

impl !RefUnwindSafe for Node

impl !Send for Node

impl !Sync for Node

impl Unpin for Node

impl !UnwindSafe for Node

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> Erased for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> MaybeBoxed<Box<T, Global>> for T[src]

impl<T> MaybeBoxed<T> for T[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,