Fix build-breaking ident rewrite, blank-iframe grafting, and layout-gate regressions

Round-3 fixes from gate validation + human visual review of fresh
cropin.com and ooni.com clones:

- app.ts: section data-var rename used an unanchored substring replace,
  so Tile2_data matched inside MediaTile2_data and emitted a corrupted
  Mediatile2Data usage (ReferenceError at prerender). Word-boundary
  regex; every map site now shares one derivation.
- graft.ts: about:blank iframes were blanket-skipped, missing the
  Klaviyo newsletter form (mounted into a blank same-origin frame via
  JS) — the audit's #1 complaint. Blank frames now graft; the
  visibility gate still excludes 0-size tracking pixels.
- walker.ts: isVisible() now rejects boxes wholly outside the viewport
  (off-left always; off-right only when the page isn't horizontally
  scrollable; fixed boxes fully above/below), so a closed slide-in
  drawer's contents no longer count as expected text (91.8% -> 93.4%).
- css.ts: four sizing-regime corrections — pin captured px for
  circular shrink-0 slides (Splide slide chain collapsed 0x0);
  flex-basis:100% for full-width shrink-0 slides; keep fixed-px grid
  templates for scrolling track lists (repeat(N,1fr) squished a
  50-track carousel); single full-bleed fixed track -> minmax(0,1fr);
  keep authored heights whose in-flow children are fill children
  (aspect-video heroes inflated 240 -> 720px); width:100% for
  inset-spanned aspect boxes.

Gate scores: ooni home 88.7 -> 93.3 (responsive 32 fails -> pass),
pizza-ovens 90.8 -> 97.6 (perceptual 46.7% -> 17.2%).
107/107 compiler tests, all workspaces green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Samraaj Bath
2026-07-03 19:42:34 -07:00
co-authored by Claude Fable 5
parent 199359d0a6
commit 7f99b76f66
8 changed files with 708 additions and 10 deletions
+9 -3
View File
@@ -47,15 +47,21 @@ function pageSnap(root: RawNode, url = "https://host.test/page"): PageSnapshot {
}
describe("planForFrameUrl", () => {
it("skips blank/js frames and ad/analytics/captcha domains", () => {
assert.equal(planForFrameUrl(""), "skip");
assert.equal(planForFrameUrl("about:blank"), "skip");
it("skips javascript: frames and ad/analytics/captcha domains", () => {
assert.equal(planForFrameUrl("javascript:void(0)"), "skip");
assert.equal(planForFrameUrl("https://googleads.g.doubleclick.net/pagead/ads"), "skip");
assert.equal(planForFrameUrl("https://www.googletagmanager.com/ns.html?id=GTM-X"), "skip");
assert.equal(planForFrameUrl("https://www.google.com/recaptcha/api2/anchor"), "skip");
});
it("grafts blank/empty-src frames (JS-populated same-origin embeds), visibility-gated upstream", () => {
// Klaviyo lightbox signup, loyalty popups etc. render into a blank same-origin iframe via
// script — no navigable URL, but real content. Invisible tracking pixels sharing a blank
// src are dropped by the cand.visible gate in capture.ts, not here.
assert.equal(planForFrameUrl(""), "graft");
assert.equal(planForFrameUrl("about:blank"), "graft");
});
it("screenshots media-player embeds instead of grafting their JS-built DOM", () => {
assert.equal(planForFrameUrl("https://www.youtube.com/embed/abc123"), "still");
assert.equal(planForFrameUrl("https://player.vimeo.com/video/1"), "still");