Skip to content

findCanvasEventTarget doesn't use specialHTMLTargets #22942

@JoeOsborn

Description

@JoeOsborn

Please include the following in your bug report:

Version of emscripten/emsdk:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.71 (4171ae200b77a6c266b0e1ebb507d61d1ade3501)
clang version 20.0.0git (https:/github.com/llvm/llvm-project d6344c1cd0d099f8d99ee320f33fc9254dbe8288)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /home/jcoa2018/.local/src/emsdk/upstream/bin

This line in library_html5.js:

// If that is not found either, query via the regular DOM selector.

Seems like it should fall back to findEventTarget, not manual document querying/ID lookup. At a minimum, it should check specialHTMLTargets[target] as well as the other options.

Right now, if you follow the docs and call your canvas e.g. "!canvas" in specialHTMLTargets, createContext seemingly won't be able to find it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions