Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] DOM API #49

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

[WIP] DOM API #49

wants to merge 9 commits into from

Conversation

mbasso
Copy link
Owner

@mbasso mbasso commented Nov 8, 2020

This PR aims to implement the new API described in #32.

Here is the list of tasks we need to fulfill:

  • Update emscripten
  • Update CI
  • Update examples
  • Update internals
  • Add new examples that use the new API
  • Tests
  • Documentation

Here is the list of new functions we want to support:

inline int createElement(const char* sel);
inline int createElementNS(const char* sel, const char* ns);
inline int createTextNode(const char* text);
inline int createComment(const char* comment);
inline int createDocumentFragment();

inline void appendChild(const int parentElm, const int childElm);

inline void insertBefore(const int parentElm, const int newElm, const int referenceElm);

inline void setNodeValue(const int elm, const char* value);
inline void setText(const int elm, const char* value);
inline void setComment(const int elm, const char* value);

inline void setAttribute(const int elm, const char* attribute, const char* value);
inline void removeAttribute(const int elm, const char* attribute);

void setProperty(const int elm, const char* property, const emscripten::val value);
void removeProperty(const int elm, const char* property);

void setCallback(const int elm, const char* event, const Callback callback);
void removeCallback(const int elm, const char* event);

inline void remove(const int elm);

inline int parentNode(const int elm);
inline int firstChild(const int elm);
inline int nextSibling(const int elm);

inline emscripten::val getElement(const int elm);
inline int toElement(emscripten::val element);
inline void deleteElement(const int elm);

@mbasso mbasso changed the title Feature/dom api [WIP] DOM API Nov 8, 2020
@mbasso mbasso mentioned this pull request Nov 8, 2020
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant