whatwg / whatwg/html

Give each element a distinct, usable constructor

Open
#896 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

addition/proposal needs implementer interest
Dominant language
HTML
Stars
9.4k
Forks
3.2k
Avg merge
3d 9h
Merged PRs (30d)
38

Description

The spec already defines constructor on e.g. HTMLOptionElement interface. Also, standard elements should be constructable with new if the same will be possible with custom elements.

Update: I just realized that the spec defines HTMLOptionElement constructor as NamedConstructor with name Option, which means let option = new Option() is allowed, but you can't do let option = new HTMLOptionElement(). I guess it's defined this way for compatibility with some legacy implementations, so it was not really a good argument.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the HTML Standard's constructor definitions for standard element interfaces, including HTMLOptionElement and its Option named constructor. Determine the compatibility constraints and the intended constructor behavior for each element; done means the specification clearly defines distinct usable constructors where appropriate.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.