| 6 |
| 7 | Pass = sandbox loaded without JS errors, the scripted interaction produced the expected result, and the screenshot differs from the native reference by at most the tolerance. |
| 8 |
| 9 | | Widget | Pass | Behaviour (sandbox) | Pixel diff | Tolerance | JS ms | Ops | Sync queries (cache hits) | Diagnostics | Note | |
| 10 | |---|---|---|---|---|---|---|---|---|---| |
| 11 | | tabs.html | ✅ | ok | 0.00% | 2% | 17 | 132 | 0 (0) | | | |
| 12 | | fragment.html | ✅ | ok | 0.00% | 2% | 9 | 92 | 0 (0) | | | |
| 13 | | calculator.html | ✅ | ok | 0.00% | 2% | 11 | 123 | 0 (0) | | | |
| 14 | | table-sort.html | ✅ | ok | 0.00% | 2% | 19 | 259 | 0 (0) | | | |
| 15 | | quiz-buttons.html | ✅ | ok | 0.00% | 2% | 17 | 128 | 0 (0) | | | |
| 16 | | svg-chart.html | ✅ | ok | 0.00% | 2% | 14 | 125 | 6 (0) | | | |
| 17 | | svg-bar-chart.html | ✅ | ok | 0.00% | 2% | 18 | 156 | 1 (0) | | | |
| 18 | | svg-line-chart.html | ✅ | ok | 0.00% | 2% | 22 | 202 | 3 (0) | | | |
| 19 | | canvas-line-chart.html | ✅ | ok | 0.00% | 2% | 27 | 62 | 15 (0) | | | |
| 20 | | canvas-bar-chart.html | ✅ | ok | 0.00% | 2% | 24 | 53 | 16 (2) | | | |
| 21 | | css-animation.html | ✅ | ok | 0.00% | 100% | 10 | 51 | 0 (0) | | spinner frame differs by timing | |
| 22 | | clock.html | ✅ | ok | 0.37% | 100% | 15 | 42 | 0 (0) | | time of day differs | |
| 23 | | raf-animation.html | ✅ | ok | 2.93% | 100% | 28 | 220 | 3 (3) | | ball position depends on frame timing | |
| 24 | | drag.html | ✅ | ok | 0.00% | 2% | 8 | 32 | 0 (0) | | | |
| 25 | | notes-storage.html | ✅ | ok | 0.08% | 2% | 16 | 115 | 0 (0) | | | |
| 26 | | dark-mode.html | ✅ | ok | 0.53% | 6% | 8 | 49 | 5 (2) | | bridge line differs by design (reference has no TelegramWidget) | |
| 27 | | dark-mode.html (dark theme) | ✅ | ok | 0.55% | 6% | 9 | 49 | 5 (2) | | host-owned colour scheme; bridge line differs by design | |
| 28 | | stepper.html | ✅ | ok | 0.00% | 2% | 15 | 98 | 0 (0) | | | |
| 29 | | three-js.html | ✅ | ok | 0.00% | 100% | 6 | 38 | 0 (0) | script-skipped×1: external script not available: https://cdn.jsdelivr.net/npm/three@0.160.0/build/three.min.js | expected unsupported: Three.js/WebGL → fallback text | |
| 30 | | webgl.html | ✅ | ok | 56.74% | 100% | 6 | 38 | 0 (0) | unsupported×1: WebGL | expected unsupported: WebGL → 2D fallback | |
| 31 |
| 32 | ## Failures and top causes |
| 33 |
| 34 | - none |
| 35 |
| 36 | Screenshots and diffs: `reports/compat/<widget>.{sandbox,reference,diff}.png`. |
| 37 |
| 38 | ## Notes (hand-written; appended to every generated report) |
| 39 |
| 40 | ### What the numbers mean |
| 41 |
| 42 | - The 20 "supported" widgets are the kind an LLM produces for a chat: DOM |
| 43 | toggling with `onclick`, forms, tables, SVG drawn by hand, D3 (bar + line |
| 44 | with axes, `getBBox`, `d3.pointer`), Chart.js (line + bar with tooltips, |
| 45 | loaded from jsDelivr / cdnjs URLs), CSS and rAF animation, pointer drag, |
| 46 | range/color inputs, `localStorage`, `prefers-color-scheme`, a bare fragment. |
| 47 | Each one is driven by a scripted interaction and compared pixel-wise with |
| 48 | the same file rendered natively (reference mode, `connect-src 'none'`). |
| 49 | - Time-dependent widgets (clock, rAF, CSS animation) are checked behaviourally |
| 50 | and screenshot-compared with a 100 % tolerance; everything else uses 2–6 %. |
| 51 | - The two "known-unsupported" widgets (Three.js, raw WebGL) are expected to |
| 52 | fall back; they pass if the fallback renders and no error escapes. |
| 53 |
| 54 | ### Top failure causes found while building the harness (all fixed generally) |
| 55 |
| 56 | 1. **Missing form `submit` events** — the sandboxed renderer frame lacked |
| 57 | `allow-forms`, so Chrome never dispatched `submit`. Affected every form widget. |
| 58 | 2. **`:checked` resolved from attributes** — linkedom's css-select ignores |
| 59 | runtime checkedness (and its aliases beat user pseudo-classes); quiz scored |
| 60 | 0/3. Fixed with a selector rewrite + state-backed pseudo-classes. |
| 61 | 3. **Read-only `window`/`frames`/`top` aliases** — `var frames = 0` silently |
| 62 | kept the window object; counters became `NaN`. |
| 63 | 4. **Scripts from `innerHTML` were executed** — unbounded self re-execution, |
| 64 | ~100 k elements; browsers keep such scripts inert. |
| 65 | 5. **Quirks mode in reference** — doctype-less fragments rendered 1–2 px |
| 66 | differently natively; the product always renders fragments in standards mode. |
| 67 | 6. **Colour scheme** — `color-scheme` on the iframe element does not change |
| 68 | `prefers-color-scheme` inside a sandboxed frame; the host now owns the theme. |
| 69 | 7. **Harness artefacts** — Playwright element screenshots can fire hover on a |
| 70 | shifted layout (park the mouse), worker restarts after a failure lose |
| 71 | in-memory results (persist per test), `test-results/` is wiped per run. |
| 72 |
| 73 | ### Known remaining gaps (not covered by the corpus) |
| 74 |
| 75 | - `light-dark()` inside `style=""` attributes is resolved once. |
| 76 | - `preventDefault()` for the *first* keypress / checkbox toggle cannot cancel |
| 77 | the native default (the renderer learns from the second occurrence on). |
| 78 | - `IntersectionObserver` reports everything as visible; Web Animations API, |
| 79 | Shadow DOM and custom elements are not rendered. |
| 80 | - Sync layout queries cost a worker round trip each (~0.1–0.3 ms here); |
| 81 | D3 axes issue only a handful, Chart.js ~20 `measureText` calls per render |
| 82 | thanks to the per-flush cache. |
| 83 |