WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
290983
fws-supply.website: SVG <use> should work without specifying a fragment identifier
https://bugs.webkit.org/show_bug.cgi?id=290983
Summary
fws-supply.website: SVG <use> should work without specifying a fragment ident...
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
Add attachment
proposed patch, testcase, etc.
Karl Dubost
Comment 1
2025-04-06 22:32:07 PDT
Thanks Oliver for the bug. Probably things to explore around.
https://searchfox.org/wubkat/rev/85b73124f671d6d8fbe2b6dc730b98711b42326d/Source/WebCore/svg/SVGUseElement.cpp#447-482
Radar WebKit Bug Importer
Comment 2
2025-04-10 02:08:13 PDT
<
rdar://problem/148973201
>
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 4
2026-05-12 03:17:49 PDT
https://wpt.fyi/results/svg/struct/reftests/use-external-svg-resource-no-fragment-id.html
Karl Dubost
Comment 5
2026-05-12 03:52:15 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/64752
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.
Top of Page
Format For Printing
XML
Clone This Bug