Skip to content

fix(render): normalize external SVG namespaces#2734

Open
miguel-heygen wants to merge 1 commit into
mainfrom
fix/external-svg-namespace
Open

fix(render): normalize external SVG namespaces#2734
miguel-heygen wants to merge 1 commit into
mainfrom
fix/external-svg-namespace

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

Problem

High-quality renders silently produced a visually divergent best-effort MP4 when an external SVG omitted its root xmlns. Validation and snapshots passed, but capture emitted FrameCapture:media_load_failed and still exited 0.

Originating source mapping: this PR addresses the authorized report at https://slack.com/archives/C0BGC335AQY/p1784694361653429 (candidate #1520).

Fix

  • normalize namespace-less standalone SVG documents at the producer file-server boundary before browser capture
  • reuse the same normalizer when the core bundler inlines SVG assets, keeping preview/snapshot and render behavior aligned
  • preserve already-namespaced SVG content unchanged

Verification

  • bun test packages/producer/src/services/fileServer.test.ts — 49 passed
  • bunx vitest run packages/core/src/compiler/htmlBundler.test.ts — 45 passed
  • bun run build — passed
  • exact sanitized fixture: check 0 errors/warnings; snapshot saved 2 PNGs; high render exit 0 with no media_load_failed or correctness warning
  • fixed MP4 matches the namespace control byte-for-byte: 5,818 bytes, SHA-256 8940560844427cd94a71d8cb914d0b5c21c63ee26ffe0f51270d7be2d61f38a8, SSIM All 1.000000

Numeric-ID lint and TTS/custom-score behavior are intentionally untouched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant