Skip to content

XrayCaptureWalker

Defined in: packages/xray/src/measure.ts:121

The programmable capture walker (ADR 0018; ADR 0022 §5). element is offered each non-boundary element TOP-DOWN over the measured IR (the applyWalker pass, NOT the DOM walk) and returns a WalkerDecision the pass applies. The declarative data-xr-* hints cover the 90%; this is the 10% escape hatch for what a markup attribute cannot express.

optional element(ctx): WalkerDecision

Defined in: packages/xray/src/measure.ts:128

Called for every non-boundary element node (a stitch carries no element and is skipped — ADR 0006 — so a boundary never reaches here). Return one of ctx.ignore(), ctx.bone(), or ctx.keep(). An ignore/bone decision stops the descent (the subtree lowers); keep recurses.

CaptureWalkerContext

WalkerDecision