pub struct Node {
pub id: NodeId,
pub parent: Option<NodeId>,
pub children: ThinVec<NodeId>,
pub layout_parent: Cell<Option<NodeId>>,
pub layout_children: RefCell<Option<ThinVec<NodeId>>>,
pub anonymous_blocks: ThinVec<NodeId>,
pub paint_children: RefCell<Option<ThinVec<NodeId>>>,
pub stacking_context: Option<Box<HoistedPaintChildren>>,
pub flags: NodeFlags,
pub data: NodeData,
/* private fields */
}Fields§
§id: NodeIdOur Id
parent: Option<NodeId>Our parent’s ID
children: ThinVec<NodeId>§layout_parent: Cell<Option<NodeId>>Our parent in the layout hierachy: a separate list that includes anonymous collections of inline elements
layout_children: RefCell<Option<ThinVec<NodeId>>>A separate child list that includes anonymous collections of inline elements
anonymous_blocks: ThinVec<NodeId>Anonymous block boxes created for this node during layout construction.
Anonymous blocks live only in the slab (they are not part of the DOM
children list), so we track the ones we own here to be able to
deallocate them when this node is reconstructed.
paint_children: RefCell<Option<ThinVec<NodeId>>>The same as layout_children, but sorted by z-index
stacking_context: Option<Box<HoistedPaintChildren>>§flags: NodeFlags§data: NodeDataNode type (Element, TextNode, etc) specific data.
For element nodes this holds the ElementData, which stores most of
the per-node style/layout state. For the document node it holds the
DocumentData. Access the moved fields through the forwarding methods
on Node (e.g. Node::style, Node::final_layout).
Implementations§
Source§impl Node
impl Node
pub fn stylo_element_data(&self) -> &StyloData
pub fn stylo_element_data_mut(&mut self) -> &mut StyloData
pub fn style(&self) -> &Style<Atom>
pub fn style_mut(&mut self) -> &mut Style<Atom>
pub fn style_source(&self) -> &Option<ServoArc<ComputedValues>>
pub fn style_source_mut(&mut self) -> &mut Option<ServoArc<ComputedValues>>
pub fn subtree_hoists(&self) -> &bool
pub fn subtree_hoists_mut(&mut self) -> &mut bool
pub fn unrounded_layout(&self) -> &Layout
pub fn unrounded_layout_mut(&mut self) -> &mut Layout
pub fn final_layout(&self) -> &Layout
pub fn final_layout_mut(&mut self) -> &mut Layout
pub fn scroll_offset(&self) -> &Point<f64>
pub fn scroll_offset_mut(&mut self) -> &mut Point<f64>
pub fn scrollable_overflow(&self) -> &KurboRect
pub fn scrollable_overflow_mut(&mut self) -> &mut KurboRect
pub fn transform(&self) -> &Option<Affine>
pub fn transform_mut(&mut self) -> &mut Option<Affine>
pub fn display_constructed_as(&self) -> &StyloDisplay
pub fn display_constructed_as_mut(&mut self) -> &mut StyloDisplay
pub fn element_state(&self) -> &ElementState
pub fn element_state_mut(&mut self) -> &mut ElementState
pub fn snapshot_handled(&self) -> &AtomicBool
pub fn snapshot_handled_mut(&mut self) -> &mut AtomicBool
pub fn selector_flags(&self) -> &Cell<ElementSelectorFlags>
pub fn selector_flags_mut(&mut self) -> &mut Cell<ElementSelectorFlags>
Source§impl Node
impl Node
Sourcepub fn cache(&self) -> &Cache
pub fn cache(&self) -> &Cache
This node’s taffy layout cache.
Hand-written rather than generated by universal_accessors! because
the cache is Option<Box<Cache>>: a node that has never been laid out
borrows a shared empty one instead of owning 1616 bytes. See the
cache field for the measurement behind
that. The signature is unchanged, so callers cannot tell.
Sourcepub fn cache_mut(&mut self) -> &mut Cache
pub fn cache_mut(&mut self) -> &mut Cache
This node’s taffy layout cache, allocating on first use.
Sourcepub fn cache_release(&mut self)
pub fn cache_release(&mut self)
Release this node’s layout cache, returning its memory.
Sourcepub fn style_source_opt(&self) -> Option<&ServoArc<ComputedValues>>
pub fn style_source_opt(&self) -> Option<&ServoArc<ComputedValues>>
Style data from stylo, if this node kind carries it (element or document
nodes). Returns None for text/comment nodes.
The computed values the cached taffy style was built from, for node
kinds that carry one. None for text and comment nodes, which are never
styled, so a caller can ask without knowing the kind.
pub fn stylo_element_data_opt(&self) -> Option<&StyloData>
pub fn stylo_element_data_opt_mut(&mut self) -> Option<&mut StyloData>
Sourcepub fn guard(&self) -> &SharedRwLock
pub fn guard(&self) -> &SharedRwLock
The document’s shared style lock. Only available on element and document nodes.
pub fn has_snapshot(&self) -> bool
pub fn set_has_snapshot(&mut self, value: bool)
pub fn before(&self) -> Option<NodeId>
pub fn after(&self) -> Option<NodeId>
Source§impl Node
impl Node
pub fn set_transform(&mut self, scale: f32) -> Option<Affine>
pub fn pe_by_index(&self, index: usize) -> Option<NodeId>
pub fn set_pe_by_index(&mut self, index: usize, value: Option<NodeId>)
Sourcepub fn diagnostic_computed_style(&self) -> Option<Vec<(&'static str, String)>>
pub fn diagnostic_computed_style(&self) -> Option<Vec<(&'static str, String)>>
A compact computed-style view for renderer diagnostics.
Sourcepub fn is_display_none(&self) -> bool
pub fn is_display_none(&self) -> bool
Whether computed style removes this node from layout.
pub fn is_or_contains_block(&self) -> bool
pub fn is_whitespace_node(&self) -> bool
pub fn is_focussable(&self) -> bool
pub fn set_restyle_hint(&mut self, hint: RestyleHint)
Sourcepub fn has_dirty_descendants(&self) -> bool
pub fn has_dirty_descendants(&self) -> bool
Returns whether this node has any descendants that need restyling.
Sourcepub fn set_dirty_descendants(&self)
pub fn set_dirty_descendants(&self)
Sets the dirty_descendants flag on this node.
Sourcepub fn unset_dirty_descendants(&self)
pub fn unset_dirty_descendants(&self)
Clears the dirty_descendants flag on this node.
Sourcepub fn mark_ancestors_dirty(&self)
pub fn mark_ancestors_dirty(&self)
Marks all ancestors of this node as having dirty descendants. This propagates the dirty flag up the tree so that the style traversal knows to visit the subtree containing this node.
pub fn damage(&self) -> Option<RestyleDamage>
pub fn set_damage(&mut self, damage: RestyleDamage)
pub fn insert_damage(&mut self, damage: RestyleDamage)
pub fn remove_damage(&mut 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, shell_provider: Arc<dyn ShellProvider>)
pub fn blur(&mut self, shell_provider: Arc<dyn ShellProvider>)
pub fn is_focussed(&self) -> bool
pub fn active(&mut self)
pub fn unactive(&mut self)
pub fn is_active(&self) -> bool
pub fn disable(&mut self)
pub fn enable(&mut self)
pub fn subdoc(&self) -> Option<&dyn Document>
pub fn subdoc_mut(&mut self) -> Option<&mut dyn Document>
pub fn text_input_v_centering_offset(&self, scale: f64) -> f64
Source§impl Node
impl Node
pub fn tree(&self) -> &NodeTree
pub fn with(&self, id: NodeId) -> &Node
pub fn print_tree(&self, level: usize)
pub fn index_of_child(&self, child_id: NodeId) -> 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_shadow_root(&self) -> bool
pub fn shadow_root_data(&self) -> Option<&ShadowRootData>
pub fn shadow_root_data_mut(&mut self) -> Option<&mut ShadowRootData>
Sourcepub fn shadow_root_id(&self) -> Option<NodeId>
pub fn shadow_root_id(&self) -> Option<NodeId>
If this node is a shadow host (i.e. has an attached shadow root), returns the node id of its shadow root.
Sourcepub fn layout_dom_children(&self) -> &[NodeId]
pub fn layout_dom_children(&self) -> &[NodeId]
The children to use for layout and painting.
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
Sourcepub fn outer_html(&self) -> String
pub fn outer_html(&self) -> String
Renders the HTML of this node and all its children as a String without extra whitespace.
Example output:
<html><head /><body><main id="main"><div class="arbitrary-class" /></main></body></html>Sourcepub fn outer_html_pretty(&self) -> String
pub fn outer_html_pretty(&self) -> String
Renders the HTML of this node and all its children as a String with whitespace for human
readability.
Example output:
<html>
<head />
<body>
<main id="main">
<div class="arbitrary-class" />
</main>
</body>
</html>pub fn write_outer_html(&self, writer: &mut String)
pub fn write_outer_html_pretty(&self, writer: &mut String)
pub fn attrs(&self) -> Option<&[Attribute]>
pub fn attr(&self, name: LocalName) -> Option<&str>
pub fn primary_styles( &self, ) -> Option<impl Deref<Target = ServoArc<ComputedValues>>>
pub fn text_content(&self) -> String
Sourcepub fn write_text_content<W: Write>(&self, out: &mut W)
pub fn write_text_content<W: Write>(&self, out: &mut W)
Write this subtree’s text content into any std::fmt::Write sink.
Public and generic so that a caller which does not want a String does
not have to fork this traversal to avoid one. blitz-dom-api’s
buffer-writing reader passes a sink that counts, and then one that fills
a caller-supplied slice; a private copy of this walk in that crate would
silently disagree with this one the first time a NodeData variant is
added here.
The sinks callers pass do not fail, and String’s never has, so nothing
in this crate inspects the Result. It is kept in the signature because
it is fmt::Write’s, not because there is an error to handle.
pub fn flush_style_attribute(&mut self, url_extra_data: &UrlExtraData)
pub fn order(&self) -> i32
pub fn z_index(&self) -> i32
pub fn is_stacking_context_root(&self, is_flex_or_grid_item: bool) -> bool
Sourcepub fn hit(&self, x: f32, y: f32, scale: f64) -> Option<HitResult>
pub fn hit(&self, x: f32, y: f32, scale: f64) -> 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 inline_root_ancestor(&self) -> Option<&Node>
pub fn inline_root_ancestor(&self) -> Option<&Node>
Find the inline root ancestor of this node (or self if this is an inline root). Returns None if no inline root ancestor exists.
Sourcepub fn text_offset_at_point(&self, x: f32, y: f32) -> Option<usize>
pub fn text_offset_at_point(&self, x: f32, y: f32) -> Option<usize>
Get the text byte offset at a given point, using coordinates already transformed to be relative to this inline root’s content box. Returns Some(byte_offset) if the point hits text, None otherwise.
Sourcepub fn text_range_at_point(
&self,
x: f32,
y: f32,
granularity: TextGranularity,
) -> Option<Range<usize>>
pub fn text_range_at_point( &self, x: f32, y: f32, granularity: TextGranularity, ) -> Option<Range<usize>>
The byte range of the word or line at a point, for a multi-click selection.
See TextGranularity for which click count maps to which unit. Coordinates are relative to this inline root’s content box,
as for text_offset_at_point.
Parley owns the boundary rules (it is what an <input> already selects
with), so this asks it rather than scanning for spaces: word breaks are
a Unicode segmentation question, not a whitespace one.
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 offset_parent(&self) -> Option<&Node>
pub fn offset_parent(&self) -> Option<&Node>
The nearest layout ancestor that is an offset parent, as in
CSSOM View’s offsetParent.
Sourcepub fn offset_top_left(&self) -> Point<f32>
pub fn offset_top_left(&self) -> Point<f32>
CSSOM View’s offsetLeft/offsetTop: the offset of this node’s border box from the
padding edge of its offset_parent.
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) -> BlitzPointerEvent
Source§impl Node
impl Node
Sourcepub fn scrollbar_width(&self) -> ScrollbarWidth
pub fn scrollbar_width(&self) -> ScrollbarWidth
The node’s used scrollbar-width.
Sourcepub fn scrollbar_color(&self) -> ScrollbarColor
pub fn scrollbar_color(&self) -> ScrollbarColor
The node’s used scrollbar-color.
Sourcepub fn wants_scrollbar(&self, axis: AbsoluteAxis) -> bool
pub fn wants_scrollbar(&self, axis: AbsoluteAxis) -> bool
Whether the node shows an overlay scrollbar in the given axis:
always for overflow: scroll, only when the content overflows for
overflow: auto, never otherwise — and never when
scrollbar-width: none.
Sourcepub fn scrollbar_thumb(&self, axis: AbsoluteAxis) -> Option<KurboRect>
pub fn scrollbar_thumb(&self, axis: AbsoluteAxis) -> Option<KurboRect>
Geometry of the overlay scrollbar thumb for the given axis, in
(unscaled) CSS px relative to the node’s border-box origin. None
if there is no scrollable overflow in that axis.
Sourcepub fn scrollbar_drag_ratio(&self, axis: AbsoluteAxis) -> f64
pub fn scrollbar_drag_ratio(&self, axis: AbsoluteAxis) -> f64
Content px scrolled per thumb px dragged, for the given axis.
Source§impl Node
impl Node
Sourcepub fn query_selector_raw(
&self,
selector_list: &SelectorList<SelectorImpl>,
) -> Option<NodeId>
pub fn query_selector_raw( &self, selector_list: &SelectorList<SelectorImpl>, ) -> Option<NodeId>
Find the first descendant of this node that matches the selector(s)
specified in selector_list.
The scope node itself is never matched. Selector parts may match nodes outside the scope while evaluating relationships between descendants.
Text and comment scope nodes return no matches.
Sourcepub fn query_selector_all_raw(
&self,
selector_list: &SelectorList<SelectorImpl>,
) -> SmallVec<[NodeId; 32]>
pub fn query_selector_all_raw( &self, selector_list: &SelectorList<SelectorImpl>, ) -> SmallVec<[NodeId; 32]>
Find all descendants of this node that match the selector(s) specified
in selector_list, in tree order.
The scope node itself is never matched. Selector parts may match nodes outside the scope while evaluating relationships between descendants.
Text and comment scope nodes return no matches.
Sourcepub fn matches_selector_raw(
&self,
selector_list: &SelectorList<SelectorImpl>,
) -> bool
pub fn matches_selector_raw( &self, selector_list: &SelectorList<SelectorImpl>, ) -> bool
Test whether this element matches the selector(s) specified in
selector_list.
Non-element nodes never match.
Sourcepub fn closest_raw(
&self,
selector_list: &SelectorList<SelectorImpl>,
) -> Option<NodeId>
pub fn closest_raw( &self, selector_list: &SelectorList<SelectorImpl>, ) -> Option<NodeId>
Find the closest matching element at or above this element.
Non-element nodes never match and return None.
Trait Implementations§
Source§impl Element for &'_ Node
impl Element for &'_ Node
type Impl = SelectorImpl
Source§fn opaque(&self) -> OpaqueElement
fn opaque(&self) -> OpaqueElement
fn parent_element(&self) -> Option<Self>
Source§fn parent_node_is_shadow_root(&self) -> bool
fn parent_node_is_shadow_root(&self) -> bool
Source§fn containing_shadow_host(&self) -> Option<Self>
fn containing_shadow_host(&self) -> Option<Self>
Source§fn is_pseudo_element(&self) -> bool
fn is_pseudo_element(&self) -> bool
Source§fn prev_sibling_element(&self) -> Option<Self>
fn prev_sibling_element(&self) -> Option<Self>
Source§fn next_sibling_element(&self) -> Option<Self>
fn next_sibling_element(&self) -> Option<Self>
Source§fn first_element_child(&self) -> Option<Self>
fn first_element_child(&self) -> Option<Self>
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
Source§fn is_same_type(&self, other: &Self) -> bool
fn is_same_type(&self, other: &Self) -> bool
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)
Source§fn is_html_slot_element(&self) -> bool
fn is_html_slot_element(&self) -> bool
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>
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
: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
Source§fn pseudo_element_originating_element(&self) -> Option<Self>
fn pseudo_element_originating_element(&self) -> Option<Self>
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>
Source§fn ignores_nth_child_selectors(&self) -> bool
fn ignores_nth_child_selectors(&self) -> bool
impl Eq for Node
Source§impl NodeInfo for &'_ Node
impl NodeInfo for &'_ Node
Source§fn is_element(&self) -> bool
fn is_element(&self) -> bool
Source§fn is_text_node(&self) -> bool
fn is_text_node(&self) -> bool
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?
impl Send for Node
impl Sync for Node
Source§impl<'a> TDocument for &'a Node
impl<'a> TDocument for &'a Node
Source§type ConcreteNode = &'a Node
type ConcreteNode = &'a Node
TNode type.Source§fn as_node(&self) -> Self::ConcreteNode
fn as_node(&self) -> Self::ConcreteNode
TNode.Source§fn is_html_document(&self) -> bool
fn is_html_document(&self) -> bool
Source§fn quirks_mode(&self) -> QuirksMode
fn quirks_mode(&self) -> QuirksMode
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,
Source§impl<'a> TElement for &'a Node
impl<'a> TElement for &'a Node
Source§unsafe fn clear_data(&self)
unsafe fn clear_data(&self)
Deliberately keeps the data.
Stylo calls this from exactly one place: clear_descendant_data, which
runs when an element is restyled to display: none and throws away the
computed styles of everything beneath it. That is right for Gecko, where
a hidden subtree has no frames and the styles are dead weight.
It is wrong for an application that retains its tabs. Hiding a pane deleted every computed style under it, so revealing it again had no old style to diff against, every node came back as fully damaged, and the pane was reconstructed, re-shaped and laid out from nothing. Measured on six retained panes of a real project tab, that made a re-reveal cost exactly what the first reveal cost, 46,526 layout computations and 55ms, on every switch forever.
Keeping the styles is safe because nothing else consults them while the subtree is hidden, and a mutation inside a hidden pane still marks its nodes dirty the usual way, so the reveal restyles precisely what changed. The memory is the styles of tabs the user is holding open, which is the trade the application already made by retaining them.
The cost is that clear_descendant_data still walks the subtree to find
nothing to clear, since it descends on has_data. One walk per hide.
Source§type ConcreteNode = &'a Node
type ConcreteNode = &'a Node
Source§type TraversalChildrenIterator = Traverser<'a>
type TraversalChildrenIterator = Traverser<'a>
Nodes. Read moreSource§fn as_node(&self) -> Self::ConcreteNode
fn as_node(&self) -> Self::ConcreteNode
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>
Source§fn traversal_children(&self) -> LayoutIterator<Self::TraversalChildrenIterator> ⓘ
fn traversal_children(&self) -> LayoutIterator<Self::TraversalChildrenIterator> ⓘ
Source§fn is_html_element(&self) -> bool
fn is_html_element(&self) -> bool
Source§fn is_mathml_element(&self) -> bool
fn is_mathml_element(&self) -> bool
Source§fn is_svg_element(&self) -> bool
fn is_svg_element(&self) -> bool
Source§fn style_attribute(
&self,
) -> Option<ArcBorrow<'_, Locked<PropertyDeclarationBlock>>>
fn style_attribute( &self, ) -> Option<ArcBorrow<'_, Locked<PropertyDeclarationBlock>>>
Source§fn state(&self) -> ElementState
fn state(&self) -> ElementState
Source§fn has_part_attr(&self) -> bool
fn has_part_attr(&self) -> bool
part attribute.Source§fn exports_any_part(&self) -> bool
fn exports_any_part(&self) -> bool
Source§fn each_class<F>(&self, callback: F)
fn each_class<F>(&self, callback: F)
Source§fn each_attr_name<F>(&self, callback: F)
fn each_attr_name<F>(&self, callback: F)
Source§fn has_dirty_descendants(&self) -> bool
fn has_dirty_descendants(&self) -> bool
Source§fn has_snapshot(&self) -> bool
fn has_snapshot(&self) -> bool
Source§fn handled_snapshot(&self) -> bool
fn handled_snapshot(&self) -> bool
Source§unsafe fn set_handled_snapshot(&self)
unsafe fn set_handled_snapshot(&self)
Source§unsafe fn set_dirty_descendants(&self)
unsafe fn set_dirty_descendants(&self)
Source§unsafe fn unset_dirty_descendants(&self)
unsafe fn unset_dirty_descendants(&self)
Source§fn store_children_to_process(&self, _n: isize)
fn store_children_to_process(&self, _n: isize)
Source§fn did_process_child(&self) -> isize
fn did_process_child(&self) -> isize
Source§unsafe fn ensure_data(&self) -> ElementDataMut<'_>
unsafe fn ensure_data(&self) -> ElementDataMut<'_>
Source§fn borrow_data(&self) -> Option<ElementDataRef<'_>>
fn borrow_data(&self) -> Option<ElementDataRef<'_>>
Source§fn mutate_data(&self) -> Option<ElementDataMut<'_>>
fn mutate_data(&self) -> Option<ElementDataMut<'_>>
Source§fn skip_item_display_fixup(&self) -> bool
fn skip_item_display_fixup(&self) -> bool
Source§fn may_have_animations(&self) -> bool
fn may_have_animations(&self) -> bool
Source§fn has_animations(&self, context: &SharedStyleContext<'_>) -> bool
fn has_animations(&self, context: &SharedStyleContext<'_>) -> bool
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
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
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>>>
Source§fn transition_rule(
&self,
context: &SharedStyleContext<'_>,
) -> Option<Arc<Locked<PropertyDeclarationBlock>>>
fn transition_rule( &self, context: &SharedStyleContext<'_>, ) -> Option<Arc<Locked<PropertyDeclarationBlock>>>
Source§fn shadow_root(
&self,
) -> Option<<Self::ConcreteNode as TNode>::ConcreteShadowRoot>
fn shadow_root( &self, ) -> Option<<Self::ConcreteNode as TNode>::ConcreteShadowRoot>
Source§fn containing_shadow(
&self,
) -> Option<<Self::ConcreteNode as TNode>::ConcreteShadowRoot>
fn containing_shadow( &self, ) -> Option<<Self::ConcreteNode as TNode>::ConcreteShadowRoot>
Source§fn get_attr(&self, attr: &LocalName, _ns: &Namespace) -> Option<String>
fn get_attr(&self, attr: &LocalName, _ns: &Namespace) -> Option<String>
Source§fn lang_attr(&self) -> Option<AttrValue>
fn lang_attr(&self) -> Option<AttrValue>
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
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
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>,
hints.Source§fn local_name(&self) -> &LocalName
fn local_name(&self) -> &LocalName
Source§fn query_container_size(&self, _display: &Display) -> Size2D<Option<Au>>
fn query_container_size(&self, _display: &Display) -> Size2D<Option<Au>>
Source§fn each_custom_state<F>(&self, _callback: F)
fn each_custom_state<F>(&self, _callback: F)
Source§fn has_selector_flags(&self, flags: ElementSelectorFlags) -> bool
fn has_selector_flags(&self, flags: ElementSelectorFlags) -> bool
Source§fn relative_selector_search_direction(&self) -> ElementSelectorFlags
fn relative_selector_search_direction(&self) -> ElementSelectorFlags
Source§fn compute_layout_damage(
old: &ComputedValues,
new: &ComputedValues,
) -> RestyleDamage
fn compute_layout_damage( old: &ComputedValues, new: &ComputedValues, ) -> RestyleDamage
_old to _new.Source§fn owner_doc_matches_for_testing(&self, _: &Device) -> bool
fn owner_doc_matches_for_testing(&self, _: &Device) -> bool
Source§fn matches_user_and_content_rules(&self) -> bool
fn matches_user_and_content_rules(&self) -> bool
Source§fn traversal_parent(&self) -> Option<Self>
fn traversal_parent(&self) -> Option<Self>
Source§fn inheritance_parent(&self) -> Option<Self>
fn inheritance_parent(&self) -> Option<Self>
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),
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
Source§fn is_html_media_element(&self) -> bool
fn is_html_media_element(&self) -> bool
Source§fn subtree_bloom_filter(&self) -> u64
fn subtree_bloom_filter(&self) -> u64
Source§fn bloom_may_have_hash(&self, bloom_hash: u64) -> bool
fn bloom_may_have_hash(&self, bloom_hash: u64) -> bool
Source§fn hash_for_bloom_filter(hash: u32) -> u64
fn hash_for_bloom_filter(hash: u32) -> u64
Source§fn slotted_nodes(&self) -> &[Self::ConcreteNode]
fn slotted_nodes(&self) -> &[Self::ConcreteNode]
Source§fn smil_override(
&self,
) -> Option<ArcBorrow<'_, Locked<PropertyDeclarationBlock>>>
fn smil_override( &self, ) -> Option<ArcBorrow<'_, Locked<PropertyDeclarationBlock>>>
Source§fn animation_declarations(
&self,
context: &SharedStyleContext<'_>,
) -> AnimationDeclarations
fn animation_declarations( &self, context: &SharedStyleContext<'_>, ) -> AnimationDeclarations
Source§fn each_exported_part<F>(
&self,
_name: &GenericAtomIdent<AtomStaticSet>,
_callback: F,
)
fn each_exported_part<F>( &self, _name: &GenericAtomIdent<AtomStaticSet>, _callback: F, )
Source§fn may_generate_pseudo(
&self,
pseudo: &PseudoElement,
_primary_style: &ComputedValues,
) -> bool
fn may_generate_pseudo( &self, pseudo: &PseudoElement, _primary_style: &ComputedValues, ) -> bool
Source§fn has_current_styles(&self, data: &ElementData) -> bool
fn has_current_styles(&self, data: &ElementData) -> bool
Source§fn has_animation_only_dirty_descendants(&self) -> bool
fn has_animation_only_dirty_descendants(&self) -> bool
Source§unsafe fn set_animation_only_dirty_descendants(&self)
unsafe fn set_animation_only_dirty_descendants(&self)
Source§unsafe fn unset_animation_only_dirty_descendants(&self)
unsafe fn unset_animation_only_dirty_descendants(&self)
Source§unsafe fn clear_descendant_bits(&self)
unsafe fn clear_descendant_bits(&self)
Source§fn is_visited_link(&self) -> bool
fn is_visited_link(&self) -> bool
Source§fn implemented_pseudo_element(&self) -> Option<PseudoElement>
fn implemented_pseudo_element(&self) -> Option<PseudoElement>
Source§fn has_animation_restyle_hints(&self) -> bool
fn has_animation_restyle_hints(&self) -> bool
Source§fn note_highlight_pseudo_style_invalidated(&self)
fn note_highlight_pseudo_style_invalidated(&self)
Source§fn ultimate_originating_element(&self) -> Self
fn ultimate_originating_element(&self) -> Self
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),
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>,
rules.
https://drafts.csswg.org/css-view-transitions-1/#document-dynamic-view-transition-style-sheetSource§fn get_tree_counting_result(
&self,
caches: &mut TreeCountingCaches,
) -> TreeCountingResult
fn get_tree_counting_result( &self, caches: &mut TreeCountingCaches, ) -> TreeCountingResult
caches with the sibling-index() and
sibling-count() values for all siblings of this element.Source§impl<'a> TNode for &'a Node
impl<'a> TNode for &'a Node
Source§type ConcreteElement = &'a Node
type ConcreteElement = &'a Node
TElement type.Source§type ConcreteDocument = &'a Node
type ConcreteDocument = &'a Node
TDocument type.Source§type ConcreteShadowRoot = &'a Node
type ConcreteShadowRoot = &'a Node
TShadowRoot type.Source§fn parent_node(&self) -> Option<Self>
fn parent_node(&self) -> Option<Self>
Source§fn first_child(&self) -> Option<Self>
fn first_child(&self) -> Option<Self>
Source§fn last_child(&self) -> Option<Self>
fn last_child(&self) -> Option<Self>
Source§fn prev_sibling(&self) -> Option<Self>
fn prev_sibling(&self) -> Option<Self>
Source§fn next_sibling(&self) -> Option<Self>
fn next_sibling(&self) -> Option<Self>
Source§fn owner_doc(&self) -> Self::ConcreteDocument
fn owner_doc(&self) -> Self::ConcreteDocument
Source§fn is_in_document(&self) -> bool
fn is_in_document(&self) -> bool
Source§fn traversal_parent(&self) -> Option<Self::ConcreteElement>
fn traversal_parent(&self) -> Option<Self::ConcreteElement>
Source§fn opaque(&self) -> OpaqueNode
fn opaque(&self) -> OpaqueNode
OpaqueNode.Source§fn as_element(&self) -> Option<Self::ConcreteElement>
fn as_element(&self) -> Option<Self::ConcreteElement>
Source§fn as_document(&self) -> Option<Self::ConcreteDocument>
fn as_document(&self) -> Option<Self::ConcreteDocument>
Source§fn as_shadow_root(&self) -> Option<Self::ConcreteShadowRoot>
fn as_shadow_root(&self) -> Option<Self::ConcreteShadowRoot>
Source§fn dom_children(&self) -> DomChildren<Self> ⓘ
fn dom_children(&self) -> DomChildren<Self> ⓘ
Source§fn dom_descendants(&self) -> DomDescendants<Self> ⓘ
fn dom_descendants(&self) -> DomDescendants<Self> ⓘ
Source§fn next_in_preorder(&self, scoped_to: Self) -> Option<Self>
fn next_in_preorder(&self, scoped_to: Self) -> Option<Self>
Source§fn next_in_preorder_skipping_children(&self, scoped_to: Self) -> Option<Self>
fn next_in_preorder_skipping_children(&self, scoped_to: Self) -> Option<Self>
Source§fn parent_element(&self) -> Option<Self::ConcreteElement>
fn parent_element(&self) -> Option<Self::ConcreteElement>
Source§fn parent_element_or_host(&self) -> Option<Self::ConcreteElement>
fn parent_element_or_host(&self) -> Option<Self::ConcreteElement>
Source§impl<'a> TShadowRoot for &'a Node
impl<'a> TShadowRoot for &'a Node
Source§type ConcreteNode = &'a Node
type ConcreteNode = &'a Node
Source§fn as_node(&self) -> Self::ConcreteNode
fn as_node(&self) -> Self::ConcreteNode
Source§fn host(&self) -> <Self::ConcreteNode as TNode>::ConcreteElement
fn host(&self) -> <Self::ConcreteNode as TNode>::ConcreteElement
Source§fn style_data<'b>(&self) -> Option<&'b CascadeData>where
Self: 'b,
fn style_data<'b>(&self) -> Option<&'b CascadeData>where
Self: 'b,
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,
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,
Source§fn implicit_scope_for_sheet(
&self,
_sheet_index: usize,
) -> Option<ImplicitScopeRoot>
fn implicit_scope_for_sheet( &self, _sheet_index: usize, ) -> Option<ImplicitScopeRoot>
Auto Trait Implementations§
impl !Freeze for Node
impl !RefUnwindSafe for Node
impl !UnwindSafe for Node
impl Unpin for Node
impl UnsafeUnpin for Node
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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 more