whatwg / whatwg/fetch

Request destination for SVG documents

Open
#1,012 12 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
2.3k
Forks
403
Avg merge
21h 16m
Merged PRs (30d)
4

Description

It's unclear what destination value should be used for SVG documents and different browsers seem to be doing different things, at least when it comes to CSP.

https://svg-discrimination.glitch.me/csp.html is loading fine in Chrome and Safari (as long as img-src: 'self' is there), but the SVG is blocked in Firefox.

At the same time, because SVG document resources are internally represented differently than images in Chromium, an as value of "image" for preloads is a mismatch for SVG documents.

Looking at Fetching the document over in SVG-land doesn't mention destination at all.

We should decide what the destination be, and then align spec and implementations on it.
My personal vote would be for a brand new destination (e.g. "svg" or "svg-document"), to make it easier to explain to developers which CSP or as values control these loads.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Fetch Standard's destination definitions and the linked SVG2 “Fetching the document” section. Compare those with the linked CSP reproduction and Chromium preload issue, then determine an agreed destination for SVG documents and what spec and implementation alignment would count as done.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
api, security, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.