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

Update to support revamped proposal #604

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

Update to support revamped proposal #604

wants to merge 6 commits into from

Conversation

sorvell
Copy link
Collaborator

@sorvell sorvell commented Dec 19, 2024

Fixes: #603

New proposal: whatwg/html#10854

@sorvell sorvell changed the title Update to sport revamped proposal Update to support revamped proposal Dec 19, 2024
@sorvell
Copy link
Collaborator Author

sorvell commented Feb 27, 2025

To prevent future issues with conflicting with native implementations, let's consider offering a version of this that's more of a ponyfill. For example:

pony(document).createElement(tag, {customElements})
pony(element).customElements
pony(element).attachShadow({mode: 'open', customElements})

This might be fairly annoying in practice and there are some options:

  1. ponyfill or polyfill HTMLElement and CustomElementRegistry?
  2. ponyfill or polyfill relevant APIs, which include:
    • Node.customElements
    • Node.prototype.appendChild
    • Node.prototype.insertBefore
    • DocumentFragment.prototype.append
    • ShadowRoot,.prototype.setHTMLUnsafe
    • ShadowRoot.prototype.innerHTML
    • Element.prototype.insertAdjacentHTML
    • Element.prototype.setHTMLUnsafe
    • Element.prototype.append
    • Element.prototype.prepend
    • Element.prototype.insertAdjacentElement
    • Element.prototype.replaceChild
    • Element.prototype.replaceChildren
    • Element.prototype.replaceWith
    • Element.prototype.innerHTML
    • HTMLElement.prototype.attachShadow
    • HTMLElement.prototype.attachInternals
    • Document.prototype.createElement
    • Document.prototype.createElementNS
    • Document.prototype.importNode

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.

[scoped-custom-element-registry] Update to match new revamped proposal
1 participant