WebReflection / WebReflection/linkedom
[BUG] document.createElement() API should create matching derived type of html element
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 2.1k
- Forks
- 104
- PR merge metrics
- No merged PRs in 30d
Description
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);
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with document.createElement("div") and inspect the derived HTML element types listed under esm/html. Trace how the API currently constructs an Element, then verify that creating a div produces an instance of HTMLDivElement as shown in the issue's example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100