Open hansi-c opened 2 months ago
I don't think this is allowed by the specification.
Do you mean it is allowed? Can you please confirm that in this case, just because it works in some implementations doesn't mean it's part of the specification
I'm not an expert on SVG, but reading through this: https://www.w3.org/TR/SVG11/struct.html#UseElement, I have not found anything that imposes order on the elements.
None of the examples there do it in the other order so I'd say it's safe to assume it's not guaranteed, so I'd say the first step is to find that it is before proceeding
But in either case this is out of our hands, you should discuss this at ThorVG as we're just using it for our SVGs
Tested versions
System information
Godot v4.3.dev5 - Manjaro Linux #1 SMP PREEMPT_DYNAMIC Fri Mar 1 18:09:53 UTC 2024 - X11 - GLES3 (Compatibility) - AMD Radeon Graphics (radeonsi, renoir, LLVM 16.0.6, DRM 3.49, 6.1.80-1-MANJARO) () - AMD Ryzen 7 PRO 4750U with Radeon Graphics (16 Threads)
Issue description
In SVG we can reference another element like this:
<use href="#spade"/>
. Godot's SVG parser requires the element withid="spade"
to occur before the reference.I don't think this is allowed by the specification. At least, other image viewers render the image properly.
Steps to reproduce
<defs>
section has an elementuse11
that references another elementspade
.spade
is defined later in the document.The files are found in the minimal reproduction project below.
I used Inkscape to export individual playing cards from this bigger file: https://commons.wikimedia.org/wiki/File:Contemporary_playing_cards.svg
Minimal reproduction project (MRP)
SVGbug.zip