Skip to content

layoutWalk

disposition: bound, direction: spec-to-code, basis: implementation

An anatomy rule of the Web Components binding. The element types named below resolve jointly here — which type a node becomes, or what tag and semantics an element takes, is decided by this rule rather than per type.

Keys. container, text, glyph, instance, slot

Operands

Every fact the rule reads. Nothing outside this set participates.

OperandFrom
layoutspec document — ordered LayoutNodes: a leaf is an element name, a branch is one name over ordered children
variants[].layoutspec document — a variant’s layout is a WHOLE structure layered over the default
element.instanceOfspec document
element.typespec document

Derived predicates

NameExpressionSource
derived.conditionsnode.conditions = the variant configurations that place this element here, state-classified props stripped; entries OR'd, each entry a conjunctionshared layout-tree analysis

Cases

Ordered — first match wins.

#WhenEmitsWhy
1node.excludeConditions presentthe element, guarded to NOT render here under the configurations where a variant re-parents itA re-parented element renders in the variant’s position when it matches and in its default position otherwise — never both
2derived.conditions presentthe element wrapped in its render condition in the lit templateAn element only some variants place exists in the shadow tree exactly when a placing configuration matches
3node.key presentthe element at its tree position, children recursed in authored order — slots project, instances compose, everything else a shadow-tree node whose tag the semanticsAndTags rule decidesThe walk is the structure; order is the spec’s

Otherwise

Nothing is emitted. — An element absent from every layout renders nowhere

The tree operations are the same shared module React walks, so the two emitters cannot diverge on structure — only on what each node becomes.