emscripten-core / emscripten-core/emscripten

API mismatch regarding identification of DOM elements

Open
#10,775 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

There is a fundamental mismatch between:
* EGL (for instance) expecting `Module["canvas"]` to be a DOM element directly
* html5.js apis taking **selectors** to identify an element, and not an element directly

As a result, when using DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR and the new target finding mechanism, it's virtually impossible to properly identify the Module's canvas from C code.

For instance, how would you call `emscripten_set_touchcancel_callback` or `emscripten_set_element_css_size` on the module's canvas?

Maybe #10659 would fix this? Anyway, the current state of code just doesn't work :)

cc @juj

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.