You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I can see there is no appropriate value for as to be set to when preloading an SVG that is later used in a <use> element.
In the test case below the image is never pre-loaded. Testd in Chrome and Firefox the first six issue an “image loaded but not used“ warning, the rest an “unknown or unsupported as value” type of warning.
Why is this relevant? Because this is a often-used method to embed SVG icons in a document. Store all icons in an SVG “sprite” image and reference the icon by ID in a minimal SVG snippet in the HTML document. Given the relevance that icons have in many designs this is also a prime example of a resource that should be pre-loaded.
Edit: The relevant part in the HTML specification. The relevant part in the fetch specification. (Note the explanatory table missing the <use> case. Pun intended.)
<!-- store as image.svg alongside above HTML -->
<svgxmlns="http://www.w3.org/2000/svg"version="1.1"width="20"height="20"viewBox="0 0 20 20">
<pathid="path"d="M0,0H20V20H0z"fill="green"stroke="red"stroke-width="2"/>
</svg>
The text was updated successfully, but these errors were encountered:
As far as I can see there is no appropriate value for
as
to be set to when preloading an SVG that is later used in a<use>
element.In the test case below the image is never pre-loaded. Testd in Chrome and Firefox the first six issue an “image loaded but not used“ warning, the rest an “unknown or unsupported
as
value” type of warning.Why is this relevant? Because this is a often-used method to embed SVG icons in a document. Store all icons in an SVG “sprite” image and reference the icon by ID in a minimal SVG snippet in the HTML document. Given the relevance that icons have in many designs this is also a prime example of a resource that should be pre-loaded.
Maybe this is related to this issue in the fetch spec.
Edit: The relevant part in the HTML specification. The relevant part in the fetch specification. (Note the explanatory table missing the
<use>
case. Pun intended.)My kitchen-sink test case:
The text was updated successfully, but these errors were encountered: