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

[BUG] document.createElement() API should create matching derived type of html element #245

Open
Havunen opened this issue Nov 1, 2023 · 1 comment

Comments

@Havunen
Copy link
Contributor

Havunen commented Nov 1, 2023

Currently when using document.createElement("div") it creates instance of Element class where tag name equals "div".
However Linkedom has all these https://github.com/WebReflection/linkedom/tree/main/esm/html derived types defined in the library but they are not actually used when creating instances of html nodes through JS API.

This feature should make following code pass

var dom = document.createElement("div");

expect(dom instanceof HTMLDivElement).toEqual(true);
@Havunen Havunen changed the title [Feature] document.createElement() API should create matching derived type of html element [BUG] document.createElement() API should create matching derived type of html element Nov 1, 2023
@Havunen
Copy link
Contributor Author

Havunen commented Nov 1, 2023

I changed type of this issue to BUG because I noticed it works just like for some tags but not for all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant