Skip to main content

DomFingerprints

Struct DomFingerprints 

Source
pub struct DomFingerprints {
    pub structure: Vec<u64>,
    pub style: Vec<u64>,
    pub structure_root: u64,
    pub style_root: u64,
}
Expand description

Two-tier fingerprints of a recursive crate::dom::Dom.

Computed BEFORE the cascade, in the same pre-order the flattener (convert_dom_into_compact_dom) assigns NodeIds — index i in each Vec is flattened NodeId(i).

WHY TWO TIERS (user directive 2026-08-08): “the start should just scan over the NodeHierarchy to discover anything that changed, which is iterating over a minimal array” — and css must be EXCLUDED from that first equivalence, because a stylesheet can only affect the subtree it is attached to:

  • structure: hierarchy shape + node content (node_type, ids/classes, attributes, callback EVENT types). NO css of any kind. If this tier is equal, the old tree, its shaped text and its intrinsic caches are all reusable — and if the style tier is ALSO equal, the previous CASCADE is reusable wholesale (skip create_from_dom entirely).
  • style: per-node inline css + (at subtree roots that carry .with_css() sheets) the sheet content. A difference here with an equal structure tier means: keep the tree, re-cascade the affected subtree(s) only.

The per-node arrays exist so a mismatch NAMES the changed nodes (the eventual dirty-set for scoped re-cascade / word-granular text relayout); the root folds make the equal case one u64 compare per tier.

Fields§

§structure: Vec<u64>

Per-node structural hash, pre-order. Folds: node_type content (image-callback nodes hash (fn ptr, RefAny type_id) — the RefAny INSTANCE is rebuilt every frame by design and is transferred, not compared; mirrors is_layout_equivalent), ids+classes, callback event types, contenteditable/flags/dataset, and child COUNT (pre-order alone cannot distinguish [a [b] c] from [a [b c]]).

§style: Vec<u64>

Per-node style hash, pre-order: inline css properties + conditions, plus the node’s attached .with_css() sheets (path, declarations, @-conditions, priority per rule).

§structure_root: u64

Order-sensitive fold of structure.

§style_root: u64

Order-sensitive fold of style.

Trait Implementations§

Source§

impl Clone for DomFingerprints

Source§

fn clone(&self) -> DomFingerprints

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DomFingerprints

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for DomFingerprints

Source§

impl PartialEq for DomFingerprints

Source§

fn eq(&self, other: &DomFingerprints) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DomFingerprints

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.