From 5e682b01c68ea75dda01fef1788a5bdb9daa06c5 Mon Sep 17 00:00:00 2001 From: giles Date: Thu, 23 Apr 2026 22:19:48 +0000 Subject: [PATCH] HS-plan: mark select returns selected text blocked --- plans/hs-conformance-to-100.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plans/hs-conformance-to-100.md b/plans/hs-conformance-to-100.md index 4bde4afb..8dfde940 100644 --- a/plans/hs-conformance-to-100.md +++ b/plans/hs-conformance-to-100.md @@ -48,7 +48,7 @@ Each cluster below is one commit. Order is rough — a loop agent may skip ahead 7. **[done (+1) — partial, 3 tests remain: inserted-button handler doesn't fire for afterbegin/innerHTML paths; might need targeted trace of hs-boot-subtree! or _setInnerHTML timing] `put` hyperscript reprocessing** — `put / properly processes hyperscript at end/start/content/symbol` (4 tests, all `Expected 42, got 40`). After a put operation, newly inserted HS scripts aren't being activated. Fix: `hs-put-at!` should `hs-boot-subtree!` on the target after DOM insertion. Expected: +4. -8. **[in-progress] `select returns selected text`** (1 test, `hs-upstream-select`). Likely `select` command needs to return `window.getSelection().toString()` equivalent. Add host-call to selection API in mock. Expected: +1. +8. **[blocked: mock selection state needs setup the JS test does via createRange+setStart+setEnd+addRange; attempted generator pattern + window.getSelection()/createRange mock but result still empty — host-get textContent doesn't propagate through range.setStart stored arg. Would need deeper mock of DOM text nodes with propagation.] `select returns selected text`** (1 test, `hs-upstream-select`). Likely `select` command needs to return `window.getSelection().toString()` equivalent. Add host-call to selection API in mock. Expected: +1. 9. **[pending] `wait on event` basics** — `wait / can wait on event`, `on another element`, `waiting ... sets it to the event`, `destructure properties in a wait` (4 tests). Event-waiter suspension issue. Expected: +3-4. @@ -158,6 +158,9 @@ Many tests are `SKIP (untranslated)` because `tests/playwright/generate-sx-tests (Reverse chronological — newest at top.) +### 2026-04-23 — cluster 8 select returns selected text (blocked, reverted) +- Attempted: added `hs-get-selection` runtime, compiler branch to rewrite bare `selection` to `(hs-get-selection)`, generator pattern to translate `evaluate(() => { var range = document.createRange(); ...; window.getSelection().addRange(range); })`, and mock support in `hs-run-filtered.js` for `document.createRange` / `window.getSelection` / `firstChild` text node. Tests still returned empty — range.toString() wasn't picking up the text. Reverted per the abort rule. Would need a more faithful mock of DOM text nodes with data propagation. + ### 2026-04-23 — cluster 7 put hyperscript reprocessing (partial) - **f21eb008** — `HS: put hyperscript reprocessing — generator fix (+1 test)`. Generator was swallowing non-window-setup `evaluate(() => { ... })` blocks. Fixed to only `continue` when a window-setup actually parsed, else fall through. Added a new pattern for `evaluate(() => { const e = new Event(...); SEL.dispatchEvent(e); })`. Suite hs-upstream-put: 33/38 → 34/38. "at end of" now passes; "at start of" / "in a element target" / "in a symbol write" still fail because the inserted-button handler doesn't activate on the afterbegin/innerHTML code paths. Smoke 0-195: 162/195 unchanged.