| 6 |
| toggling with `onclick`, forms, tables, SVG drawn by hand, D3 (bar + line |
| 7 | with axes, `getBBox`, `d3.pointer`), Chart.js (line + bar with tooltips, |
| 8 | loaded from jsDelivr / cdnjs URLs), CSS and rAF animation, pointer drag, |
| 9 | range/color inputs, `localStorage`, `prefers-color-scheme`, a bare fragment. |
| 10 | Each one is driven by a scripted interaction and compared pixel-wise with |
| 11 | the same file rendered natively (reference mode, `connect-src 'none'`). |
| 12 | - Time-dependent widgets (clock, rAF, CSS animation) are checked behaviourally |
| 13 | and screenshot-compared with a 100 % tolerance; everything else uses 2–6 %. |
| 14 | - The two "known-unsupported" widgets (Three.js, raw WebGL) are expected to |
| 15 | fall back; they pass if the fallback renders and no error escapes. |
| 16 |
| 17 | ### Top failure causes found while building the harness (all fixed generally) |
| 18 |
| 19 | 1. **Missing form `submit` events** — the sandboxed renderer frame lacked |
| 20 | `allow-forms`, so Chrome never dispatched `submit`. Affected every form widget. |
| 21 | 2. **`:checked` resolved from attributes** — linkedom's css-select ignores |
| 22 | runtime checkedness (and its aliases beat user pseudo-classes); quiz scored |
| 23 | 0/3. Fixed with a selector rewrite + state-backed pseudo-classes. |
| 24 | 3. **Read-only `window`/`frames`/`top` aliases** — `var frames = 0` silently |
| 25 | kept the window object; counters became `NaN`. |
| 26 | 4. **Scripts from `innerHTML` were executed** — unbounded self re-execution, |
| 27 | ~100 k elements; browsers keep such scripts inert. |
| 28 | 5. **Quirks mode in reference** — doctype-less fragments rendered 1–2 px |
| 29 | differently natively; the product always renders fragments in standards mode. |
| 30 | 6. **Colour scheme** — `color-scheme` on the iframe element does not change |
| 31 | `prefers-color-scheme` inside a sandboxed frame; the host now owns the theme. |
| 32 | 7. **Harness artefacts** — Playwright element screenshots can fire hover on a |
| 33 | shifted layout (park the mouse), worker restarts after a failure lose |
| 34 | in-memory results (persist per test), `test-results/` is wiped per run. |
| 35 |
| 36 | ### Known remaining gaps (not covered by the corpus) |
| 37 |
| 38 | - `light-dark()` inside `style=""` attributes is resolved once. |
| 39 | - `preventDefault()` for the *first* keypress / checkbox toggle cannot cancel |
| 40 | the native default (the renderer learns from the second occurrence on). |
| 41 | - `IntersectionObserver` reports everything as visible; Web Animations API, |
| 42 | Shadow DOM and custom elements are not rendered. |
| 43 | - Sync layout queries cost a worker round trip each (~0.1–0.3 ms here); |
| 44 | D3 axes issue only a handful, Chart.js ~20 `measureText` calls per render |
| 45 | thanks to the per-flush cache. |
| 46 |