Search For Canvases Under User-Supplied DOM Node
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 24k
- Forks
- 3.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 25
Description
This is causing some issues in a project where we use IFrames and share some libraries between them (explicitly, https://github.com/JuliaGizmos/WebIO.jl/issues/225 is where I lay out the issues we're facing).
Essentially, I'd like to change this line
https://github.com/processing/p5.js/blob/edb41cf513efafd3734221a3b8cdc266f90d6bb3/src/core/main.js#L342
to be something more like
var dom = this._userNode || document;
var canvases = dom.getElementsByTagName('canvas');
I can open up a PR if you'd accept it but I wanted to hear back first.
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
Start in src/core/main.js around line 342, where canvases are searched. Check how the user-supplied DOM node is stored, then verify that canvas lookup is scoped to that node when present and still works otherwise; the change is done when the reported iframe-sharing case can search under the requested node.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- computer-graphics, frontend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100