fn validate_node(node: &LayoutNode) -> boolExpand 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.)