scratchfoundation / scratchfoundation/scratch-editor
`<use>` elements don't work in SVG costumes (and the Rays backdrop)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 281
- Forks
- 276
- Avg merge
- 7d 8h
- Merged PRs (30d)
- 6
Description
Expected Behavior
Those <use> elements that reference an element inside the costume are rendered normally
Actual Behavior
All <use> elements are removed
This prevents the Rays backdrop from showing up, because it has a clip path with a <use> element applied to everything (https://scratch.mit.edu/discuss/topic/842302/)
It also prevents the dropdown arrows and the pen icon in scratchblocks SVGs from showing up
Steps to Reproduce
Steps to reproduce the behavior:
- Go to 'https://scratch.mit.edu/projects/editor/'
- Add the 'Rays' backdrop
- The backrop appears in the Stage thumbnail, but not on the stage canvas because the
<use>element is removed
System Details
- Windows 10, Chrome 141
from https://scratch.mit.edu/discuss/topic/842302/:
- ChromeOS 14541, Chrome 138
- Windows 7, Chrome 139
- Windows 7, Chrome 109
Screenshots
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the problem in the Scratch project editor with the Rays backdrop and an SVG containing a element. Start by tracing the SVG costume rendering path from the editor, then compare the rendered costume with its source SVG. Done means referenced elements remain available so the Rays backdrop, dropdown arrows, and pen icon render normally.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100