whatwg / whatwg/html

ElementInternals should work with customized built-in elements

Open
#5,166 8 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

addition/proposal topic: custom elements
Dominant language
HTML
Stars
9.4k
Forks
3.2k
PR merge metrics
PR metrics pending

Description

Spec: https://html.spec.whatwg.org/C/#dom-attachinternals

Now ElementInternals doesn't work with customized built-in elements because of the first step of attachInternals().

  1. If element's is value is not null, then throw a "NotSupportedError" DOMException.

We can't support Custom State Pseudo Class for customized built-in elements because of this restriction.

Proposal: Remove the step 1.

We need to triage all of IDL attributes/operations of ElementInternals.

  • Attributes/operations for Form-associated custom elements
    Add "Throw "NotSupportedError" DOMException if target element's "is" value is not null." to them

  • Default focus behavior https://github.com/whatwg/html/pull/5120
    Ditto?

  • Default accessibility semantics for custom elements https://github.com/whatwg/html/pull/4658
    I'm not sure if the current PR is reasonable for customized built-in elements. @domenic ?

  • Custom State Pseudo Class
    It should work with customized build-in elements. We need to remove 'autonomous' from the specification.

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

Start at the HTML Standard's ElementInternals and attachInternals() algorithms, then read the linked proposals on default focus behavior and accessibility semantics. Review each listed IDL attribute and operation for customized built-in elements. Done means the specification's treatment of customized built-ins is resolved consistently across these areas.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.