Hyperscript conformance: 372→373 — hide/show strategy, generator toEqual

Parser: hide/show handle `with opacity/visibility/display` strategy,
target detection for then-less chaining (add/remove/set/put as boundary).
Generator: inline run().toEqual([...]) pattern for eval-only tests.
Compiler: hide/show emit correct CSS property per strategy.

373/831 (45%)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-12 11:42:28 +00:00
parent 3dbbe7e1d1
commit 854ed9c027
24 changed files with 1665 additions and 469 deletions

View File

@@ -103,6 +103,23 @@
});
} else if (opName === "io-navigate") {
// navigation — don't resume
} else if (opName === "text-measure") {
// Pretext: measure text using offscreen canvas
var font = arg;
var size = items && items[2];
var text = items && items[3];
var canvas = document.createElement("canvas");
var ctx = canvas.getContext("2d");
ctx.font = (size || 16) + "px " + (font || "serif");
var m = ctx.measureText(text || "");
try {
driveAsync(result.resume({
width: m.width,
height: m.actualBoundingBoxAscent + m.actualBoundingBoxDescent,
ascent: m.actualBoundingBoxAscent,
descent: m.actualBoundingBoxDescent
}));
} catch(e) { console.error("[sx] driveAsync:", e.message); }
} else {
console.warn("[sx] unhandled IO:", opName);
}