Documentation M2 — interactive
M2 — Interactive acceptance#
M2 is complete on the currently supported Linux x64 development target. The acceptance
application is examples/interactive — three files (index.html,
styles.css, app.js) that put input, propagation, restyle and animation on screen at once.
Repeat the gate with:
bun run --cwd packages/blitsen test:m2Acceptance evidence#
The gate is packages/blitsen/test/m2-acceptance.mjs.
It drives the document through the same path a native window uses, not a shortcut around it:
pointer coordinates are hit-tested against the laid-out tree, and the event is dispatched at
whatever that resolves to. Nothing in the gate picks a target by hand.
- Events dispatch with correct propagation. A click at the centre of the control's border box hit-tests to the control (or a child of it) and produces exactly
window↓ document↓ stage↓ stage↑ document↑ window↑— capture root-to-target, then bubble target-to-root. A subsequentkeydowntraverses the same three-level path. - Default actions run, and
preventDefaultstops them. The click moves focus, sodocument.activeElementbecomes the control and the later key event lands there. The control'sArrowLeftlistener callspreventDefault, and dispatch reports the event as cancelled. - Style and class mutation relayouts correctly.
classList.toggle("expanded")widens the demo from 680 px to 820 px. The gate asserts the width JavaScript reads back synchronously equals the width Blitz laid out, so the read is not observing a stale tree. requestAnimationFramedrives a smooth animation. Across 60 frames the orb takes a distinct position on nearly every frame, and every inter-frame step is within 1% of the 2.667 px that a 16.67 ms tick at the app's velocity implies — the motion is timestamp-driven, not frame-counted.
Two harness fidelity fixes were required to make this gate mean anything:
- Headless harnesses now resolve
file:anddata:subresources through a synchronous local provider. Without one the document parsed with its external stylesheet missing, so every layout assertion silently measured unstyled boxes. - Coordinate-level pointer injection (
__blitsenInjectPointerAt) hit-tests before dispatching, matching the windowed host's input path. It is installed only in the animation harness; the document-scripts harness stays byte-identical to a shipped window, and a fixture asserts no test-only injection global leaks into it.
Interactive confirmation#
Interactive confirmation by a human is recorded per platform, as it was for M1. Linux x64 is confirmed by the owner and the milestone gate is closed against it. Windows and macOS interactive verification is deferred with the rest of their platform validation, on the M1 precedent — Linux x64 is the only supported development target.
Launch the demo with:
bun run --cwd packages/blitsen example:interactive