pub struct Node {Show 22 fields
pub id: usize,
pub parent: Option<usize>,
pub children: Vec<usize>,
pub layout_parent: Cell<Option<usize>>,
pub layout_children: RefCell<Option<Vec<usize>>>,
pub paint_children: RefCell<Option<Vec<usize>>>,
pub flags: NodeFlags,
pub data: NodeData,
pub stylo_element_data: AtomicRefCell<Option<ElementData>>,
pub selector_flags: AtomicRefCell<ElementSelectorFlags>,
pub guard: SharedRwLock,
pub element_state: ElementState,
pub before: Option<usize>,
pub after: Option<usize>,
pub style: Style<Atom>,
pub has_snapshot: bool,
pub snapshot_handled: AtomicBool,
pub display_constructed_as: Display,
pub cache: Cache,
pub unrounded_layout: Layout,
pub final_layout: Layout,
pub scroll_offset: Point<f64>,
/* private fields */
}Fields§
§id: usizeOur Id
parent: Option<usize>Our parent’s ID
children: Vec<usize>§layout_parent: Cell<Option<usize>>Our parent in the layout hierachy: a separate list that includes anonymous collections of inline elements
layout_children: RefCell<Option<Vec<usize>>>A separate child list that includes anonymous collections of inline elements
paint_children: RefCell<Option<Vec<usize>>>The same as layout_children, but sorted by z-index
flags: NodeFlags§data: NodeDataNode type (Element, TextNode, etc) specific data
stylo_element_data: AtomicRefCell<Option<ElementData>>§selector_flags: AtomicRefCell<ElementSelectorFlags>§guard: SharedRwLock§element_state: ElementState§before: Option<usize>§after: Option<usize>§style: Style<Atom>§has_snapshot: bool§snapshot_handled: AtomicBool§display_constructed_as: Display§cache: Cache§unrounded_layout: Layout§final_layout: Layout§scroll_offset: Point<f64>Implementations§
Source§impl Node
impl Node
pub fn pe_by_index(&self, index: usize) -> Option<usize>
pub fn set_pe_by_index(&mut self, index: usize, value: Option<usize>)
pub fn is_or_contains_block(&self) -> bool
pub fn is_focussable(&self) -> bool
pub fn set_restyle_hint(&self, hint: RestyleHint)
pub fn damage_mut(&self) -> Option<AtomicRefMut<'_, RestyleDamage>>
pub fn damage(&mut self) -> Option<RestyleDamage>
pub fn set_damage(&self, damage: RestyleDamage)
pub fn insert_damage(&mut self, damage: RestyleDamage)
pub fn remove_damage(&self, damage: RestyleDamage)
pub fn clear_damage_mut(&mut self)
pub fn hover(&mut self)
pub fn unhover(&mut self)
pub fn is_hovered(&self) -> bool
pub fn focus(&mut self)
pub fn blur(&mut self)
pub fn is_focussed(&self) -> bool
pub fn active(&mut self)
pub fn unactive(&mut self)
pub fn is_active(&self) -> bool
Source§impl Node
impl Node
pub fn tree(&self) -> &Slab<Node>
pub fn with(&self, id: usize) -> &Node
pub fn print_tree(&self, level: usize)
pub fn index_of_child(&self, child_id: usize) -> Option<usize>
pub fn child_index(&self) -> Option<usize>
pub fn forward(&self, n: usize) -> Option<&Node>
pub fn backward(&self, n: usize) -> Option<&Node>
pub fn is_element(&self) -> bool
pub fn is_anonymous(&self) -> bool
pub fn is_text_node(&self) -> bool
pub fn element_data(&self) -> Option<&ElementData>
pub fn element_data_mut(&mut self) -> Option<&mut ElementData>
pub fn text_data(&self) -> Option<&TextNodeData>
pub fn text_data_mut(&mut self) -> Option<&mut TextNodeData>
pub fn node_debug_str(&self) -> String
pub fn outer_html(&self) -> String
pub fn write_outer_html(&self, writer: &mut String)
pub fn attrs(&self) -> Option<&[Attribute]>
pub fn attr(&self, name: LocalName) -> Option<&str>
pub fn primary_styles(&self) -> Option<AtomicRef<'_, ComputedValues>>
pub fn text_content(&self) -> String
pub fn flush_style_attribute(&mut self, url_extra_data: &UrlExtraData)
pub fn order(&self) -> i32
pub fn z_index(&self) -> i32
Sourcepub fn hit(&self, x: f32, y: f32) -> Option<HitResult>
pub fn hit(&self, x: f32, y: f32) -> Option<HitResult>
Takes an (x, y) position (relative to the parent’s top-left corner) and returns:
- None if the position is outside of this node’s bounds
- Some(HitResult) if the position is within the node but doesn’t match any children
- The result of recursively calling child.hit() on the the child element that is positioned at that position if there is one.
TODO: z-index (If multiple children are positioned at the position then a random one will be recursed into)
Sourcepub fn absolute_position(&self, x: f32, y: f32) -> Point<f32>
pub fn absolute_position(&self, x: f32, y: f32) -> Point<f32>
Computes the Document-relative coordinates of the Node
Sourcepub fn synthetic_click_event(&self, mods: Modifiers) -> DomEventData
pub fn synthetic_click_event(&self, mods: Modifiers) -> DomEventData
Creates a synthetic click event
pub fn synthetic_click_event_data( &self, mods: Modifiers, ) -> BlitzMouseButtonEvent
Trait Implementations§
Source§impl Element for &'_ Node
impl Element for &'_ Node
type Impl = SelectorImpl
Source§fn opaque(&self) -> OpaqueElement
fn opaque(&self) -> OpaqueElement
Converts self into an opaque representation.
fn parent_element(&self) -> Option<Self>
Source§fn parent_node_is_shadow_root(&self) -> bool
fn parent_node_is_shadow_root(&self) -> bool
Whether the parent node of this element is a shadow root.
Source§fn containing_shadow_host(&self) -> Option<Self>
fn containing_shadow_host(&self) -> Option<Self>
The host of the containing shadow root, if any.
Source§fn is_pseudo_element(&self) -> bool
fn is_pseudo_element(&self) -> bool
Whether we’re matching on a pseudo-element.
Source§fn prev_sibling_element(&self) -> Option<Self>
fn prev_sibling_element(&self) -> Option<Self>
Skips non-element nodes
Source§fn next_sibling_element(&self) -> Option<Self>
fn next_sibling_element(&self) -> Option<Self>
Skips non-element nodes
Source§fn first_element_child(&self) -> Option<Self>
fn first_element_child(&self) -> Option<Self>
Skips non-element nodes
fn is_html_element_in_html_document(&self) -> bool
fn has_local_name(&self, local_name: &LocalName) -> bool
Source§fn has_namespace(&self, ns: &Namespace) -> bool
fn has_namespace(&self, ns: &Namespace) -> bool
Empty string for no namespace
Source§fn is_same_type(&self, other: &Self) -> bool
fn is_same_type(&self, other: &Self) -> bool
Whether this element and the
other element have the same local name and namespace.fn attr_matches( &self, _ns: &NamespaceConstraint<&GenericAtomIdent<NamespaceStaticSet>>, local_name: &GenericAtomIdent<LocalNameStaticSet>, operation: &AttrSelectorOperation<&AtomString>, ) -> bool
fn match_non_ts_pseudo_class( &self, pseudo_class: &<Self::Impl as SelectorImpl>::NonTSPseudoClass, _context: &mut MatchingContext<'_, Self::Impl>, ) -> bool
fn match_pseudo_element( &self, pe: &PseudoElement, _context: &mut MatchingContext<'_, Self::Impl>, ) -> bool
Source§fn apply_selector_flags(&self, flags: ElementSelectorFlags)
fn apply_selector_flags(&self, flags: ElementSelectorFlags)
Sets selector flags on the elemnt itself or the parent, depending on the
flags, which indicate what kind of work may need to be performed when
DOM state changes.
Source§fn is_html_slot_element(&self) -> bool
fn is_html_slot_element(&self) -> bool
Returns whether the element is an HTML element.
fn has_id( &self, id: &<Self::Impl as SelectorImpl>::Identifier, case_sensitivity: CaseSensitivity, ) -> bool
fn has_class( &self, search_name: &<Self::Impl as SelectorImpl>::Identifier, case_sensitivity: CaseSensitivity, ) -> bool
Source§fn imported_part(
&self,
_name: &<Self::Impl as SelectorImpl>::Identifier,
) -> Option<<Self::Impl as SelectorImpl>::Identifier>
fn imported_part( &self, _name: &<Self::Impl as SelectorImpl>::Identifier, ) -> Option<<Self::Impl as SelectorImpl>::Identifier>
Returns the mapping from the
exportparts attribute in the reverse
direction, that is, in an outer-tree -> inner-tree direction.fn is_part(&self, _name: &<Self::Impl as SelectorImpl>::Identifier) -> bool
Source§fn is_root(&self) -> bool
fn is_root(&self) -> bool
Returns whether this element matches
:root,
i.e. whether it is the root element of a document. Read morefn has_custom_state( &self, _name: &<Self::Impl as SelectorImpl>::Identifier, ) -> bool
Source§fn add_element_unique_hashes(&self, _filter: &mut BloomFilter) -> bool
fn add_element_unique_hashes(&self, _filter: &mut BloomFilter) -> bool
Add hashes unique to this element to the given filter, returning true
if any got added.
Source§fn pseudo_element_originating_element(&self) -> Option<Self>
fn pseudo_element_originating_element(&self) -> Option<Self>
The parent of a given pseudo-element, after matching a pseudo-element
selector. Read more
fn has_attr_in_no_namespace( &self, local_name: &<Self::Impl as SelectorImpl>::LocalName, ) -> bool
Source§fn assigned_slot(&self) -> Option<Self>
fn assigned_slot(&self) -> Option<Self>
Returns the assigned element this element is assigned to. Read more
Source§fn ignores_nth_child_selectors(&self) -> bool
fn ignores_nth_child_selectors(&self) -> bool
Returns whether this element should ignore matching nth child
selector.
Source§impl NodeInfo for &'_ Node
impl NodeInfo for &'_ Node
Source§fn is_element(&self) -> bool
fn is_element(&self) -> bool
Whether this node is an element.
Source§fn is_text_node(&self) -> bool
fn is_text_node(&self) -> bool
Whether this node is a text node.
Source§impl PartialEq for Node
It might be wrong to expose this since what does equality mean outside the dom?
impl PartialEq for Node
It might be wrong to expose this since what does equality mean outside the dom?
Source§impl<'a> TDocument for &'a Node
impl<'a> TDocument for &'a Node
Source§type ConcreteNode = &'a Node
type ConcreteNode = &'a Node
The concrete
TNode type.Source§fn as_node(&self) -> Self::ConcreteNode
fn as_node(&self) -> Self::ConcreteNode
Get this document as a
TNode.Source§fn is_html_document(&self) -> bool
fn is_html_document(&self) -> bool
Returns whether this document is an HTML document.
Source§fn quirks_mode(&self) -> QuirksMode
fn quirks_mode(&self) -> QuirksMode
Returns the quirks mode of this document.
This document’s shared lock.
Source§fn elements_with_id<'a>(
&self,
_id: &GenericAtomIdent<AtomStaticSet>,
) -> Result<&'a [<Self::ConcreteNode as TNode>::ConcreteElement], ()>where
Self: 'a,
fn elements_with_id<'a>(
&self,
_id: &GenericAtomIdent<AtomStaticSet>,
) -> Result<&'a [<Self::ConcreteNode as TNode>::ConcreteElement], ()>where
Self: 'a,
Get a list of elements with a given ID in this document, sorted by
tree position. Read more
Source§impl<'a> TElement for &'a Node
impl<'a> TElement for &'a Node
Source§type ConcreteNode = &'a Node
type ConcreteNode = &'a Node
The concrete node type.
Source§type TraversalChildrenIterator = Traverser<'a>
type TraversalChildrenIterator = Traverser<'a>
A concrete children iterator type in order to iterate over the
Nodes. Read moreSource§fn as_node(&self) -> Self::ConcreteNode
fn as_node(&self) -> Self::ConcreteNode
Get this element as a node.
Source§fn implicit_scope_for_sheet_in_shadow_root(
_opaque_host: OpaqueElement,
_sheet_index: usize,
) -> Option<ImplicitScopeRoot>
fn implicit_scope_for_sheet_in_shadow_root( _opaque_host: OpaqueElement, _sheet_index: usize, ) -> Option<ImplicitScopeRoot>
Returns the implicit scope root for given sheet index and host.
Source§fn traversal_children(&self) -> LayoutIterator<Self::TraversalChildrenIterator>
fn traversal_children(&self) -> LayoutIterator<Self::TraversalChildrenIterator>
Get this node’s children from the perspective of a restyle traversal.
Source§fn is_html_element(&self) -> bool
fn is_html_element(&self) -> bool
Return whether this element is an element in the HTML namespace.
Source§fn is_mathml_element(&self) -> bool
fn is_mathml_element(&self) -> bool
Return whether this element is an element in the MathML namespace.
Source§fn is_svg_element(&self) -> bool
fn is_svg_element(&self) -> bool
Return whether this element is an element in the SVG namespace.
Source§fn style_attribute(
&self,
) -> Option<ArcBorrow<'_, Locked<PropertyDeclarationBlock>>>
fn style_attribute( &self, ) -> Option<ArcBorrow<'_, Locked<PropertyDeclarationBlock>>>
Get this element’s style attribute.
Source§fn state(&self) -> ElementState
fn state(&self) -> ElementState
Get this element’s state, for non-tree-structural pseudos.
Source§fn has_part_attr(&self) -> bool
fn has_part_attr(&self) -> bool
Returns whether this element has a
part attribute.Source§fn exports_any_part(&self) -> bool
fn exports_any_part(&self) -> bool
Returns whether this element exports any part from its shadow tree.
Source§fn each_class<F>(&self, callback: F)
fn each_class<F>(&self, callback: F)
Internal iterator for the classes of this element.
Source§fn each_attr_name<F>(&self, callback: F)
fn each_attr_name<F>(&self, callback: F)
Internal iterator for the attribute names of this element.
Source§fn has_dirty_descendants(&self) -> bool
fn has_dirty_descendants(&self) -> bool
Returns true if this element may have a descendant needing style processing. Read more
Source§fn has_snapshot(&self) -> bool
fn has_snapshot(&self) -> bool
Returns whether state or attributes that may change style have changed
on the element, and thus whether the element has been snapshotted to do
restyle hint computation.
Source§fn handled_snapshot(&self) -> bool
fn handled_snapshot(&self) -> bool
Returns whether the current snapshot if present has been handled.
Source§unsafe fn set_handled_snapshot(&self)
unsafe fn set_handled_snapshot(&self)
Flags this element as having handled already its snapshot.
Source§unsafe fn set_dirty_descendants(&self)
unsafe fn set_dirty_descendants(&self)
Flag that this element has a descendant for style processing. Read more
Source§unsafe fn unset_dirty_descendants(&self)
unsafe fn unset_dirty_descendants(&self)
Flag that this element has no descendant for style processing. Read more
Source§fn store_children_to_process(&self, _n: isize)
fn store_children_to_process(&self, _n: isize)
Atomically stores the number of children of this node that we will
need to process during bottom-up traversal.
Source§fn did_process_child(&self) -> isize
fn did_process_child(&self) -> isize
Atomically notes that a child has been processed during bottom-up
traversal. Returns the number of children left to process.
Source§unsafe fn ensure_data(&self) -> AtomicRefMut<'_, ElementData>
unsafe fn ensure_data(&self) -> AtomicRefMut<'_, ElementData>
Gets a reference to the ElementData container, or creates one. Read more
Source§unsafe fn clear_data(&self)
unsafe fn clear_data(&self)
Clears the element data reference, if any. Read more
Source§fn borrow_data(&self) -> Option<AtomicRef<'_, ElementData>>
fn borrow_data(&self) -> Option<AtomicRef<'_, ElementData>>
Immutably borrows the ElementData.
Source§fn mutate_data(&self) -> Option<AtomicRefMut<'_, ElementData>>
fn mutate_data(&self) -> Option<AtomicRefMut<'_, ElementData>>
Mutably borrows the ElementData.
Source§fn skip_item_display_fixup(&self) -> bool
fn skip_item_display_fixup(&self) -> bool
Whether we should skip any root- or item-based display property
blockification on this element. (This function exists so that Gecko
native anonymous content can opt out of this style fixup.)
Source§fn may_have_animations(&self) -> bool
fn may_have_animations(&self) -> bool
In Gecko, element has a flag that represents the element may have
any type of animations or not to bail out animation stuff early.
Whereas Servo doesn’t have such flag.
Source§fn has_animations(&self, context: &SharedStyleContext<'_>) -> bool
fn has_animations(&self, context: &SharedStyleContext<'_>) -> bool
Returns true if the element has relevant animations. Relevant
animations are those animations that are affecting the element’s style
or are scheduled to do so in the future.
Source§fn has_css_animations(
&self,
context: &SharedStyleContext<'_>,
pseudo_element: Option<PseudoElement>,
) -> bool
fn has_css_animations( &self, context: &SharedStyleContext<'_>, pseudo_element: Option<PseudoElement>, ) -> bool
Returns true if the element has a CSS animation. The
context and pseudo_element
arguments are only used by Servo, since it stores animations globally and pseudo-elements
are not in the DOM.Source§fn has_css_transitions(
&self,
context: &SharedStyleContext<'_>,
pseudo_element: Option<PseudoElement>,
) -> bool
fn has_css_transitions( &self, context: &SharedStyleContext<'_>, pseudo_element: Option<PseudoElement>, ) -> bool
Returns true if the element has a CSS transition (including running transitions and
completed transitions). The
context and pseudo_element arguments are only used
by Servo, since it stores animations globally and pseudo-elements are not in the DOM.Source§fn animation_rule(
&self,
context: &SharedStyleContext<'_>,
) -> Option<Arc<Locked<PropertyDeclarationBlock>>>
fn animation_rule( &self, context: &SharedStyleContext<'_>, ) -> Option<Arc<Locked<PropertyDeclarationBlock>>>
Get this element’s animation rule.
Source§fn transition_rule(
&self,
context: &SharedStyleContext<'_>,
) -> Option<Arc<Locked<PropertyDeclarationBlock>>>
fn transition_rule( &self, context: &SharedStyleContext<'_>, ) -> Option<Arc<Locked<PropertyDeclarationBlock>>>
Get this element’s transition rule.
Source§fn shadow_root(
&self,
) -> Option<<Self::ConcreteNode as TNode>::ConcreteShadowRoot>
fn shadow_root( &self, ) -> Option<<Self::ConcreteNode as TNode>::ConcreteShadowRoot>
The shadow root this element is a host of.
Source§fn containing_shadow(
&self,
) -> Option<<Self::ConcreteNode as TNode>::ConcreteShadowRoot>
fn containing_shadow( &self, ) -> Option<<Self::ConcreteNode as TNode>::ConcreteShadowRoot>
The shadow root which roots the subtree this element is contained in.
Source§fn lang_attr(&self) -> Option<AttrValue>
fn lang_attr(&self) -> Option<AttrValue>
Returns the value of the
xml:lang="" attribute (or, if appropriate,
the lang="" attribute) on this element.Source§fn match_element_lang(
&self,
_override_lang: Option<Option<AttrValue>>,
_value: &Lang,
) -> bool
fn match_element_lang( &self, _override_lang: Option<Option<AttrValue>>, _value: &Lang, ) -> bool
Returns whether this element’s language matches the language tag
value. If override_lang is not None, it specifies the value
of the xml:lang="" or lang="" attribute to use in place of
looking at the element and its ancestors. (This argument is used
to implement matching of :lang() against snapshots.)Source§fn is_html_document_body_element(&self) -> bool
fn is_html_document_body_element(&self) -> bool
Returns whether this element is the main body element of the HTML
document it is on.
Source§fn synthesize_presentational_hints_for_legacy_attributes<V>(
&self,
_visited_handling: VisitedHandlingMode,
hints: &mut V,
)where
V: Push<ApplicableDeclarationBlock>,
fn synthesize_presentational_hints_for_legacy_attributes<V>(
&self,
_visited_handling: VisitedHandlingMode,
hints: &mut V,
)where
V: Push<ApplicableDeclarationBlock>,
Generate the proper applicable declarations due to presentational hints,
and insert them into
hints.Source§fn local_name(&self) -> &LocalName
fn local_name(&self) -> &LocalName
Returns element’s local name.
Source§fn query_container_size(&self, _display: &Display) -> Size2D<Option<Au>>
fn query_container_size(&self, _display: &Display) -> Size2D<Option<Au>>
Returns the size of the element to be used in container size queries.
This will usually be the size of the content area of the primary box,
but can be None if there is no box or if some axis lacks size containment.
Source§fn each_custom_state<F>(&self, _callback: F)
fn each_custom_state<F>(&self, _callback: F)
Internal iterator for the classes of this element.
Source§fn has_selector_flags(&self, flags: ElementSelectorFlags) -> bool
fn has_selector_flags(&self, flags: ElementSelectorFlags) -> bool
Returns true if the element has all of specified selector flags.
Source§fn relative_selector_search_direction(&self) -> ElementSelectorFlags
fn relative_selector_search_direction(&self) -> ElementSelectorFlags
Returns the search direction for relative selector invalidation, if it is on the search path.
Source§fn compute_layout_damage(
old: &ComputedValues,
new: &ComputedValues,
) -> RestyleDamage
fn compute_layout_damage( old: &ComputedValues, new: &ComputedValues, ) -> RestyleDamage
Compute the damage incurred by the change from the
_old to _new.Source§fn owner_doc_matches_for_testing(&self, _: &Device) -> bool
fn owner_doc_matches_for_testing(&self, _: &Device) -> bool
A debug-only check that the device’s owner doc matches the actual doc
we’re the root of. Read more
Source§fn matches_user_and_content_rules(&self) -> bool
fn matches_user_and_content_rules(&self) -> bool
Whether this element should match user and content rules. Read more
Source§fn traversal_parent(&self) -> Option<Self>
fn traversal_parent(&self) -> Option<Self>
Get this node’s parent element from the perspective of a restyle
traversal.
Source§fn inheritance_parent(&self) -> Option<Self>
fn inheritance_parent(&self) -> Option<Self>
Returns the parent element we should inherit from. Read more
Source§fn each_anonymous_content_child<F>(&self, _f: F)where
F: FnMut(Self),
fn each_anonymous_content_child<F>(&self, _f: F)where
F: FnMut(Self),
Execute
f for each anonymous content child (apart from ::before and
::after) whose originating element is self.Source§fn is_xul_element(&self) -> bool
fn is_xul_element(&self) -> bool
Return whether this element is an element in the XUL namespace.
Source§fn slotted_nodes(&self) -> &[Self::ConcreteNode]
fn slotted_nodes(&self) -> &[Self::ConcreteNode]
Return the list of slotted nodes of this node.
Source§fn unset_dirty_style_attribute(&self)
fn unset_dirty_style_attribute(&self)
Unset the style attribute’s dirty bit.
Servo doesn’t need to manage ditry bit for style attribute.
Source§fn smil_override(
&self,
) -> Option<ArcBorrow<'_, Locked<PropertyDeclarationBlock>>>
fn smil_override( &self, ) -> Option<ArcBorrow<'_, Locked<PropertyDeclarationBlock>>>
Get this element’s SMIL override declarations.
Source§fn animation_declarations(
&self,
context: &SharedStyleContext<'_>,
) -> AnimationDeclarations
fn animation_declarations( &self, context: &SharedStyleContext<'_>, ) -> AnimationDeclarations
Get the combined animation and transition rules. Read more
Source§fn each_exported_part<F>(
&self,
_name: &GenericAtomIdent<AtomStaticSet>,
_callback: F,
)
fn each_exported_part<F>( &self, _name: &GenericAtomIdent<AtomStaticSet>, _callback: F, )
Internal iterator for the part names that this element exports for a
given part name.
Source§fn may_generate_pseudo(
&self,
pseudo: &PseudoElement,
_primary_style: &ComputedValues,
) -> bool
fn may_generate_pseudo( &self, pseudo: &PseudoElement, _primary_style: &ComputedValues, ) -> bool
Whether a given element may generate a pseudo-element. Read more
Source§fn has_current_styles(&self, data: &ElementData) -> bool
fn has_current_styles(&self, data: &ElementData) -> bool
Returns whether the element’s styles are up-to-date after traversal
(i.e. in post traversal).
Source§fn has_animation_only_dirty_descendants(&self) -> bool
fn has_animation_only_dirty_descendants(&self) -> bool
Similar to the dirty_descendants but for representing a descendant of
the element needs to be updated in animation-only traversal.
Source§unsafe fn set_animation_only_dirty_descendants(&self)
unsafe fn set_animation_only_dirty_descendants(&self)
Flag that this element has a descendant for animation-only restyle
processing. Read more
Source§unsafe fn unset_animation_only_dirty_descendants(&self)
unsafe fn unset_animation_only_dirty_descendants(&self)
Flag that this element has no descendant for animation-only restyle processing. Read more
Source§unsafe fn clear_descendant_bits(&self)
unsafe fn clear_descendant_bits(&self)
Clear all bits related describing the dirtiness of descendants. Read more
Source§fn is_visited_link(&self) -> bool
fn is_visited_link(&self) -> bool
Returns true if this element is a visited link. Read more
Source§fn implemented_pseudo_element(&self) -> Option<PseudoElement>
fn implemented_pseudo_element(&self) -> Option<PseudoElement>
Returns the pseudo-element implemented by this element, if any. Read more
Source§fn has_animation_restyle_hints(&self) -> bool
fn has_animation_restyle_hints(&self) -> bool
Returns true if the element has animation restyle hints.
Source§fn rule_hash_target(&self) -> Self
fn rule_hash_target(&self) -> Self
Return the element which we can use to look up rules in the selector
maps. Read more
Source§fn each_applicable_non_document_style_rule_data<'a, F>(&self, f: F) -> boolwhere
Self: 'a,
F: FnMut(&'a CascadeData, Self),
fn each_applicable_non_document_style_rule_data<'a, F>(&self, f: F) -> boolwhere
Self: 'a,
F: FnMut(&'a CascadeData, Self),
Executes the callback for each applicable style rule data which isn’t
the main document’s data (which stores UA / author rules). Read more
Source§fn synthesize_view_transition_dynamic_rules<V>(&self, _rules: &mut V)where
V: Push<ApplicableDeclarationBlock>,
fn synthesize_view_transition_dynamic_rules<V>(&self, _rules: &mut V)where
V: Push<ApplicableDeclarationBlock>,
Generate the proper applicable declarations due to view transition dynamic rules, and
insert them into
rules.
https://drafts.csswg.org/css-view-transitions-1/#document-dynamic-view-transition-style-sheetSource§impl<'a> TNode for &'a Node
impl<'a> TNode for &'a Node
Source§type ConcreteElement = &'a Node
type ConcreteElement = &'a Node
The concrete
TElement type.Source§type ConcreteDocument = &'a Node
type ConcreteDocument = &'a Node
The concrete
TDocument type.Source§type ConcreteShadowRoot = &'a Node
type ConcreteShadowRoot = &'a Node
The concrete
TShadowRoot type.Source§fn parent_node(&self) -> Option<Self>
fn parent_node(&self) -> Option<Self>
Get this node’s parent node.
Source§fn first_child(&self) -> Option<Self>
fn first_child(&self) -> Option<Self>
Get this node’s first child.
Source§fn last_child(&self) -> Option<Self>
fn last_child(&self) -> Option<Self>
Get this node’s last child.
Source§fn prev_sibling(&self) -> Option<Self>
fn prev_sibling(&self) -> Option<Self>
Get this node’s previous sibling.
Source§fn next_sibling(&self) -> Option<Self>
fn next_sibling(&self) -> Option<Self>
Get this node’s next sibling.
Source§fn owner_doc(&self) -> Self::ConcreteDocument
fn owner_doc(&self) -> Self::ConcreteDocument
Get the owner document of this node.
Source§fn is_in_document(&self) -> bool
fn is_in_document(&self) -> bool
Returns whether the node is attached to a document.
Source§fn traversal_parent(&self) -> Option<Self::ConcreteElement>
fn traversal_parent(&self) -> Option<Self::ConcreteElement>
Get this node’s parent element from the perspective of a restyle
traversal.
Source§fn opaque(&self) -> OpaqueNode
fn opaque(&self) -> OpaqueNode
Converts self into an
OpaqueNode.Source§fn as_element(&self) -> Option<Self::ConcreteElement>
fn as_element(&self) -> Option<Self::ConcreteElement>
Get this node as an element, if it’s one.
Source§fn as_document(&self) -> Option<Self::ConcreteDocument>
fn as_document(&self) -> Option<Self::ConcreteDocument>
Get this node as a document, if it’s one.
Source§fn as_shadow_root(&self) -> Option<Self::ConcreteShadowRoot>
fn as_shadow_root(&self) -> Option<Self::ConcreteShadowRoot>
Get this node as a ShadowRoot, if it’s one.
Source§fn dom_children(&self) -> DomChildren<Self>
fn dom_children(&self) -> DomChildren<Self>
Iterate over the DOM children of a node.
Source§fn dom_descendants(&self) -> DomDescendants<Self>
fn dom_descendants(&self) -> DomDescendants<Self>
Iterate over the DOM children of a node, in preorder.
Source§fn next_in_preorder(&self, scoped_to: Self) -> Option<Self>
fn next_in_preorder(&self, scoped_to: Self) -> Option<Self>
Returns the next node after this one, in a pre-order tree-traversal of
the subtree rooted at scoped_to.
Source§fn parent_element(&self) -> Option<Self::ConcreteElement>
fn parent_element(&self) -> Option<Self::ConcreteElement>
Get this node’s parent element if present.
Source§fn parent_element_or_host(&self) -> Option<Self::ConcreteElement>
fn parent_element_or_host(&self) -> Option<Self::ConcreteElement>
Get this node’s parent element, or shadow host if it’s a shadow root.
Source§impl<'a> TShadowRoot for &'a Node
impl<'a> TShadowRoot for &'a Node
Source§type ConcreteNode = &'a Node
type ConcreteNode = &'a Node
The concrete node type.
Source§fn as_node(&self) -> Self::ConcreteNode
fn as_node(&self) -> Self::ConcreteNode
Get this ShadowRoot as a node.
Source§fn host(&self) -> <Self::ConcreteNode as TNode>::ConcreteElement
fn host(&self) -> <Self::ConcreteNode as TNode>::ConcreteElement
Get the shadow host that hosts this ShadowRoot.
Source§fn style_data<'b>(&self) -> Option<&'b CascadeData>where
Self: 'b,
fn style_data<'b>(&self) -> Option<&'b CascadeData>where
Self: 'b,
Get the style data for this ShadowRoot.
Source§fn parts<'a>(&self) -> &[<Self::ConcreteNode as TNode>::ConcreteElement]where
Self: 'a,
fn parts<'a>(&self) -> &[<Self::ConcreteNode as TNode>::ConcreteElement]where
Self: 'a,
Get the list of shadow parts for this shadow root.
Source§fn elements_with_id<'a>(
&self,
_id: &GenericAtomIdent<AtomStaticSet>,
) -> Result<&'a [<Self::ConcreteNode as TNode>::ConcreteElement], ()>where
Self: 'a,
fn elements_with_id<'a>(
&self,
_id: &GenericAtomIdent<AtomStaticSet>,
) -> Result<&'a [<Self::ConcreteNode as TNode>::ConcreteElement], ()>where
Self: 'a,
Get a list of elements with a given ID in this shadow root, sorted by
tree position. Read more
Source§fn implicit_scope_for_sheet(
&self,
_sheet_index: usize,
) -> Option<ImplicitScopeRoot>
fn implicit_scope_for_sheet( &self, _sheet_index: usize, ) -> Option<ImplicitScopeRoot>
Get the implicit scope for a stylesheet in given index.
impl Eq for Node
impl Send for Node
impl Sync for Node
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert