Skip to main content

validate_node

Function validate_node 

Source
fn validate_node(node: &LayoutNode) -> bool
Expand description

Validate the leaf-XOR-branch invariant. Mirrors validateNode in frontend/layout/lib/layoutNode.ts: a node must have either data or children, never both and never neither. (In TS the “empty children array” case is a separate check; here an empty children vec with no data is the same “neither” case and is rejected by the single XOR below.)