Donner SVG 0.8.0
0.8.0 ยท ebf353960.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::svg::components::TreeMutation Class Reference

Central mutation service for SVG DOM tree edits. More...

#include "donner/svg/components/TreeMutation.h"

Static Public Member Functions

static void SetValue (EntityHandle node, const RcStringOrRef &value)
 Set an XML node value under document write access and refresh affected selector caches.
static void InvalidateTextContentStyles (EntityHandle element)
 Invalidate nonlocal selector results after an element's emptiness changes.
static void InsertBefore (EntityHandle parent, EntityHandle newNode, EntityHandle referenceNode=EntityHandle())
 Insert newNode as a child of parent before referenceNode.
static void AppendChild (EntityHandle parent, EntityHandle child)
 Append child as the last child of parent.
static void ReplaceChild (EntityHandle parent, EntityHandle newChild, EntityHandle oldChild)
 Replace oldChild with newChild under parent.
static void RemoveChild (EntityHandle parent, EntityHandle child)
 Remove child from parent.
static void Remove (EntityHandle entity)
 Remove entity from its parent, if it has one.

Detailed Description

Central mutation service for SVG DOM tree edits.

TreeMutation is the public SVG layer's single path for inserting, replacing, and detaching SVG element entities. It wraps the low-level donner::components::TreeComponent link operations with SVG-specific validation, dirty-flag propagation, render-tree invalidation, and node-lifetime state updates.

Member Function Documentation

◆ AppendChild()

void donner::svg::components::TreeMutation::AppendChild ( EntityHandle parent,
EntityHandle child )
static

Append child as the last child of parent.

Parameters
parentParent entity to receive the child.
childEntity to append.

◆ InsertBefore()

void donner::svg::components::TreeMutation::InsertBefore ( EntityHandle parent,
EntityHandle newNode,
EntityHandle referenceNode = EntityHandle() )
static

Insert newNode as a child of parent before referenceNode.

If referenceNode is invalid, newNode is appended.

Parameters
parentParent entity to receive the child.
newNodeEntity to insert.
referenceNodeExisting child to insert before, or an invalid handle to append.

◆ InvalidateTextContentStyles()

void donner::svg::components::TreeMutation::InvalidateTextContentStyles ( EntityHandle element)
static

Invalidate nonlocal selector results after an element's emptiness changes.

Does nothing when no stylesheet has a selector that depends on text content.

Parameters
elementModified element; the caller holds document write access.

◆ Remove()

void donner::svg::components::TreeMutation::Remove ( EntityHandle entity)
static

Remove entity from its parent, if it has one.

Parameters
entityEntity to detach from its parent.

◆ RemoveChild()

void donner::svg::components::TreeMutation::RemoveChild ( EntityHandle parent,
EntityHandle child )
static

Remove child from parent.

The child entity and its descendants remain alive as a detached subtree.

Parameters
parentParent entity whose child is removed.
childExisting child to detach.

◆ ReplaceChild()

void donner::svg::components::TreeMutation::ReplaceChild ( EntityHandle parent,
EntityHandle newChild,
EntityHandle oldChild )
static

Replace oldChild with newChild under parent.

Parameters
parentParent entity whose child is replaced.
newChildReplacement entity.
oldChildExisting child to detach.

◆ SetValue()

void donner::svg::components::TreeMutation::SetValue ( EntityHandle node,
const RcStringOrRef & value )
static

Set an XML node value under document write access and refresh affected selector caches.

Parameters
nodeXML node to modify.
valueNew node value.

The documentation for this class was generated from the following file: