pub enum DomMutation<Id> {
Inserted {
node: Id,
parent: Id,
},
Removed {
node: Id,
former_parent: Id,
},
AttributeChanged {
node: Id,
name: QualName,
old_value: Option<String>,
},
CharacterDataChanged {
node: Id,
},
SubtreeReplaced {
node: Id,
},
Moved {
node: Id,
from_parent: Id,
to_parent: Id,
},
}Expand description
A recorded structural DOM mutation — render-state-free (no dirty bits, no style).
Id is the implementor’s LayoutDom::NodeId.
Variants§
Inserted
node was inserted under parent.
Removed
node was removed from former_parent.
AttributeChanged
The attribute named name was set or changed on node.
old_value is the attribute’s value before this change (None
if the attribute was newly added). It is plain pre-mutation DOM
data — not render state — and lets serval-layout reconstruct a
Stylo ElementSnapshot at restyle time (the old value is gone from
the live DOM by then). See
docs/2026-05-25_fine_grained_restyle_plan.md.
CharacterDataChanged
A text/comment node’s character data changed.
Fields
node: IdSubtreeReplaced
node’s entire child subtree was replaced (e.g. via innerHTML).
Fields
node: IdMoved
node moved atomically from from_parent to to_parent (possibly the
same parent, reordered) with state preserved — the Node.moveBefore()
contract (WHATWG DOM). Unlike a Removed + Inserted pair this promises
the subtree never left the tree: consumers may keep per-node retained
state (boxes, shaped text, focus, scroll) and treat the move as a
splice/graft candidate rather than a teardown. A conservative consumer
handles it exactly as removed-from + inserted-under.
(docs/2026-07-05_movebefore_dom_standard_plan.md, S1.)
Trait Implementations§
Source§impl<Id: Clone> Clone for DomMutation<Id>
impl<Id: Clone> Clone for DomMutation<Id>
Source§fn clone(&self) -> DomMutation<Id>
fn clone(&self) -> DomMutation<Id>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more