Skip to content

Visual compare can capture complete external SVGs before embedded fonts settle #1902

Description

@chubes4

Problem

wordpress.visual-compare waits for document.fonts.ready, then filters document.images to images where complete is false before calling HTMLImageElement.decode(). Already-complete external SVG images are therefore skipped even when their internally embedded web fonts have not produced stable glyph metrics.

This creates asymmetric capture when one side explicitly decodes a Blob-backed SVG and the other uses an already-complete external SVG attachment. Outer image geometry can match exactly while text inside the SVG differs in size and spacing.

Observed through Static Site Importer #661: the solved 15-saas fixture retained 100% native conversion, zero invalid blocks, identical image bounding boxes, and complete font embedding for all three expected SVGs, but eight bounded mismatch regions were confined to text inside two external SVG mockups.

Proposed contract

  • Run decode() for every document image that supports it, regardless of the current complete value.
  • Keep the existing bounded readiness timeout and failure isolation.
  • Add deterministic browser coverage with an already-complete external SVG whose font-backed text settles through image decoding.
  • Require source and candidate captures to use the same image-readiness path without arbitrary fixture-specific delays.

Acceptance criteria

  1. An already-complete external SVG is included in visual capture image decoding.
  2. A delayed embedded-font SVG fixture captures stable text metrics.
  3. Existing visual-compare tests remain green.
  4. SSI fixtures/solved/15-saas returns to exact pixel parity through the normal fixture matrix.

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenAI GPT-5.6 Sol via OpenCode
  • Used for: Root-cause analysis and drafting this tracker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions