Geometry and generated ownership¶
Supply one connected original live-document HTMLElement, outside editable or native-interactive content, empty except at most 64 direct ASCII-collapsible whitespace/comment nodes. The original document/window/frame must remain live. Only one wrapper owns a root. Consumer provides viewport height/theme. The wrapper owns position/display/overflow/padding/box-sizing/grid/contain properties and exact root role/name/reference/tabindex attributes. Required properties use important inline declarations; unrelated consumer inline edits survive cleanup. Root hidden attribute is respected with owned display:none until revealed.
A generated relative spacer defines the model extent. Rows use exact absolute
index * rowHeight, fixed height, clipped single-line textContent (no consumer
HTML), roleoption/name/selection/disabled/setsize/posinset and tabindex-1. Root
owns one sequential Tab stop and active descendant. An offscreen active row pins
its real position and ID; it is not a hidden duplicate. Model entries outside
viewport remain eligible unless copied disabled state says otherwise.
Viewport clientHeight must be finite positive and no greater 4096px. Zero, hidden, inert or unavailable viewport suspends rendering admission and retires Tab/active reference; height over 4096 records TooLarge. Unsupported transform/individual translate/rotate/scale/perspective/zoom on root/ancestors (at most 64 inspected), generated spacer or rows records Coordinates. Root in-flow pseudo content and any visible generated spacer/row pseudo content (including absolute decorators) also rejects coordinate admission. Scroll extent must match max(model extent,clientHeight) within 2px; mounted row offset/height must match expected geometry within 2px. Geometry failure suspends rather than guessing another coordinate mapping. These limits bound wrapper work, not browser layout, document lookup internals, consumer callback allocation or global platform memory.
Visible and overscan rows plus at most one active and one pressed pin mount at most 512 nodes. Mounted plus detached reusable free rows also total at most 512. Scroll and original-window ResizeObserver/MutationObserver refresh this pool; scroll does not alter selection/active model or notify. The root can contain at most 65 direct nodes including its generated spacer. Unexpected consumer children, removed/adopted root, replaced generated IDs/text/style/children, generated editable/hidden/inert profiles or externally adopted/reparented retained free nodes retire ownership before admission. Owned ARIA and Tab fields are reasserted on refresh. Public getters do not repair stale external mutations implicitly.
Generated IDs use a module-local monotonically increasing safe-integer owner namespace and model index. Constructor checks all prospective IDs with at most 65536 original-document getElementById lookups before mutation; collision rejects atomically without consuming the owner. Counter exhaustion rejects instead of wrapping. Rendering verifies each mounted ID resolves to its owned node; later collision at a new row retires. This is an original-document lookup contract, not a global duplicate-ID scan or cross-script cryptographic namespace.