processing / processing/p5.js

Search For Canvases Under User-Supplied DOM Node

Open
#3,530 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Area:Core
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.