Bug 290983

Summary: fws-supply.website: SVG <use> should work without specifying a fragment identifier
Product: WebKit Reporter: Oliver Williams <oliverwilliams345>
Component: SVGAssignee: Karl Dubost <karlcow>
Status: RESOLVED FIXED    
Severity: Normal CC: agafvv, ahmad.saleem792, chriskirknielsen+wkbugs, karlcow, sabouhallawa, webkit-bug-importer, zimmermann
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
URL: http://wpt.live/svg/struct/reftests/use-external-svg-resource-no-fragment-id.html
See Also: https://bugs.webkit.org/show_bug.cgi?id=191292
Bug Depends on: 65344    
Bug Blocks:    

Oliver Williams
Reported 2025-04-03 02:07:06 PDT
Currently it is necessary to add an id to every SVG that a developer wants to use using <use>. According to the SVG 2 spec, this should no longer be required. Chromium version 137 is will remove this requirement. https://chromestatus.com/feature/5128141573718016 Rather than <svg> <use href="heart.svg#icon"></use> </svg> It should be possible to reference an entire SVG files directly: <svg> <use href="heart.svg"></use> </svg> In a time of HTTP/2, there is no longer a performance need to use sprite sheets. Keeping SVG as separate files is an easier approach. When using <use> for an icon system, needing to add an id to every SVG is laborious and error prone. Relevant spec link is here https://svgwg.org/svg2-draft/struct.html#UseElement
Attachments
Karl Dubost
Comment 1 2025-04-06 22:32:07 PDT
Radar WebKit Bug Importer
Comment 2 2025-04-10 02:08:13 PDT
Karl Dubost
Comment 3 2026-05-12 03:04:41 PDT
> The ‘use’ element can reference an entire SVG document by specifying an ‘href’ value without a fragment. Such references are taken to be referring to the root element of the referenced document.https://w3c.github.io/svgwg/svg2-draft/struct.html#UseElementHrefAttribute
Karl Dubost
Comment 5 2026-05-12 03:52:15 PDT
EWS
Comment 6 2026-05-19 23:33:06 PDT
Committed 313550@main (9ba5d25ffcf1): <https://commits.webkit.org/313550@main> Reviewed commits have been landed. Closing PR #64752 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.